// TODO: test on bigendian box
red = 1;
green = 2;
blue = 3;
bitsPerPixel = 24;
result = new RGBFormat(new Dimension(width, height), -1, Format.byteArray, frameRate, bitsPerPixel, red, green, blue);
break;
case AVCodecLibrary.PIX_FMT_BGR24: ///< Packed RGB 8:8:8, 24bpp, BGRBGR...
// TODO: test on bigendian box
red = 3;
green = 2;
blue = 1;
bitsPerPixel = 24;
result = new RGBFormat(new Dimension(width, height), -1, Format.byteArray, frameRate, bitsPerPixel, red, green, blue);
break;
case AVCodecLibrary.PIX_FMT_RGB32: ///< Packed RGB 8:8:8, 32bpp, (msb)8A 8R 8G 8B(lsb), in cpu endianness
// TODO: test on bigendian box
red = 0xFF0000;
green = 0xFF00;
blue = 0xFF;
bitsPerPixel = 32;
pixelStride = 1;
lineStride = width*pixelStride;
result = new RGBFormat(new Dimension(width, height), -1, Format.intArray, frameRate, bitsPerPixel, red, green, blue, pixelStride, lineStride, Format.FALSE, endianess);
break;
case AVCodecLibrary.PIX_FMT_RGB565: ///< Packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), in cpu endianness
// TODO: test on bigendian box
red = 0x1F;
green = 0x7E0;
blue = 0xF800;
bitsPerPixel = 16;
pixelStride = 1;
lineStride = width*pixelStride;
result = new RGBFormat(new Dimension(width, height), -1, Format.shortArray, frameRate, bitsPerPixel, red, green, blue, pixelStride, lineStride, Format.FALSE, endianess);
break;
case AVCodecLibrary.PIX_FMT_RGB555: ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), in cpu endianness most significant bit to 0
// TODO: test on bigendian box
red = 0x1F;
green = 0x3E0;
blue = 0x7C00;
bitsPerPixel = 16;
pixelStride = 1;
lineStride = width*pixelStride;
result = new RGBFormat(new Dimension(width, height), -1, Format.shortArray, frameRate, bitsPerPixel, red, green, blue, pixelStride, lineStride, Format.FALSE, endianess);
break;
case AVCodecLibrary.PIX_FMT_GRAY8: ///< Y , 8bpp
// TODO: GrayFormat
break;
case AVCodecLibrary.PIX_FMT_MONOWHITE: ///< Y , 1bpp, 0 is white, 1 is black
// TODO: BinaryFormat
break;
case AVCodecLibrary.PIX_FMT_MONOBLACK: ///< Y , 1bpp, 0 is black, 1 is white
// TODO: BinaryFormat
break;
case AVCodecLibrary.PIX_FMT_BGR32: ///< Packed RGB 8:8:8, 32bpp, (msb)8A 8B 8G 8R(lsb), in cpu endianness
// TODO: test on bigendian box
red = 0xFF;
green = 0xFF00;
blue = 0xFF0000;
bitsPerPixel = 32;
pixelStride = 1;
lineStride = width*pixelStride;
result = new RGBFormat(new Dimension(width, height), -1, Format.intArray, frameRate, bitsPerPixel, red, green, blue, pixelStride, lineStride, Format.FALSE, endianess);
break;
case AVCodecLibrary.PIX_FMT_BGR565: ///< Packed RGB 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), in cpu endianness
// TODO: test on bigendian box
red = 0xF800;
green = 0x7E0;
blue = 0x1F;
bitsPerPixel = 16;
pixelStride = 1;
lineStride = width*pixelStride;
result = new RGBFormat(new Dimension(width, height), -1, Format.shortArray, frameRate, bitsPerPixel, red, green, blue, pixelStride, lineStride, Format.FALSE, endianess);
break;
case AVCodecLibrary.PIX_FMT_BGR555: ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), in cpu endianness most significant bit to 1
// TODO: test on bigendian box
red = 0x7C00;
green = 0x3E0;
blue = 0x1F;
bitsPerPixel = 16;
pixelStride = 1;
lineStride = width*pixelStride;
result = new RGBFormat(new Dimension(width, height), -1, Format.shortArray, frameRate, bitsPerPixel, red, green, blue, pixelStride, lineStride, Format.FALSE, endianess);
break;
case AVCodecLibrary.PIX_FMT_BGR8: ///< Packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
// TODO: test on bigendian box
red = 0xE0;
green = 0x1C;
blue = 0x3;
bitsPerPixel = 8;
result = new RGBFormat(new Dimension(width, height), -1, Format.byteArray, frameRate, bitsPerPixel, red, green, blue);
break;
case AVCodecLibrary.PIX_FMT_BGR4: ///< Packed RGB 1:2:1, 4bpp, (msb)1B 2G 1R(lsb)
// TODO: BinaryFormat
break;
case AVCodecLibrary.PIX_FMT_BGR4_BYTE: ///< Packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
// TODO: test on bigendian box
red = 0x8;
green = 0x6;
blue = 0x1;
bitsPerPixel = 8;
result = new RGBFormat(new Dimension(width, height), -1, Format.byteArray, frameRate, bitsPerPixel, red, green, blue);
break;
case AVCodecLibrary.PIX_FMT_RGB8: ///< Packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
// TODO: test on bigendian box
red = 0x7;
green = 0x38;
blue = 0xC0;
bitsPerPixel = 8;
result = new RGBFormat(new Dimension(width, height), -1, Format.byteArray, frameRate, bitsPerPixel, red, green, blue);
break;
case AVCodecLibrary.PIX_FMT_RGB4: ///< Packed RGB 1:2:1, 4bpp, (msb)2R 3G 3B(lsb)
// TODO: BinaryFormat
break;
case AVCodecLibrary.PIX_FMT_RGB4_BYTE: ///< Packed RGB 1:2:1, 8bpp, (msb)2R 3G 3B(lsb)
// TODO: test on bigendian box
red = 0x1;
green = 0x6;
blue = 0x8;
bitsPerPixel = 8;
result = new RGBFormat(new Dimension(width, height), -1, Format.byteArray, frameRate, bitsPerPixel, red, green, blue);
break;
case AVCodecLibrary.PIX_FMT_RGB32_1: ///< Packed RGB 8:8:8, 32bpp, (msb)8R 8G 8B 8A(lsb), in cpu endianness
// not supported as outputformat by ffmpeg
break;
case AVCodecLibrary.PIX_FMT_BGR32_1: ///< Packed RGB 8:8:8, 32bpp, (msb)8B 8G 8R 8A(lsb), in cpu endianness