public TBG(Size size, TBGPixelFormat format) { this.Size = size; this.PixelFormat = format; int pixelSize = TBGPixelFormats.GetSize(format); this._data = new byte[size.Width * size.Height * pixelSize]; }
public static byte GetBinaryRepresentation(TBGPixelFormat f) { switch (f) { case TBGPixelFormat.BGR: return(0x98); case TBGPixelFormat.BGRA: return(0x0C); } throw new ArgumentException(); }
public static int GetSize(TBGPixelFormat f) { switch (f) { case TBGPixelFormat.BGR: return(3); case TBGPixelFormat.BGRA: return(4); } throw new ArgumentException(); }
public TBG(Size size, TBGPixelFormat format, byte[] data) { this.Size = size; this.PixelFormat = format; this.Data = data; }