lavfi/drawutils: fix planar rgb
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
@@ -197,10 +197,15 @@ void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4
|
||||
|
||||
if (rgba != color->rgba)
|
||||
memcpy(color->rgba, rgba, sizeof(color->rgba));
|
||||
if ((draw->desc->flags & AV_PIX_FMT_FLAG_RGB) && draw->nb_planes == 1 &&
|
||||
if ((draw->desc->flags & AV_PIX_FMT_FLAG_RGB) &&
|
||||
ff_fill_rgba_map(rgba_map, draw->format) >= 0) {
|
||||
if (draw->nb_planes == 1) {
|
||||
for (i = 0; i < 4; i++)
|
||||
color->comp[0].u8[rgba_map[i]] = rgba[i];
|
||||
} else {
|
||||
for (i = 0; i < 4; i++)
|
||||
color->comp[rgba_map[i]].u8[0] = rgba[i];
|
||||
}
|
||||
} else if (draw->nb_planes == 3 || draw->nb_planes == 4) {
|
||||
/* assume YUV */
|
||||
color->comp[0].u8[0] = RGB_TO_Y_CCIR(rgba[0], rgba[1], rgba[2]);
|
||||
|
||||
Reference in New Issue
Block a user