On 07/09/15 14:06, Anton Khirnov wrote: > Quoting Vittorio Giovara (2015-09-07 13:54:02) >> On Mon, Sep 7, 2015 at 1:12 PM, Hendrik Leppkes <h.lepp...@gmail.com> wrote: >>>> 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 >>> >>> Now you're just being silly. >> >> I was rather being sarcastic, it's silly to discuss over a simple 1bit flag. >> >> I can see the point that macros are "useful" to hide the complexity of >> the test, but an interface to check for this kind of thing already >> exists (flags) and the downside of public macros is that you need to >> document, maintain and make sure the new interfaces work. >> >> I insist that a single bitwise check is simpler to understand, use and >> support for users and devs alike. > > The argument is not over one bit, but whether we want to store redundant > information in the descriptor. Having the bit there introduces the > possibility of doing it wrong, by someone adding a new format, but > forgetting to set the flag. So I'd say a function (not a macro, because > that inlines the logic in the caller and that is better avoided) is > preferable. >
Surely having a strong interface (as a function) is probably a good idea. Yet the fact you have 1 channel or 2 of which one is alpha doesn't deliver by itself that the channel is gray per-se. I doubt I'll ever write the code for the IR channel enough cameras and film scanner do support, but it does exist =) Anyway the consensus seems to be not to add the GRAY flag. lu _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel