public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Is V4L2_PIX_FMT_RGB656 RGB or BGR ?
@ 2011-08-12 16:26 Laurent Pinchart
  2011-08-12 19:18 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Pinchart @ 2011-08-12 16:26 UTC (permalink / raw)
  To: Linux Media Mailing List

According to http://linuxtv.org/downloads/v4l-dvb-apis/packed-rgb.html, 
V4L2_PIX_FMT_RGB565 is defined as

 Identifier           Byte 0 in memory         Byte 1 
                  Bit  7  6  5  4  3  2  1  0    7  6  5  4  3  2  1  0
 V4L2_PIX_FMT_RGB565  g2 g1 g0 r4 r3 r2 r1 r0   b4 b3 b2 b1 b0 g5 g4 g3

As this is stored in little-endian, the color word is thus

b4 b3 b2 b1 b0 g5 g4 g3 g2 g1 g0 r4 r3 r2 r1 r0

This looks awfully like BGR to me, not RGB.

I need to define a FOURCC for the corresponding RGB format

 Identifier           Byte 0 in memory         Byte 1 
                  Bit  7  6  5  4  3  2  1  0    7  6  5  4  3  2  1  0
 V4L2_PIX_FMT_RGB565  g2 g1 g0 b4 b3 b2 b1 b0   r4 r3 r2 r1 r0 g5 g4 g3

Should I call it V4L2_PIX_FMT_BGR565 ? :-)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-13 10:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-12 16:26 Is V4L2_PIX_FMT_RGB656 RGB or BGR ? Laurent Pinchart
2011-08-12 19:18 ` Mauro Carvalho Chehab
2011-08-13 10:22   ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox