12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using CommonLang.Concurrent;
- using System;
- using System.Collections.Generic;
- namespace CommonUI.Display
- {
-
-
-
- public abstract class Image : IDisposable
- {
- private static AtomicLong s_RefCount = new AtomicLong(0);
- private static AtomicLong s_AliveCount = new AtomicLong(0);
- public static long RefCount { get { return s_RefCount.Value; } }
- public static long AliveCount { get { return s_AliveCount.Value; } }
- private bool m_disposed = false;
- protected Image()
- {
- s_RefCount++;
- s_AliveCount++;
- }
- ~Image()
- {
- s_RefCount--;
- }
- public void Dispose()
- {
- if (m_disposed) { return; }
- Disposing();
- m_disposed = true;
- s_AliveCount--;
- }
- public virtual void ReleaseTexture() { }
- protected abstract void Disposing();
- public string name = "Image";
- public virtual int Width { get { return 0; } }
- public virtual int Height { get { return 0; } }
- public virtual float MaxU { get { return 0; } }
- public virtual float MaxV { get { return 0; } }
-
-
-
-
-
-
-
-
-
-
- public abstract void CopyPixels(Image srci, int sx, int sy, int sw, int sh, int dx, int dy);
-
-
-
- public abstract void Flush();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- public struct TImageRegion
- {
- public Image image;
- public float sx, sy, sw, sh;
- }
- }
|