[FFmpeg-devel] [PATCH] Add colorspace properties to pixdesc
Justin Ruggles
justin.ruggles
Thu Apr 30 02:54:44 CEST 2009
Stefano Sabatini wrote:
> Hi,
>
> this seems required for colorutils.c, just a preliminary patch though.
>
> In order to convert a color from one pixfmt to another one I need to
> know the colorspace, then I should be able to apply the correct macro
> from libavcodec/colorspace.h.
>
> Then I'll need to eventually scale each component value, and finally
> assign it to the correct component (for this I need the AVComponent
> color).
>
> I'm not sure this is the rigth approach, so before to fill the
> pixdesc.c table I'd like to hear your opinion.
>
> Regards.
>
> [...]
> +enum AVComponentColor {
> + AV_COLOR_Y,
> + AV_COLOR_U,
> + AV_COLOR_V,
> + AV_COLOR_R,
> + AV_COLOR_G,
> + AV_COLOR_B,
> + AV_COLOR_A,
> + AV_COLOR_NB
> +};
> +
If we want to add other colorspaces in the future such as LAB, CMYK, or
XYZ, using a single letter as the color name could become a problem. Is
'Y' luminance, yellow, or Y-axis? Is 'B' blue or blue/yellow axis?
I can't think of a good alternative right off hand though, I just
thought I would point it out.
-Justin
More information about the ffmpeg-devel
mailing list