Remove extra accidental copy of one file.
This commit is contained in:
		
							parent
							
								
									7cb47c721b
								
							
						
					
					
						commit
						279e619c3b
					
				| @ -1,66 +0,0 @@ | |||||||
| using System; |  | ||||||
| using System.Runtime.InteropServices; |  | ||||||
| 
 |  | ||||||
| namespace Quik.Media.Color |  | ||||||
| { |  | ||||||
|     public class QImageBuffer : QImage |  | ||||||
|     { |  | ||||||
|         private byte[] buffer; |  | ||||||
|         GCHandle handle; |  | ||||||
| 
 |  | ||||||
|         public override QImageFormat InternalFormat { get; } |  | ||||||
|         public override int Width { get; } |  | ||||||
|         public override int Height { get; } |  | ||||||
|         public override int Depth { get; } |  | ||||||
| 
 |  | ||||||
|         public QImageBuffer(QImageFormat format, int width, int height, int depth = 1) |  | ||||||
|         { |  | ||||||
|             InternalFormat = format; |  | ||||||
|             Width = width; |  | ||||||
|             Height = height; |  | ||||||
|             Depth = depth; |  | ||||||
| 
 |  | ||||||
|             buffer = new byte[width * height * depth]; |  | ||||||
|         } |  | ||||||
|         ~QImageBuffer() |  | ||||||
|         { |  | ||||||
|             Dispose(false); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         private QImageLock Lock() |  | ||||||
|         { |  | ||||||
|             handle.Free(); |  | ||||||
|             handle = GCHandle.Alloc(buffer, GCHandleType.Pinned); |  | ||||||
|             IntPtr ptr = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0); |  | ||||||
|             return new QImageLock(InternalFormat, Width, Height, Depth, ptr); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         protected override void Dispose(bool disposing) |  | ||||||
|         { |  | ||||||
|             buffer = null; |  | ||||||
|             handle.Free(); |  | ||||||
| 
 |  | ||||||
|             GC.SuppressFinalize(this); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         public override void LockBits2d(out QImageLock imageLock, QImageLockOptions options) |  | ||||||
|         { |  | ||||||
|             imageLock = Lock(); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         public override void LockBits3d(out QImageLock imageLock, QImageLockOptions options) |  | ||||||
|         { |  | ||||||
|             imageLock = Lock(); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         public override void LockBits3d(out QImageLock imageLock, QImageLockOptions options, int depth) |  | ||||||
|         { |  | ||||||
|             imageLock = Lock(); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         public override void UnlockBits() |  | ||||||
|         { |  | ||||||
|             handle.Free(); |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| } |  | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user