Ejemplo n.º 1
0
        public void Dispose()
        {
            if (isDisposed){
                return;
            }
            if (pixelsHandle.IsAllocated){
                pixelsHandle.Free();
            }
            pixelsBase = null;

            isDisposed = true;
            GC.SuppressFinalize(this);
        }
Ejemplo n.º 2
0
 public ColorPixelAccessor(IImageBase image)
 {
     if (image == null){
         throw new ArgumentNullException();
     }
     if (image.Width <= 0 || image.Height <= 0){
         throw new ArgumentOutOfRangeException();
     }
     Width = image.Width;
     Height = image.Height;
     pixelsHandle = GCHandle.Alloc(((ImageBase) image).Pixels, GCHandleType.Pinned);
     pixelsBase = (Color2*) pixelsHandle.AddrOfPinnedObject().ToPointer();
 }
Ejemplo n.º 3
0
 public ColorPixelAccessor(IImageBase image)
 {
     if (image == null)
     {
         throw new ArgumentNullException();
     }
     if (image.Width <= 0 || image.Height <= 0)
     {
         throw new ArgumentOutOfRangeException();
     }
     Width        = image.Width;
     Height       = image.Height;
     pixelsHandle = GCHandle.Alloc(((ImageBase)image).Pixels, GCHandleType.Pinned);
     pixelsBase   = (Color2 *)pixelsHandle.AddrOfPinnedObject().ToPointer();
 }
Ejemplo n.º 4
0
        public void Dispose()
        {
            if (isDisposed)
            {
                return;
            }
            if (pixelsHandle.IsAllocated)
            {
                pixelsHandle.Free();
            }
            pixelsBase = null;

            isDisposed = true;
            GC.SuppressFinalize(this);
        }