FFmpeg  1.2.12
pixdesc.h
Go to the documentation of this file.
1 /*
2  * pixel format descriptor
3  * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef AVUTIL_PIXDESC_H
23 #define AVUTIL_PIXDESC_H
24 
25 #include <inttypes.h>
26 #include "pixfmt.h"
27 
28 typedef struct AVComponentDescriptor{
29  uint16_t plane :2;
30 
35  uint16_t step_minus1 :3;
36 
41  uint16_t offset_plus1 :3;
42  uint16_t shift :3;
43  uint16_t depth_minus1 :4;
45 
55 typedef struct AVPixFmtDescriptor{
56  const char *name;
58 
67 
77 
88 
89 #define PIX_FMT_BE 1
90 #define PIX_FMT_PAL 2
91 #define PIX_FMT_BITSTREAM 4
92 #define PIX_FMT_HWACCEL 8
93 #define PIX_FMT_PLANAR 16
94 #define PIX_FMT_RGB 32
95 
100 #define PIX_FMT_PSEUDOPAL 64
101 
102 #define PIX_FMT_ALPHA 128
103 
104 
105 #if FF_API_PIX_FMT_DESC
106 
110 #endif
111 
128 void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
129  const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
130 
145 void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
146  const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
147 
159 enum AVPixelFormat av_get_pix_fmt(const char *name);
160 
167 const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt);
168 
179 char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt);
180 
189 int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
190 
196 
202 
211 
217 
234  int *h_shift, int *v_shift);
235 
236 
237 #endif /* AVUTIL_PIXDESC_H */