~ubuntu-branches/ubuntu/maverick/zapping/maverick

« back to all changes in this revision

Viewing changes to libvbi/image_format.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-03-08 23:19:08 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050308231908-oip7rfv6lcmo8c0e
Tags: 0.9.2-2ubuntu1
Rebuilt for Python transition (2.3 -> 2.4)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  libzvbi - Image definitions
 
3
 *
 
4
 *  Copyright (C) 2003, 2004 Michael H. Schimek
 
5
 *
 
6
 *  This program is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License version 2 as
 
8
 *  published by the Free Software Foundation.
 
9
 *
 
10
 *  This program is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with this program; if not, write to the Free Software
 
17
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
 */
 
19
 
 
20
/* $Id: image_format.h,v 1.3 2005/01/31 07:15:51 mschimek Exp $ */
 
21
 
 
22
#ifndef __ZVBI3_IMAGE_FORMAT_H__
 
23
#define __ZVBI3_IMAGE_FORMAT_H__
 
24
 
 
25
#include <inttypes.h>           /* uint64_t */
 
26
#include "macros.h"
 
27
 
 
28
VBI3_BEGIN_DECLS
 
29
 
 
30
/**
 
31
 * @addtogroup Types
 
32
 * @{
 
33
 */
 
34
 
 
35
/** Pixel format identifier. */
 
