[FFmpeg-devel] [RFC] Scalar color conversion utils (colorutils.[hc])?

Michael Niedermayer michaelni
Tue Apr 28 23:41:15 CEST 2009

On Tue, Apr 28, 2009 at 10:28:56PM +0200, Stefano Sabatini wrote:
> Hi all,
> the need for such a facility mainly arises for libavfilter filters.
> For example we may need something to work like this:
> pad=padcolor=COLOR
> or
> drawbox=X:Y:COLOR
> and many other filters as well may need to take in input a textual
> representation of a color and convert it to a given colorspace.
> libavcodec/colorspace.h defines some useful macros for converting from
> RGB to YUV, but I think what we need here is a convenient API of the form:
> int av_parse_color(uint16_t color[4], enum PixelFormat dst_pix_fmt, const char *color_string, void *log_ctx)
> and 
> int av_convert_color_to(uint16_t *dst_color[4], enum PixelFormat dst_pix_fmt, 
>                        (uint16_t *src_color[4], enum PixelFormat src_pix_fmt,
>                         void *log_ctx);
> Support for HSV colorspace could be provided defining an HSV pixel format.
> Some of the questions which need a response:

> * We may need a table containing all the colornames <-> color.  In
>   which colorspace should be specified the color? (An RGB32 variant
>   could be the ideal solution.)

doesnt matter ...

> * Where it should be implemented? lavfi or lsws seem the better
>   candidates.

probably lavfi

> * How should be done the color-spec string? It may contains a simple
>   name but also a color specifications. Variants which come to mind:
>   rgb=RR:GG::BB, hsv=HH:SS:VV, yuv=YY:UU:VV.

html 0xRRGGBB must be supported
so must

i see no need for further variants in the near future.

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090428/1cdb9424/attachment.pgp>

More information about the ffmpeg-devel mailing list