Libav
|
00001 /* 00002 * pixel format descriptor 00003 * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at> 00004 * 00005 * This file is part of FFmpeg. 00006 * 00007 * FFmpeg is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * FFmpeg is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with FFmpeg; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #ifndef AVUTIL_PIXDESC_H 00023 #define AVUTIL_PIXDESC_H 00024 00025 #include <inttypes.h> 00026 00027 typedef struct AVComponentDescriptor{ 00028 uint16_t plane :2; 00029 00034 uint16_t step_minus1 :3; 00035 00040 uint16_t offset_plus1 :3; 00041 uint16_t shift :3; 00042 uint16_t depth_minus1 :4; 00043 }AVComponentDescriptor; 00044 00054 typedef struct AVPixFmtDescriptor{ 00055 const char *name; 00056 uint8_t nb_components; 00057 00065 uint8_t log2_chroma_w; 00066 00074 uint8_t log2_chroma_h; 00075 uint8_t flags; 00076 00082 AVComponentDescriptor comp[4]; 00083 }AVPixFmtDescriptor; 00084 00085 #define PIX_FMT_BE 1 ///< Pixel format is big-endian. 00086 #define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette. 00087 #define PIX_FMT_BITSTREAM 4 ///< All values of a component are bit-wise packed end to end. 00088 #define PIX_FMT_HWACCEL 8 ///< Pixel format is an HW accelerated format. 00089 00093 extern const AVPixFmtDescriptor av_pix_fmt_descriptors[]; 00094 00111 void read_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], 00112 const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component); 00113 00128 void write_line(const uint16_t *src, uint8_t *data[4], const int linesize[4], 00129 const AVPixFmtDescriptor *desc, int x, int y, int c, int w); 00130 00142 enum PixelFormat av_get_pix_fmt(const char *name); 00143 00152 int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc); 00153 00154 #endif /* AVUTIL_PIXDESC_H */