00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVUTIL_PIXDESC_H
00023 #define AVUTIL_PIXDESC_H
00024
00025 #include <inttypes.h>
00026 #include "pixfmt.h"
00027
00028 typedef struct AVComponentDescriptor{
00029 uint16_t plane :2;
00030
00035 uint16_t step_minus1 :3;
00036
00041 uint16_t offset_plus1 :3;
00042 uint16_t shift :3;
00043 uint16_t depth_minus1 :4;
00044 }AVComponentDescriptor;
00045
00055 typedef struct AVPixFmtDescriptor{
00056 const char *name;
00057 uint8_t nb_components;
00058
00066 uint8_t log2_chroma_w;
00067
00075 uint8_t log2_chroma_h;
00076 uint8_t flags;
00077
00083 AVComponentDescriptor comp[4];
00084 }AVPixFmtDescriptor;
00085
00086 #define PIX_FMT_BE 1
00087 #define PIX_FMT_PAL 2
00088 #define PIX_FMT_BITSTREAM 4
00089 #define PIX_FMT_HWACCEL 8
00090 #define PIX_FMT_PLANAR 16
00091 #define PIX_FMT_RGB 32
00092
00093
00096 extern const AVPixFmtDescriptor av_pix_fmt_descriptors[];
00097
00114 void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
00115 const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
00116
00131 void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
00132 const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
00133
00145 enum PixelFormat av_get_pix_fmt(const char *name);
00146
00153 const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt);
00154
00165 char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
00166
00175 int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
00176
00177 #endif