36
typedef enum {
 
37
        VBI3_PIXFMT_NONE,                       /**< */
 
38
        VBI3_PIXFMT_UNKNOWN = VBI3_PIXFMT_NONE, /**< */
 
39
 
 
40
        VBI3_PIXFMT_RESERVED0,
 
41
 
 
42
        /**
 
43
         * Planar YUV formats. Letters XYZ describe the contents of the
 
44
         * first to last plane in memory. Numbers follow standard naming
 
45
         * conventions, e. g. YUV422 means YUV 4:2:2.
 
46
         *
 
47
         * Relative plane sizes of VBI3_PIXFMT_YUV444: 4x4 4x4 4x4
 
48
         */
 
49
        VBI3_PIXFMT_YUV444,
 
50
        VBI3_PIXFMT_YVU444,     /**< 4x4 4x4 4x4 */
 
51
        VBI3_PIXFMT_YUV422,     /**< 4x4 2x4 2x4 */
 
52
        VBI3_PIXFMT_YVU422,     /**< 4x4 2x4 2x4 */
 
53
        VBI3_PIXFMT_YUV411,     /**< 4x4 1x4 1x4 */
 
54
        VBI3_PIXFMT_YVU411,     /**< 4x4 1x4 1x4 */
 
55
        VBI3_PIXFMT_YUV420,     /**< 4x4 2x2 2x2 */
 
56
        VBI3_PIXFMT_YVU420,     /**< 4x4 2x2 2x2 */
 
57
        VBI3_PIXFMT_YUV410,     /**< 4x4 1x1 1x1 */
 
58
        VBI3_PIXFMT_YVU410,     /**< 4x4 1x1 1x1 */
 
59
 
 
60
        /**
 
61
         * Packed YUV formats. Letters WXYZ describe register contents
 
62
         * from last to most significant bit. Numbers are the significant
 
63
         * bits without alpha bits. Appendix _LE means LSB is stored
 
64
         * first in memory, _BE means MSB.
 
65
         *
 
66
         * VBI3_PIXFMT_YUVA24_LE in register: 0xAAVVUUYY, memory: Y U V A
 
67
         */
 
68
        VBI3_PIXFMT_YUVA24_LE,
 
69
        VBI3_PIXFMT_YUVA24_BE,  /**< 0xAAVVUUYY, A V U Y */
 
70
        VBI3_PIXFMT_YVUA24_LE,  /**< 0xAAUUVVYY, Y V U A */
 
71
        VBI3_PIXFMT_YVUA24_BE,  /**< 0xAAUUVVYY, A U V Y */
 
72
 
 
73
        VBI3_PIXFMT_AVUY24_BE = VBI3_PIXFMT_YUVA24_LE,  /**< */
 
74
        VBI3_PIXFMT_AVUY24_LE,  /**< */
 
75
        VBI3_PIXFMT_AUVY24_BE,  /**< */
 
76
        VBI3_PIXFMT_AUVY24_LE,  /**< */
 
77
 
 
78
        VBI3_PIXFMT_YUV24_LE,   /**< 0xVVUUYY, Y U V */
 
79
        VBI3_PIXFMT_YUV24_BE,   /**< 0xVVUUYY, V U Y */
 
80
        VBI3_PIXFMT_YVU24_LE,   /**< 0xUUVVYY, Y V U */
 
81
        VBI3_PIXFMT_YVU24_BE,   /**< 0xUUVVYY, U V Y */
 
82
 
 
83
        VBI3_PIXFMT_VUY24_BE = VBI3_PIXFMT_YUV24_LE,    /**< */
 
84
        VBI3_PIXFMT_VUY24_LE,   /**< */
 
85
        VBI3_PIXFMT_UVY24_BE,   /**< */
 
86
        VBI3_PIXFMT_UVY24_LE,   /**< */
 
87
 
 
88
        /**
 
89
         * Packed YUV 4:2:2 formats. Letters WXYZ describe color components
 
90
         * stored at ascending memory addresses, 8 bits each.
 
91
         *
 
92
         * VBI3_PIXFMT_YUYV: Y0, (U0 + U1) / 2, Y1, (V0 + V1) / 2 in memory
 
93
         */
 
94
        VBI3_PIXFMT_YUYV,
 
95
        VBI3_PIXFMT_YVYU,       /**< Y0  V Y1  U */
 
96
        VBI3_PIXFMT_UYVY,       /**<  U Y0  V Y1 */
 
97
        VBI3_PIXFMT_VYUY,       /**<  V Y0  U Y1 */
 
98
 
 
99
        VBI3_PIXFMT_RESERVED1,
 
100
 
 
101
        /** Y only, 8 bit per pixel. */
 
102
        VBI3_PIXFMT_Y8,
 
103
 
 
104
        VBI3_PIXFMT_RESERVED2,
 
105
        VBI3_PIXFMT_RESERVED3,
 
106
 
 
107
        /**
 
108
         * Packed RGB formats. Letters WXYZ describe register contents
 
109
         * from last to most significant bit. Numbers are the significant
 
110
         * bits without alpha bits. Appendix _LE means LSB is stored
 
111
         * first in memory, _BE means MSB.
 
112
         *
 
113
         * VBI3_PIXFMT_RGBA24_LE in register: 0xAABBGGRR, memory: R G B A
 
114
         */
 
115
        VBI3_PIXFMT_RGBA24_LE,
 
116
        VBI3_PIXFMT_RGBA24_BE,  /**< 0xAABBGGRR, A B G R */
 
117
        VBI3_PIXFMT_BGRA24_LE,  /**< 0xAARRGGBB, B G R A */
 
118
        VBI3_PIXFMT_BGRA24_BE,  /**< 0xAARRGGBB, A R G B */
 
119
 
 
120
        VBI3_PIXFMT_ABGR24_BE = VBI3_PIXFMT_RGBA24_LE,  /**< */
 
121
        VBI3_PIXFMT_ABGR24_LE,  /**< */
 
122
        VBI3_PIXFMT_ARGB24_BE,  /**< */
 
123
        VBI3_PIXFMT_ARGB24_LE,  /**< */
 
124
 
 
125
        VBI3_PIXFMT_RGB24_LE,   /* 0xBBGGRR, R G B */
 
126
        VBI3_PIXFMT_RGB24_BE,   /* 0xRRGGBB, B G R */
 
127
 
 
128
        VBI3_PIXFMT_BGR24_BE = VBI3_PIXFMT_RGB24_LE,    /**< */
 
129
        VBI3_PIXFMT_BGR24_LE,   /**< */
 
130
 
 
131
        /** In register: bbbbbggg gggrrrrr (msb to lsb) */
 
132
        VBI3_PIXFMT_RGB16_LE,
 
133
        VBI3_PIXFMT_RGB16_BE,   /**< */
 
134
        VBI3_PIXFMT_BGR16_LE,   /**< rrrrrggg gggbbbbb */
 
135
        VBI3_PIXFMT_BGR16_BE,   /**< */
 
136
 
 
137
        VBI3_PIXFMT_RGBA15_LE,  /**< abbbbbgg gggrrrrr */
 
138
        VBI3_PIXFMT_RGBA15_BE,  /**< */
 
139
        VBI3_PIXFMT_BGRA15_LE,  /**< arrrrrgg gggbbbbb */
 
140
        VBI3_PIXFMT_BGRA15_BE,  /**< */
 
141
 
 
142
        VBI3_PIXFMT_ARGB15_LE,  /**< bbbbbggg ggrrrrra */
 
143
        VBI3_PIXFMT_ARGB15_BE,  /**< */
 
144
        VBI3_PIXFMT_ABGR15_LE,  /**< rrrrrggg ggbbbbba */
 
145
        VBI3_PIXFMT_ABGR15_BE,  /**< */
 
146
 
 
147
        VBI3_PIXFMT_RGBA12_LE,  /**< aaaabbbb ggggrrrr */
 
148
        VBI3_PIXFMT_RGBA12_BE,  /**< */
 
149
        VBI3_PIXFMT_BGRA12_LE,  /**< aaaarrrr ggggbbbb */
 
150
        VBI3_PIXFMT_BGRA12_BE,  /**< */
 
151
        VBI3_PIXFMT_ARGB12_LE,  /**< bbbbgggg rrrraaaa */
 
152
        VBI3_PIXFMT_ARGB12_BE,  /**< */
 
153
        VBI3_PIXFMT_ABGR12_LE,  /**< rrrrgggg bbbbaaaa */
 
154
        VBI3_PIXFMT_ABGR12_BE,  /**< */
 
155
 
 
156
        VBI3_PIXFMT_RGB8,       /**< bbgggrrr */
 
157
        VBI3_PIXFMT_BGR8,       /**< rrrgggbb */
 
158
 
 
159
        VBI3_PIXFMT_RGBA7,      /**< abbgggrr */
 
160
        VBI3_PIXFMT_BGRA7,      /**< arrgggbb */
 
161
        VBI3_PIXFMT_ARGB7,      /**< bbgggrra */
 
162
        VBI3_PIXFMT_ABGR7       /**< rrgggbba */
 
163
} vbi3_pixfmt;
 
