interface: add colorspaces support for RGB48 and RGBA64

these colorspaces are packed as RGB or RGBA, not BGR or BGRA.
RGB48_BIG and RGBA64 only differ in the endianess of the channel the 2-byte value.

this is a big difference with RGB24_BIG and RGBA32_BIG, in which case _BIG
means the order is RGB (BGR) and not BGR (BGRA).
BGR48, BGRA64 could indeed be added, if needed.

I chose 0x11 and 0x12 arbitrarily, but given the order of channels 0x1011
and 0x1012 might make more sense. This would mean using another bit for "real"
bigendian colorspaces.

Only the color conversion to 32-bits is implemented.

Tested with the RAWTranslator modified to output 16bpp with success.

Found some references in enum AVPixelFormat in libavutil/pixfmt.h.

Change-Id: I4b023dec85d01f1e63e1b053139e5bb5d263a0e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4468
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Jérôme Duval
2021-09-27 07:21:27 +00:00
parent c1432f757f
commit bb187c91d8
7 changed files with 277 additions and 4 deletions
+6
View File
@@ -149,6 +149,8 @@ typedef enum {
B_NO_COLOR_SPACE = 0x0000,
// linear color space (little endian)
B_RGBA64 = 0x2012, // RGBA RGBA 16:16:16:16
B_RGB48 = 0x0011, // RGB RGB 16:16:16
B_RGB32 = 0x0008, // BGR- -RGB 8:8:8:8
B_RGBA32 = 0x2008, // BGRA ARGB 8:8:8:8
B_RGB24 = 0x0003, // BGR RGB 8:8:8
@@ -160,6 +162,8 @@ typedef enum {
B_GRAY1 = 0x0001, // Each bit represents a single pixel
// linear color space (big endian)
B_RGBA64_BIG = 0x3012, // RGBA RGBA 16:16:16:16
B_RGB48_BIG = 0x1011, // RGB RGB 16:16:16
B_RGB32_BIG = 0x1008, // -RGB BGR- 8:8:8:8
B_RGBA32_BIG = 0x3008, // ARGB BGRA 8:8:8:8
B_RGB24_BIG = 0x1003, // RGB BGR 8:8:8
@@ -168,6 +172,8 @@ typedef enum {
B_RGBA15_BIG = 0x3010, // ARGB BGRA 5:5:5:1
// linear color space (little endian, for completeness)
B_RGBA64_LITTLE = B_RGBA64,
B_RGB48_LITTLE = B_RGB48,
B_RGB32_LITTLE = B_RGB32,
B_RGBA32_LITTLE = B_RGBA32,
B_RGB24_LITTLE = B_RGB24,