12bit RGB format question

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message

Takashi Mochizuki

  • Posts: 3
  • Joined: Sun Sep 17, 2017 12:31 am

12bit RGB format question

PostWed Sep 09, 2020 7:15 am

Hi All, Please tell me if my understanding is correct or not.

I would like to understand the 12bit RGB pixel format of R12L and R12B.
(in the SDK Document Section 3.4 Pixel Formats).

## bmdFormat12BitRGBLE : ‘R12L’
If I understand correctly, R12L seems to be "BGR36 LE" because 5th byte contains MSB of B0 component.
But it does not follow 4-bytes endianness, and different from other LE formats in this point.

## bmdFormat12BitRGB : ‘R12B’
And the name R12B itself, tells it is BIG Endian though, the actual contained components is not ordered in BE.
In my understanding, BigEndian format should start with MSB of first component from Byte 0.
But Actual R12B (at least in the SDK Document Section 3.4 Pixel Formats), R12B byte 0 contains LSB of first component.

In short, it looks just 32bit endian swapped of R12L format, not BGR36 BE. This really annoying me.

My final gaol is convert R12L/R12B into RGB48 format. But those formats are slightly different from other high bit pixel formats and (If I understand correctly) are incompatible with macOS CoreGraphics/vImage frameworks.

Takashi Mochizuki

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 4 guests