throw PixelFormatError (N_("lines()"), _pixel_format);
}
- return size().height / pow(2, d->log2_chroma_h);
+ return size().height / pow(2.0f, d->log2_chroma_h);
}
/** @return Number of components */
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;
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);
bpp[0] = floor ((d->comp[0].depth_minus1 + 1 + 7) / 8);
if (d->nb_components > 1) {
- bpp[1] = floor ((d->comp[1].depth_minus1 + 1 + 7) / 8) / pow (2, d->log2_chroma_w);
+ bpp[1] = floor ((d->comp[1].depth_minus1 + 1 + 7) / 8) / pow (2.0f, d->log2_chroma_w);
}
if (d->nb_components > 2) {
- bpp[2] = floor ((d->comp[2].depth_minus1 + 1 + 7) / 8) / pow (2, d->log2_chroma_w);
+ bpp[2] = floor ((d->comp[2].depth_minus1 + 1 + 7) / 8) / pow (2.0f, d->log2_chroma_w);
}
if (d->nb_components > 3) {
- bpp[3] = floor ((d->comp[3].depth_minus1 + 1 + 7) / 8) / pow (2, d->log2_chroma_w);
+ bpp[3] = floor ((d->comp[3].depth_minus1 + 1 + 7) / 8) / pow (2.0f, d->log2_chroma_w);
}
if ((d->flags & PIX_FMT_PLANAR) == 0) {