164
 
 
165
#define VBI3_MAX_PIXFMTS 64
 
166
 
 
167
/**
 
168
 * A set of pixel formats is used where more than one
 
169
 * format may apply. Use VBI3_PIXFMT_SET macros
 
170
 * to build a set.
 
171
 */
 
172
typedef uint64_t vbi3_pixfmt_set;
 
173
 
 
174
#define VBI3_PIXFMT_SET(pixfmt) (((vbi3_pixfmt_set) 1) << (pixfmt))
 
175
 
 
176
#define VBI3_PIXFMT_SET_UNKNOWN 0
 
177
#define VBI3_PIXFMT_SET_EMPTY 0
 
178
#define VBI3_PIXFMT_SET_YUV_PLANAR (VBI3_PIXFMT_SET (VBI3_PIXFMT_YUV444) |      \
 
179
                                   VBI3_PIXFMT_SET (VBI3_PIXFMT_YVU444) |       \
 
180
                                   VBI3_PIXFMT_SET (VBI3_PIXFMT_YUV422) |       \
 
181
                                   VBI3_PIXFMT_SET (VBI3_PIXFMT_YVU422) |       \
 
182
                                   VBI3_PIXFMT_SET (VBI3_PIXFMT_YUV411) |       \
 
183
                                   VBI3_PIXFMT_SET (VBI3_PIXFMT_YVU411) |       \
 
184
                                   VBI3_PIXFMT_SET (VBI3_PIXFMT_YUV420) |       \
 
