Example #1
0
        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];
        }
Example #2
0
        public static byte GetBinaryRepresentation(TBGPixelFormat f)
        {
            switch (f)
            {
            case TBGPixelFormat.BGR:
                return(0x98);

            case TBGPixelFormat.BGRA:
                return(0x0C);
            }
            throw new ArgumentException();
        }
Example #3
0
        public static int GetSize(TBGPixelFormat f)
        {
            switch (f)
            {
            case TBGPixelFormat.BGR:
                return(3);

            case TBGPixelFormat.BGRA:
                return(4);
            }
            throw new ArgumentException();
        }
Example #4
0
 public TBG(Size size, TBGPixelFormat format, byte[] data)
 {
     this.Size        = size;
     this.PixelFormat = format;
     this.Data        = data;
 }