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
00086 AVComponentDescriptor comp[4];
00087 }AVPixFmtDescriptor;
00088
00089 #define PIX_FMT_BE 1
00090 #define PIX_FMT_PAL 2
00091 #define PIX_FMT_BITSTREAM 4
00092 #define PIX_FMT_HWACCEL 8
00093 #define PIX_FMT_PLANAR 16
00094 #define PIX_FMT_RGB 32
00095
00100 #define PIX_FMT_PSEUDOPAL 64
00101
00102 #define PIX_FMT_ALPHA 128
00103
00104
00105 #if FF_API_PIX_FMT_DESC
00106
00109 extern const AVPixFmtDescriptor av_pix_fmt_descriptors[];
00110 #endif
00111
00128 void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
00129 const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
00130
00145 void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
00146 const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
00147
00159 enum AVPixelFormat av_get_pix_fmt(const char *name);
00160
00167 const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt);
00168
00179 char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt);
00180
00189 int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
00190
00195 int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
00196
00201 const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt);
00202
00210 const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev);
00211
00216 enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
00217
00233 int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
00234 int *h_shift, int *v_shift);
00235
00236
00237 #endif