185
                                   VBI3_PIXFMT_SET (VBI3_PIXFMT_YVU420) |       \
 
186
                                   VBI3_PIXFMT_SET (VBI3_PIXFMT_YUV410) |       \
 
187
                                   VBI3_PIXFMT_SET (VBI3_PIXFMT_YVU410))
 
188
#define VBI3_PIXFMT_SET_YUVA24  (VBI3_PIXFMT_SET (VBI3_PIXFMT_YUVA24_LE) | \
 
189
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_YUVA24_BE) | \
 
190
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_YVUA24_LE) | \
 
191
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_YVUA24_BE))
 
192
#define VBI3_PIXFMT_SET_YUV24   (VBI3_PIXFMT_SET (VBI3_PIXFMT_YUV24_LE) |       \
 
193
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_YUV24_BE) |       \
 
194
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_YVU24_LE) |       \
 
195
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_YVU24_BE))
 
196
#define VBI3_PIXFMT_SET_YUV16   (VBI3_PIXFMT_SET (VBI3_PIXFMT_YUYV) |   \
 
197
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_YVYU) |   \
 
198
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_UYVY) |   \
 
199
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_VYUY))
 
200
#define VBI3_PIXFMT_SET_YUV_PACKED (VBI3_PIXFMT_SET_YUVA24 |            \
 
201
                                   VBI3_PIXFMT_SET_YUV24 |              \
 
202
                                   VBI3_PIXFMT_SET_YUV16        |               \
 
203
                                   VBI3_PIXFMT_SET (VBI3_PIXFMT_Y8))
 
204
#define VBI3_PIXFMT_SET_YUV     (VBI3_PIXFMT_SET_YUV_PLANAR |           \
 
205
                                 VBI3_PIXFMT_SET_YUV_PACKED)
 
206
#define VBI3_PIXFMT_SET_RGBA24  (VBI3_PIXFMT_SET (VBI3_PIXFMT_RGBA24_LE) | \
 
207
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_RGBA24_BE) | \
 
208
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_BGRA24_LE) | \
 
209
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_BGRA24_BE))
 
210
#define VBI3_PIXFMT_SET_RGB24   (VBI3_PIXFMT_SET (VBI3_PIXFMT_RGB24_LE) |       \
 
211
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_BGR24_LE))
 
212
#define VBI3_PIXFMT_SET_RGB16   (VBI3_PIXFMT_SET (VBI3_PIXFMT_RGB16_LE) |       \
 
213
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_RGB16_BE) |       \
 
214
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_BGR16_LE) |       \
 
215
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_BGR16_BE))
 
216
#define VBI3_PIXFMT_SET_RGB15   (VBI3_PIXFMT_SET (VBI3_PIXFMT_RGBA15_LE) | \
 
217
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_RGBA15_BE) | \
 
218
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_BGRA15_LE) | \
 
219
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_BGRA15_BE) | \
 
220
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_ARGB15_LE) | \
 
221
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_ARGB15_BE) | \
 
222
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_ABGR15_LE) | \
 
223
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_ABGR15_BE))
 
224
#define VBI3_PIXFMT_SET_RGB12   (VBI3_PIXFMT_SET (VBI3_PIXFMT_RGBA12_LE) | \
 
225
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_RGBA12_BE) | \
 
226
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_BGRA12_LE) | \
 
227
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_BGRA12_BE) | \
 
228
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_ARGB12_LE) | \
 
229
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_ARGB12_BE) | \
 
230
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_ABGR12_LE) | \
 
231
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_ABGR12_BE))
 
232
#define VBI3_PIXFMT_SET_RGB8    (VBI3_PIXFMT_SET (VBI3_PIXFMT_RGB8) |   \
 
233
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_BGR8))
 
234
#define VBI3_PIXFMT_SET_RGB7    (VBI3_PIXFMT_SET (VBI3_PIXFMT_RGBA7) |  \
 
235
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_BGRA7) |  \
 
236
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_ARGB7) |  \
 
