2 * Copyright (c) 2017 Clément Bœsch <u pkh me>
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #include "libswscale/swscale_internal.h"
23 /* TODO: drop this wrapper when all the is*() becomes functions */
24 #define DECLARE_WRAPPER(macro) \
25 static int macro##_func(enum AVPixelFormat pix_fmt) \
27 return macro(pix_fmt); \
30 DECLARE_WRAPPER(is16BPS)
31 DECLARE_WRAPPER(isNBPS)
33 DECLARE_WRAPPER(isYUV)
34 DECLARE_WRAPPER(isPlanarYUV)
35 DECLARE_WRAPPER(isRGB)
36 DECLARE_WRAPPER(isGray)
37 DECLARE_WRAPPER(isRGBinInt)
38 DECLARE_WRAPPER(isBGRinInt)
39 DECLARE_WRAPPER(isBayer)
40 DECLARE_WRAPPER(isAnyRGB)
41 DECLARE_WRAPPER(isALPHA)
42 DECLARE_WRAPPER(isPacked)
43 DECLARE_WRAPPER(isPlanar)
44 DECLARE_WRAPPER(isPackedRGB)
45 DECLARE_WRAPPER(isPlanarRGB)
46 DECLARE_WRAPPER(usePal)
50 int (*cond)(enum AVPixelFormat pix_fmt);
52 {"is16BPS", is16BPS_func},
53 {"isNBPS", isNBPS_func},
55 {"isYUV", isYUV_func},
56 {"isPlanarYUV", isPlanarYUV_func},
57 {"isRGB", isRGB_func},
58 {"Gray", isGray_func},
59 {"RGBinInt", isRGBinInt_func},
60 {"BGRinInt", isBGRinInt_func},
61 {"Bayer", isBayer_func},
62 {"AnyRGB", isAnyRGB_func},
63 {"ALPHA", isALPHA_func},
64 {"Packed", isPacked_func},
65 {"Planar", isPlanar_func},
66 {"PackedRGB", isPackedRGB_func},
67 {"PlanarRGB", isPlanarRGB_func},
68 {"usePal", usePal_func},
75 for (i = 0; i < FF_ARRAY_ELEMS(query_tab); i++) {
76 const AVPixFmtDescriptor *pix_desc = NULL;
77 printf("%s:\n", query_tab[i].class);
78 while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) {
79 enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(pix_desc);
80 if (query_tab[i].cond(pix_fmt))
81 printf(" %s\n", pix_desc->name);