On Mon, Sep 7, 2015 at 1:10 PM, Hendrik Leppkes <h.lepp...@gmail.com> wrote:
> On Mon, Sep 7, 2015 at 12:59 PM, Niels Möller <ni...@lysator.liu.se> wrote:
>> Vittorio Giovara <vittorio.giov...@gmail.com> writes:
>>
>>> if (desc->flags & AV_PIX_FMT_FLAG_GRAY)
>>>
>>> is much simpler, more concise, and more correct than
>>>
>>> if ((desc->nb_components == 1 || (desc->nb_components == 2 &&
>>> desc->flags & AV_PIX_FMT_FLAG_ALPHA) && !(desc->flags &
>>> AV_PIX_FMT_FLAG_RGB))
>>>
>>> don't you think? ^_*
>>
>> Sure, but AV_PIX_FMT_IS_GRAY(desc) would be concise too. One can have
>> redundant interfaces with extra sugar, without putting redundant data in
>> the data structures.
>>
>
> I agree.

by that reasoning we should drop AV_PIX_FMT_FLAG_RGB and just do

if (strstr(pix_fmt, "rgb") || strstr(pix_fmt, "bgr"))

sometimes you need redundant data for consistency and for simpler
interfaces, without having N different ways to access the same kind of
information, in my opinion
Cheers
-- 
Vittorio
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to