237
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_ABGR7))
 
238
#define VBI3_PIXFMT_SET_RGB_PACKED (VBI3_PIXFMT_SET_RGBA24 |            \
 
239
                                   VBI3_PIXFMT_SET_RGB24        |               \
 
240
                                   VBI3_PIXFMT_SET_RGB16        |               \
 
241
                                   VBI3_PIXFMT_SET_RGB15        |               \
 
242
                                   VBI3_PIXFMT_SET_RGB12        |               \
 
243
                                   VBI3_PIXFMT_SET_RGB8 |               \
 
244
                                   VBI3_PIXFMT_SET_RGB7)
 
245
#define VBI3_PIXFMT_SET_RGB     (VBI3_PIXFMT_SET_RGB_PACKED)
 
246
#define VBI3_PIXFMT_SET_PLANAR  (VBI3_PIXFMT_SET_YUV_PLANAR)
 
247
#define VBI3_PIXFMT_SET_PACKED  (VBI3_PIXFMT_SET_YUV_PACKED |           \
 
248
                                 VBI3_PIXFMT_SET_RGB_PACKED)
 
249
#define VBI3_PIXFMT_SET_ALL     (VBI3_PIXFMT_SET_YUV |                  \
 
250
                                 VBI3_PIXFMT_SET_RGB)
 
251
 
 
252
#define VBI3_PIXFMT_IS_YUV(pixfmt)                                      \
 
253
        (0 != (VBI3_PIXFMT_SET (pixfmt) & VBI3_PIXFMT_SET_YUV))
 
254
#define VBI3_PIXFMT_IS_RGB(pixfmt)                                      \
 
255
        (0 != (VBI3_PIXFMT_SET (pixfmt) & VBI3_PIXFMT_SET_RGB))
 
256
#define VBI3_PIXFMT_IS_PLANAR(pixfmt)                                   \
 
257
        (0 != (VBI3_PIXFMT_SET (pixfmt) & VBI3_PIXFMT_SET_PLANAR))
 
258
#define VBI3_PIXFMT_IS_PACKED(pixfmt)                                   \
 
259
        (0 != (VBI3_PIXFMT_SET (pixfmt) & VBI3_PIXFMT_SET_PACKED))
 
260
 
 
261
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
262
 
 
263
#define _VBI3_PIXFMT_SET_4      (VBI3_PIXFMT_SET_YUVA24 |               \
 
264
                                 VBI3_PIXFMT_SET_RGBA24)
 
265
#define _VBI3_PIXFMT_SET_3      (VBI3_PIXFMT_SET_YUV24 |                        \
 
266
                                 VBI3_PIXFMT_SET_RGB24)
 
267
#define _VBI3_PIXFMT_SET_2      (VBI3_PIXFMT_SET_YUV16 |                        \
 
268
                                 VBI3_PIXFMT_SET_RGB16 |                        \
 
269
                                 VBI3_PIXFMT_SET_RGB15 |                        \
 
270
                                 VBI3_PIXFMT_SET_RGB12)
 
271
#define _VBI3_PIXFMT_SET_1      (VBI3_PIXFMT_SET_YUV_PLANAR |           \
 
272
                                 VBI3_PIXFMT_SET (VBI3_PIXFMT_Y8) |     \
 
273
                                 VBI3_PIXFMT_SET_RGB8 |                 \
 
274
                                 VBI3_PIXFMT_SET_RGB7)
 
275
#endif
 
276
 
 
277
#ifdef __GNUC__
 
278
#define vbi3_pixfmt_bytes_per_pixel(pixfmt)                             \
 
279
        (!__builtin_constant_p (pixfmt) ?                               \
 
280
         _vbi3_pixfmt_bytes_per_pixel (pixfmt) :                                \
 
281
          ((VBI3_PIXFMT_SET (pixfmt) & _VBI3_PIXFMT_SET_4) ? 4U :               \
 
282
           ((VBI3_PIXFMT_SET (pixfmt) & _VBI3_PIXFMT_SET_3) ? 3U :      \
 
283
            ((VBI3_PIXFMT_SET (pixfmt) & _VBI3_PIXFMT_SET_2) ? 2U :     \
 
284
             ((VBI3_PIXFMT_SET (pixfmt) & _VBI3_PIXFMT_SET_1) ? 1U :    \
 
285
              0U)))))
 
