summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-06-13 21:24:56 +0100
committerCarl Hetherington <cth@carlh.net>2013-06-13 21:24:56 +0100
commit43b4e55710271c797b5d251c891047ed4da20e10 (patch)
treecf81a81a300f517326774a5d8f74b9fee2574345 /src
parent96721a3afd47e171c4c82120cdb26e9679b0f89a (diff)
Add somewhat empirical support for YUVJ42{0,2,4}P pixels.
Diffstat (limited to 'src')
-rw-r--r--src/lib/image.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc
index bd527e91e..f28652d4e 100644
--- a/src/lib/image.cc
+++ b/src/lib/image.cc
@@ -273,11 +273,11 @@ void
Image::make_black ()
{
/* U/V black value for 8-bit colour */
- static uint8_t const eight_bit_uv = (1 << 7) - 1;
+ static uint8_t const eight_bit_uv = (1 << 7) - 1;
/* U/V black value for 9-bit colour */
- static uint16_t const nine_bit_uv = (1 << 8) - 1;
+ static uint16_t const nine_bit_uv = (1 << 8) - 1;
/* U/V black value for 10-bit colour */
- static uint16_t const ten_bit_uv = (1 << 9) - 1;
+ static uint16_t const ten_bit_uv = (1 << 9) - 1;
/* U/V black value for 16-bit colour */
static uint16_t const sixteen_bit_uv = (1 << 15) - 1;
@@ -290,6 +290,14 @@ Image::make_black ()
memset (data()[2], eight_bit_uv, lines(2) * stride()[2]);
break;
+ case PIX_FMT_YUVJ420P:
+ case PIX_FMT_YUVJ422P:
+ case PIX_FMT_YUVJ444P:
+ memset (data()[0], 0, lines(0) * stride()[0]);
+ memset (data()[1], eight_bit_uv + 1, lines(1) * stride()[1]);
+ memset (data()[2], eight_bit_uv + 1, lines(2) * stride()[2]);
+ break;
+
case PIX_FMT_YUV422P9LE:
case PIX_FMT_YUV444P9LE:
yuv_16_black (nine_bit_uv);