pixdesc_query.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. #include "libswscale/swscale_internal.h"
  21. static const struct {
  22. const char *class;
  23. int (*cond)(enum AVPixelFormat pix_fmt);
  24. } query_tab[] = {
  25. {"is16BPS", is16BPS},
  26. {"isNBPS", isNBPS},
  27. {"isBE", isBE},
  28. {"isYUV", isYUV},
  29. {"isPlanarYUV", isPlanarYUV},
  30. {"isRGB", isRGB},
  31. {"Gray", isGray},
  32. {"RGBinInt", isRGBinInt},
  33. {"BGRinInt", isBGRinInt},
  34. {"Bayer", isBayer},
  35. {"AnyRGB", isAnyRGB},
  36. {"ALPHA", isALPHA},
  37. {"Packed", isPacked},
  38. {"Planar", isPlanar},
  39. {"PackedRGB", isPackedRGB},
  40. {"PlanarRGB", isPlanarRGB},
  41. {"usePal", usePal},
  42. };
  43. int main(void)
  44. {
  45. int i;
  46. for (i = 0; i < FF_ARRAY_ELEMS(query_tab); i++) {
  47. const AVPixFmtDescriptor *pix_desc = NULL;
  48. printf("%s:\n", query_tab[i].class);
  49. while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) {
  50. enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(pix_desc);
  51. if (query_tab[i].cond(pix_fmt))
  52. printf(" %s\n", pix_desc->name);
  53. }
  54. printf("\n");
  55. }
  56. return 0;
  57. }