FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pixdesc_query.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Clément Bœsch <u pkh me>
3  *
4  * This file is part of FFmpeg.
5  *
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.
10  *
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.
15  *
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
19  */
20 
22 
23 static const struct {
24  const char *class;
26 } query_tab[] = {
27  {"is16BPS", is16BPS},
28  {"isNBPS", isNBPS},
29  {"isBE", isBE},
30  {"isYUV", isYUV},
31  {"isPlanarYUV", isPlanarYUV},
32  {"isRGB", isRGB},
33  {"Gray", isGray},
34  {"RGBinInt", isRGBinInt},
35  {"BGRinInt", isBGRinInt},
36  {"Bayer", isBayer},
37  {"AnyRGB", isAnyRGB},
38  {"ALPHA", isALPHA},
39  {"Packed", isPacked},
40  {"Planar", isPlanar},
41  {"PackedRGB", isPackedRGB},
42  {"PlanarRGB", isPlanarRGB},
43  {"usePal", usePal},
44 };
45 
46 int main(void)
47 {
48  int i;
49 
50  for (i = 0; i < FF_ARRAY_ELEMS(query_tab); i++) {
51  const AVPixFmtDescriptor *pix_desc = NULL;
52  printf("%s:\n", query_tab[i].class);
53  while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) {
55  if (query_tab[i].cond(pix_fmt))
56  printf(" %s\n", pix_desc->name);
57  }
58  printf("\n");
59  }
60  return 0;
61 }
#define NULL
Definition: coverity.c:32
static av_always_inline int isAnyRGB(enum AVPixelFormat pix_fmt)
static enum AVPixelFormat pix_fmt
static av_always_inline int isPlanarRGB(enum AVPixelFormat pix_fmt)
static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt)
int main(void)
Definition: pixdesc_query.c:46
int(* cond)(enum AVPixelFormat pix_fmt)
Definition: pixdesc_query.c:25
#define isALPHA(x)
Definition: swscale.c:51
static av_always_inline int isYUV(enum AVPixelFormat pix_fmt)
const char * name
Definition: pixdesc.h:82
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
Definition: pixdesc.c:2352
static av_always_inline int isBayer(enum AVPixelFormat pix_fmt)
#define FF_ARRAY_ELEMS(a)
#define isGray(x)
Definition: swscale.c:40
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
static const struct @250 query_tab[]
static av_always_inline int isPlanar(enum AVPixelFormat pix_fmt)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
static av_always_inline int isRGBinInt(enum AVPixelFormat pix_fmt)
static av_always_inline int isPlanarYUV(enum AVPixelFormat pix_fmt)
int
static av_always_inline int isBGRinInt(enum AVPixelFormat pix_fmt)
static av_always_inline int isPackedRGB(enum AVPixelFormat pix_fmt)
static av_always_inline int usePal(enum AVPixelFormat pix_fmt)
static av_always_inline int isPacked(enum AVPixelFormat pix_fmt)
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60
static av_always_inline int isNBPS(enum AVPixelFormat pix_fmt)
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
Definition: pixdesc.c:2340