]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/pixdesc.h
swscale: remove duplicate conversion routine in swScale().
[ffmpeg] / libavutil / pixdesc.h
index 8996f2f8652a1d1d8497496746d28eab60a1d83a..979a23539b3c9109adb9c99377741d2f1d358583 100644 (file)
@@ -2,20 +2,20 @@
  * pixel format descriptor
  * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -23,6 +23,7 @@
 #define AVUTIL_PIXDESC_H
 
 #include <inttypes.h>
+#include "pixfmt.h"
 
 typedef struct AVComponentDescriptor{
     uint16_t plane        :2;            ///< which of the 4 planes contains the component
@@ -109,7 +110,7 @@ extern const AVPixFmtDescriptor av_pix_fmt_descriptors[];
  * data[0]. The behavior is undefined if the format is not paletted.
  */
 void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
-               const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
+                        const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
 
 /**
  * Write the values from src to the pixel format component c of an
@@ -126,7 +127,7 @@ void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesiz
  * values to write to the image line
  */
 void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
-                const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
+                         const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
 
 /**
  * Return the pixel format corresponding to name.
@@ -141,6 +142,26 @@ void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesi
  */
 enum PixelFormat av_get_pix_fmt(const char *name);
 
+/**
+ * Return the short name for a pixel format, NULL in case pix_fmt is
+ * unknown.
+ *
+ * @see av_get_pix_fmt(), av_get_pix_fmt_string()
+ */
+const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt);
+
+/**
+ * Print in buf the string corresponding to the pixel format with
+ * number pix_fmt, or an header if pix_fmt is negative.
+ *
+ * @param buf the buffer where to write the string
+ * @param buf_size the size of buf
+ * @param pix_fmt the number of the pixel format to print the
+ * corresponding info string, or a negative value to print the
+ * corresponding header.
+ */
+char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
+
 /**
  * Return the number of bits per pixel used by the pixel format
  * described by pixdesc.