286
#else
 
287
/**
 
288
 * @param pixfmt Pixel format.
 
289
 *
 
290
 * Returns the number of bytes per pixel used by a pixel format.
 
291
 * For planar YUV formats (which may take a fraction of bytes
 
292
 * on average) the result is 1.
 
293
 * 
 
294
 * @return
 
295
 * Number of bytes per pixel, 0 if @a pixfmt is invalid.
 
296
 */
 
297
#define vbi3_pixfmt_bytes_per_pixel(pixfmt)                             \
 
298
        (_vbi3_pixfmt_bytes_per_pixel (pixfmt))
 
299
#endif
 
300
 
 
301
extern const char *
 
302
vbi3_pixfmt_name                        (vbi3_pixfmt            pixfmt)
 
303
  __attribute__ ((const));
 
304
 
 
305
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
306
 
 
307
extern unsigned int
 
308
_vbi3_pixfmt_bytes_per_pixel    (vbi3_pixfmt            pixfmt)
 
309
  __attribute__ ((const));
 
310
 
 
311
#endif
 
312
 
 
313
/** Color space identifier. No values defined yet. */
 
314
typedef enum {
 
315
        VBI3_COLOR_SPACE_NONE,                          /**< */
 
316
        VBI3_COLOR_SPACE_UNKNOWN = VBI3_COLOR_SPACE_NONE,       /**< */
 
317
} vbi3_color_space;
 
318
 
 
319
/** This structure describes an image buffer. */
 
320
typedef struct {
 
321
        /**
 
322
         * Image width in pixels, for planar formats this refers to
 
323
         * the Y plane and must be a multiple of vbi3_pixel_format.uv_hscale.
 
324
         */
 
325
        unsigned int            width;
 
326
 
 
327
        /**
 
328
         * Image height in pixels, for planar formats this refers to
 
329
         * the Y plane and must be a multiple of tv_pixel_format.uv_vscale.
 
330
         */
 
331
        unsigned int            height;
 
332
 
 
333
        /**
 
334
         * For packed formats bytes_per_line >= (width *
 
335
         * vbi3_pixel_format.bits_per_pixel + 7) / 8. For planar formats
 
336
         * this refers to the Y plane only, with implied y_size =
 
337
         * bytes_per_line * height.
 
338
         */
 
339
        unsigned int            bytes_per_line;
 
340
 
 
341
        /** For planar formats only, refers to the U and V plane. */
 
342
        unsigned int            uv_bytes_per_line;
 
343
 
 
344
        /**
 
345
         * For packed formats the image offset in bytes from the buffer
 
346
         * start. For planar formats this refers to the Y plane.
 
347
         */
 
348
        unsigned int            offset;
 
349
 
 
350
        /**
 
351
         * For planar formats only, the byte offset of the U and V
 
352
         * plane from the start of the buffer.
 
353
         */
 
354
        unsigned int            u_offset;
 
355
        unsigned int            v_offset;
 
356
 
 
357
        /**
 
358
         * Buffer size. For packed formats size >= offset + height *
 
359
         * bytes_per_line. For planar formats size >=
 
360
         * MAX (offset + y_size, u_offset + uv_size, v_offset + uv_size).
 
361
         */
 
362
        unsigned int            size;
 
363
 
 
364
        /** Pixel format used by the buffer. */
 
365
        vbi3_pixfmt             pixfmt;
 
366
 
 
367
        /** Color space used by the buffer. */
 
368
        vbi3_color_space                color_space;
 
369
} vbi3_image_format;
 
370
 
 
371
/** @} */
 
372
 
 
373
VBI3_END_DECLS
 
374
 
 
375
#endif /* __ZVBI3_IMAGE_FORMAT_H__ */