OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 | 11 |
12 /*!\file | 12 /*!\file |
13 * \brief Describes the vpx image descriptor and associated operations | 13 * \brief Describes the vpx image descriptor and associated operations |
14 * | 14 * |
15 */ | 15 */ |
16 #ifdef __cplusplus | 16 #ifdef __cplusplus |
17 extern "C" { | 17 extern "C" { |
18 #endif | 18 #endif |
19 | 19 |
20 #ifndef VPX_IMAGE_H | 20 #ifndef VPX_IMAGE_H |
21 #define VPX_IMAGE_H | 21 #define VPX_IMAGE_H |
22 | 22 |
23 /*!\brief Current ABI version number | 23 /*!\brief Current ABI version number |
24 * | 24 * |
25 * \internal | 25 * \internal |
26 * If this file is altered in any way that changes the ABI, this value | 26 * If this file is altered in any way that changes the ABI, this value |
27 * must be bumped. Examples include, but are not limited to, changing | 27 * must be bumped. Examples include, but are not limited to, changing |
28 * types, removing or reassigning enums, adding/removing/rearranging | 28 * types, removing or reassigning enums, adding/removing/rearranging |
29 * fields to structures | 29 * fields to structures |
30 */ | 30 */ |
31 #define VPX_IMAGE_ABI_VERSION (1) /**<\hideinitializer*/ | 31 #define VPX_IMAGE_ABI_VERSION (1) /**<\hideinitializer*/ |
32 | 32 |
33 | 33 |
34 #define VPX_IMG_FMT_PLANAR 0x100 /**< Image is a planar format */ | 34 #define VPX_IMG_FMT_PLANAR 0x100 /**< Image is a planar format */ |
35 #define VPX_IMG_FMT_UV_FLIP 0x200 /**< V plane precedes U plane in memory */ | 35 #define VPX_IMG_FMT_UV_FLIP 0x200 /**< V plane precedes U plane in memory */ |
36 #define VPX_IMG_FMT_HAS_ALPHA 0x400 /**< Image has an alpha channel component
*/ | 36 #define VPX_IMG_FMT_HAS_ALPHA 0x400 /**< Image has an alpha channel component
*/ |
37 | 37 |
38 | 38 |
39 /*!\brief List of supported image formats */ | 39 /*!\brief List of supported image formats */ |
40 typedef enum vpx_img_fmt { | 40 typedef enum vpx_img_fmt { |
41 VPX_IMG_FMT_NONE, | 41 VPX_IMG_FMT_NONE, |
42 VPX_IMG_FMT_RGB24, /**< 24 bit per pixel packed RGB */ | 42 VPX_IMG_FMT_RGB24, /**< 24 bit per pixel packed RGB */ |
43 VPX_IMG_FMT_RGB32, /**< 32 bit per pixel packed 0RGB */ | 43 VPX_IMG_FMT_RGB32, /**< 32 bit per pixel packed 0RGB */ |
44 VPX_IMG_FMT_RGB565, /**< 16 bit per pixel, 565 */ | 44 VPX_IMG_FMT_RGB565, /**< 16 bit per pixel, 565 */ |
45 VPX_IMG_FMT_RGB555, /**< 16 bit per pixel, 555 */ | 45 VPX_IMG_FMT_RGB555, /**< 16 bit per pixel, 555 */ |
46 VPX_IMG_FMT_UYVY, /**< UYVY packed YUV */ | 46 VPX_IMG_FMT_UYVY, /**< UYVY packed YUV */ |
47 VPX_IMG_FMT_YUY2, /**< YUYV packed YUV */ | 47 VPX_IMG_FMT_YUY2, /**< YUYV packed YUV */ |
48 VPX_IMG_FMT_YVYU, /**< YVYU packed YUV */ | 48 VPX_IMG_FMT_YVYU, /**< YVYU packed YUV */ |
49 VPX_IMG_FMT_BGR24, /**< 24 bit per pixel packed BGR */ | 49 VPX_IMG_FMT_BGR24, /**< 24 bit per pixel packed BGR */ |
50 VPX_IMG_FMT_RGB32_LE, /**< 32 bit packed BGR0 */ | 50 VPX_IMG_FMT_RGB32_LE, /**< 32 bit packed BGR0 */ |
51 VPX_IMG_FMT_ARGB, /**< 32 bit packed ARGB, alpha=255 */ | 51 VPX_IMG_FMT_ARGB, /**< 32 bit packed ARGB, alpha=255 */ |
52 VPX_IMG_FMT_ARGB_LE, /**< 32 bit packed BGRA, alpha=255 */ | 52 VPX_IMG_FMT_ARGB_LE, /**< 32 bit packed BGRA, alpha=255 */ |
53 VPX_IMG_FMT_RGB565_LE, /**< 16 bit per pixel, gggbbbbb rrrrrggg */ | 53 VPX_IMG_FMT_RGB565_LE, /**< 16 bit per pixel, gggbbbbb rrrrrggg */ |
54 VPX_IMG_FMT_RGB555_LE, /**< 16 bit per pixel, gggbbbbb 0rrrrrgg */ | 54 VPX_IMG_FMT_RGB555_LE, /**< 16 bit per pixel, gggbbbbb 0rrrrrgg */ |
55 VPX_IMG_FMT_YV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 1, /**<
planar YVU */ | 55 VPX_IMG_FMT_YV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 1, /**< pla
nar YVU */ |
56 VPX_IMG_FMT_I420 = VPX_IMG_FMT_PLANAR | 2, | 56 VPX_IMG_FMT_I420 = VPX_IMG_FMT_PLANAR | 2, |
57 VPX_IMG_FMT_VPXYV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 3, /**
< planar 4:2:0 format with vpx color space */ | 57 VPX_IMG_FMT_VPXYV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 3, /** < pl
anar 4:2:0 format with vpx color space */ |
58 VPX_IMG_FMT_VPXI420 = VPX_IMG_FMT_PLANAR | 4 /** < planar 4:2:0 format
with vpx color space */ | 58 VPX_IMG_FMT_VPXI420 = VPX_IMG_FMT_PLANAR | 4 /** < planar 4:2:0 format wit
h vpx color space */ |
59 } | 59 } |
60 vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */ | 60 vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */ |
61 | 61 |
62 #if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT | 62 #if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT |
63 #define IMG_FMT_PLANAR VPX_IMG_FMT_PLANAR /**< \deprecated Use #VPX_
IMG_FMT_PLANAR */ | 63 #define IMG_FMT_PLANAR VPX_IMG_FMT_PLANAR /**< \deprecated Use #VPX_
IMG_FMT_PLANAR */ |
64 #define IMG_FMT_UV_FLIP VPX_IMG_FMT_UV_FLIP /**< \deprecated Use #VPX_
IMG_FMT_UV_FLIP */ | 64 #define IMG_FMT_UV_FLIP VPX_IMG_FMT_UV_FLIP /**< \deprecated Use #VPX_
IMG_FMT_UV_FLIP */ |
65 #define IMG_FMT_HAS_ALPHA VPX_IMG_FMT_HAS_ALPHA /**< \deprecated Use #VPX_
IMG_FMT_HAS_ALPHA */ | 65 #define IMG_FMT_HAS_ALPHA VPX_IMG_FMT_HAS_ALPHA /**< \deprecated Use #VPX_
IMG_FMT_HAS_ALPHA */ |
66 | 66 |
67 /*!\brief Deprecated list of supported image formats | 67 /*!\brief Deprecated list of supported image formats |
68 * \deprecated New code should use #vpx_img_fmt | 68 * \deprecated New code should use #vpx_img_fmt |
69 */ | 69 */ |
70 #define img_fmt vpx_img_fmt | 70 #define img_fmt vpx_img_fmt |
71 /*!\brief alias for enum img_fmt. | 71 /*!\brief alias for enum img_fmt. |
72 * \deprecated New code should use #vpx_img_fmt_t | 72 * \deprecated New code should use #vpx_img_fmt_t |
73 */ | 73 */ |
74 #define img_fmt_t vpx_img_fmt_t | 74 #define img_fmt_t vpx_img_fmt_t |
75 | 75 |
76 #define IMG_FMT_NONE VPX_IMG_FMT_NONE /**< \deprecated Use #VPX_IMG_
FMT_NONE */ | 76 #define IMG_FMT_NONE VPX_IMG_FMT_NONE /**< \deprecated Use #VPX_IMG_
FMT_NONE */ |
77 #define IMG_FMT_RGB24 VPX_IMG_FMT_RGB24 /**< \deprecated Use #VPX_IMG_
FMT_RGB24 */ | 77 #define IMG_FMT_RGB24 VPX_IMG_FMT_RGB24 /**< \deprecated Use #VPX_IMG_
FMT_RGB24 */ |
78 #define IMG_FMT_RGB32 VPX_IMG_FMT_RGB32 /**< \deprecated Use #VPX_IMG_
FMT_RGB32 */ | 78 #define IMG_FMT_RGB32 VPX_IMG_FMT_RGB32 /**< \deprecated Use #VPX_IMG_
FMT_RGB32 */ |
79 #define IMG_FMT_RGB565 VPX_IMG_FMT_RGB565 /**< \deprecated Use #VPX_IMG_
FMT_RGB565 */ | 79 #define IMG_FMT_RGB565 VPX_IMG_FMT_RGB565 /**< \deprecated Use #VPX_IMG_
FMT_RGB565 */ |
80 #define IMG_FMT_RGB555 VPX_IMG_FMT_RGB555 /**< \deprecated Use #VPX_IMG_
FMT_RGB555 */ | 80 #define IMG_FMT_RGB555 VPX_IMG_FMT_RGB555 /**< \deprecated Use #VPX_IMG_
FMT_RGB555 */ |
81 #define IMG_FMT_UYVY VPX_IMG_FMT_UYVY /**< \deprecated Use #VPX_IMG_
FMT_UYVY */ | 81 #define IMG_FMT_UYVY VPX_IMG_FMT_UYVY /**< \deprecated Use #VPX_IMG_
FMT_UYVY */ |
82 #define IMG_FMT_YUY2 VPX_IMG_FMT_YUY2 /**< \deprecated Use #VPX_IMG_
FMT_YUY2 */ | 82 #define IMG_FMT_YUY2 VPX_IMG_FMT_YUY2 /**< \deprecated Use #VPX_IMG_
FMT_YUY2 */ |
83 #define IMG_FMT_YVYU VPX_IMG_FMT_YVYU /**< \deprecated Use #VPX_IMG_
FMT_YVYU */ | 83 #define IMG_FMT_YVYU VPX_IMG_FMT_YVYU /**< \deprecated Use #VPX_IMG_
FMT_YVYU */ |
84 #define IMG_FMT_BGR24 VPX_IMG_FMT_BGR24 /**< \deprecated Use #VPX_IMG_
FMT_BGR24 */ | 84 #define IMG_FMT_BGR24 VPX_IMG_FMT_BGR24 /**< \deprecated Use #VPX_IMG_
FMT_BGR24 */ |
85 #define IMG_FMT_RGB32_LE VPX_IMG_FMT_RGB32_LE /**< \deprecated Use #VPX_IMG_
FMT_RGB32_LE */ | 85 #define IMG_FMT_RGB32_LE VPX_IMG_FMT_RGB32_LE /**< \deprecated Use #VPX_IMG_
FMT_RGB32_LE */ |
86 #define IMG_FMT_ARGB VPX_IMG_FMT_ARGB /**< \deprecated Use #VPX_IMG_
FMT_ARGB */ | 86 #define IMG_FMT_ARGB VPX_IMG_FMT_ARGB /**< \deprecated Use #VPX_IMG_
FMT_ARGB */ |
87 #define IMG_FMT_ARGB_LE VPX_IMG_FMT_ARGB_LE /**< \deprecated Use #VPX_IMG_
FMT_ARGB_LE */ | 87 #define IMG_FMT_ARGB_LE VPX_IMG_FMT_ARGB_LE /**< \deprecated Use #VPX_IMG_
FMT_ARGB_LE */ |
88 #define IMG_FMT_RGB565_LE VPX_IMG_FMT_RGB565_LE /**< \deprecated Use #VPX_IMG_
FMT_RGB565_LE */ | 88 #define IMG_FMT_RGB565_LE VPX_IMG_FMT_RGB565_LE /**< \deprecated Use #VPX_IMG_
FMT_RGB565_LE */ |
89 #define IMG_FMT_RGB555_LE VPX_IMG_FMT_RGB555_LE /**< \deprecated Use #VPX_IMG_
FMT_RGB555_LE */ | 89 #define IMG_FMT_RGB555_LE VPX_IMG_FMT_RGB555_LE /**< \deprecated Use #VPX_IMG_
FMT_RGB555_LE */ |
90 #define IMG_FMT_YV12 VPX_IMG_FMT_YV12 /**< \deprecated Use #VPX_IMG_
FMT_YV12 */ | 90 #define IMG_FMT_YV12 VPX_IMG_FMT_YV12 /**< \deprecated Use #VPX_IMG_
FMT_YV12 */ |
91 #define IMG_FMT_I420 VPX_IMG_FMT_I420 /**< \deprecated Use #VPX_IMG_
FMT_I420 */ | 91 #define IMG_FMT_I420 VPX_IMG_FMT_I420 /**< \deprecated Use #VPX_IMG_
FMT_I420 */ |
92 #define IMG_FMT_VPXYV12 VPX_IMG_FMT_VPXYV12 /**< \deprecated Use #VPX_IMG_
FMT_VPXYV12 */ | 92 #define IMG_FMT_VPXYV12 VPX_IMG_FMT_VPXYV12 /**< \deprecated Use #VPX_IMG_
FMT_VPXYV12 */ |
93 #define IMG_FMT_VPXI420 VPX_IMG_FMT_VPXI420 /**< \deprecated Use #VPX_IMG_
FMT_VPXI420 */ | 93 #define IMG_FMT_VPXI420 VPX_IMG_FMT_VPXI420 /**< \deprecated Use #VPX_IMG_
FMT_VPXI420 */ |
94 #endif /* VPX_CODEC_DISABLE_COMPAT */ | 94 #endif /* VPX_CODEC_DISABLE_COMPAT */ |
95 | 95 |
96 /**\brief Image Descriptor */ | 96 /**\brief Image Descriptor */ |
97 typedef struct vpx_image | 97 typedef struct vpx_image { |
98 { | 98 vpx_img_fmt_t fmt; /**< Image Format */ |
99 vpx_img_fmt_t fmt; /**< Image Format */ | |
100 | 99 |
101 /* Image storage dimensions */ | 100 /* Image storage dimensions */ |
102 unsigned int w; /**< Stored image width */ | 101 unsigned int w; /**< Stored image width */ |
103 unsigned int h; /**< Stored image height */ | 102 unsigned int h; /**< Stored image height */ |
104 | 103 |
105 /* Image display dimensions */ | 104 /* Image display dimensions */ |
106 unsigned int d_w; /**< Displayed image width */ | 105 unsigned int d_w; /**< Displayed image width */ |
107 unsigned int d_h; /**< Displayed image height */ | 106 unsigned int d_h; /**< Displayed image height */ |
108 | 107 |
109 /* Chroma subsampling info */ | 108 /* Chroma subsampling info */ |
110 unsigned int x_chroma_shift; /**< subsampling order, X */ | 109 unsigned int x_chroma_shift; /**< subsampling order, X */ |
111 unsigned int y_chroma_shift; /**< subsampling order, Y */ | 110 unsigned int y_chroma_shift; /**< subsampling order, Y */ |
112 | 111 |
113 /* Image data pointers. */ | 112 /* Image data pointers. */ |
114 #define VPX_PLANE_PACKED 0 /**< To be used for all packed formats */ | 113 #define VPX_PLANE_PACKED 0 /**< To be used for all packed formats */ |
115 #define VPX_PLANE_Y 0 /**< Y (Luminance) plane */ | 114 #define VPX_PLANE_Y 0 /**< Y (Luminance) plane */ |
116 #define VPX_PLANE_U 1 /**< U (Chroma) plane */ | 115 #define VPX_PLANE_U 1 /**< U (Chroma) plane */ |
117 #define VPX_PLANE_V 2 /**< V (Chroma) plane */ | 116 #define VPX_PLANE_V 2 /**< V (Chroma) plane */ |
118 #define VPX_PLANE_ALPHA 3 /**< A (Transparency) plane */ | 117 #define VPX_PLANE_ALPHA 3 /**< A (Transparency) plane */ |
119 #if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT | 118 #if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT |
120 #define PLANE_PACKED VPX_PLANE_PACKED | 119 #define PLANE_PACKED VPX_PLANE_PACKED |
121 #define PLANE_Y VPX_PLANE_Y | 120 #define PLANE_Y VPX_PLANE_Y |
122 #define PLANE_U VPX_PLANE_U | 121 #define PLANE_U VPX_PLANE_U |
123 #define PLANE_V VPX_PLANE_V | 122 #define PLANE_V VPX_PLANE_V |
124 #define PLANE_ALPHA VPX_PLANE_ALPHA | 123 #define PLANE_ALPHA VPX_PLANE_ALPHA |
125 #endif | 124 #endif |
126 unsigned char *planes[4]; /**< pointer to the top left pixel for each p
lane */ | 125 unsigned char *planes[4]; /**< pointer to the top left pixel for each plane
*/ |
127 int stride[4]; /**< stride between rows for each plane */ | 126 int stride[4]; /**< stride between rows for each plane */ |
128 | 127 |
129 int bps; /**< bits per sample (for packed formats) */ | 128 int bps; /**< bits per sample (for packed formats) */ |
130 | 129 |
131 /* The following member may be set by the application to associate data | 130 /* The following member may be set by the application to associate data |
132 * with this image. | 131 * with this image. |
133 */ | 132 */ |
134 void *user_priv; /**< may be set by the application to associate data | 133 void *user_priv; /**< may be set by the application to associate data |
135 * with this image. */ | 134 * with this image. */ |
136 | 135 |
137 /* The following members should be treated as private. */ | 136 /* The following members should be treated as private. */ |
138 unsigned char *img_data; /**< private */ | 137 unsigned char *img_data; /**< private */ |
139 int img_data_owner; /**< private */ | 138 int img_data_owner; /**< private */ |
140 int self_allocd; /**< private */ | 139 int self_allocd; /**< private */ |
141 } vpx_image_t; /**< alias for struct vpx_image */ | 140 } vpx_image_t; /**< alias for struct vpx_image */ |
142 | 141 |
143 /**\brief Representation of a rectangle on a surface */ | 142 /**\brief Representation of a rectangle on a surface */ |
144 typedef struct vpx_image_rect | 143 typedef struct vpx_image_rect { |
145 { | 144 unsigned int x; /**< leftmost column */ |
146 unsigned int x; /**< leftmost column */ | 145 unsigned int y; /**< topmost row */ |
147 unsigned int y; /**< topmost row */ | 146 unsigned int w; /**< width */ |
148 unsigned int w; /**< width */ | 147 unsigned int h; /**< height */ |
149 unsigned int h; /**< height */ | 148 } vpx_image_rect_t; /**< alias for struct vpx_image_rect */ |
150 } vpx_image_rect_t; /**< alias for struct vpx_image_rect */ | |
151 | 149 |
152 /*!\brief Open a descriptor, allocating storage for the underlying image | 150 /*!\brief Open a descriptor, allocating storage for the underlying image |
153 * | 151 * |
154 * Returns a descriptor for storing an image of the given format. The | 152 * Returns a descriptor for storing an image of the given format. The |
155 * storage for the descriptor is allocated on the heap. | 153 * storage for the descriptor is allocated on the heap. |
156 * | 154 * |
157 * \param[in] img Pointer to storage for descriptor. If this parame
ter | 155 * \param[in] img Pointer to storage for descriptor. If this paramete
r |
158 * is NULL, the storage for the descriptor will be | 156 * is NULL, the storage for the descriptor will be |
159 * allocated on the heap. | 157 * allocated on the heap. |
160 * \param[in] fmt Format for the image | 158 * \param[in] fmt Format for the image |
161 * \param[in] d_w Width of the image | 159 * \param[in] d_w Width of the image |
162 * \param[in] d_h Height of the image | 160 * \param[in] d_h Height of the image |
163 * \param[in] align Alignment, in bytes, of the image buffer and | 161 * \param[in] align Alignment, in bytes, of the image buffer and |
164 * each row in the image(stride). | 162 * each row in the image(stride). |
165 * | 163 * |
166 * \return Returns a pointer to the initialized image descriptor. If the img | 164 * \return Returns a pointer to the initialized image descriptor. If the img |
167 * parameter is non-null, the value of the img parameter will be | 165 * parameter is non-null, the value of the img parameter will be |
168 * returned. | 166 * returned. |
169 */ | 167 */ |
170 vpx_image_t *vpx_img_alloc(vpx_image_t *img, | 168 vpx_image_t *vpx_img_alloc(vpx_image_t *img, |
171 vpx_img_fmt_t fmt, | 169 vpx_img_fmt_t fmt, |
172 unsigned int d_w, | 170 unsigned int d_w, |
173 unsigned int d_h, | 171 unsigned int d_h, |
174 unsigned int align); | 172 unsigned int align); |
175 | 173 |
176 /*!\brief Open a descriptor, using existing storage for the underlying image | 174 /*!\brief Open a descriptor, using existing storage for the underlying image |
177 * | 175 * |
178 * Returns a descriptor for storing an image of the given format. The | 176 * Returns a descriptor for storing an image of the given format. The |
179 * storage for descriptor has been allocated elsewhere, and a descriptor is | 177 * storage for descriptor has been allocated elsewhere, and a descriptor is |
180 * desired to "wrap" that storage. | 178 * desired to "wrap" that storage. |
181 * | 179 * |
182 * \param[in] img Pointer to storage for descriptor. If this parame
ter | 180 * \param[in] img Pointer to storage for descriptor. If this paramete
r |
183 * is NULL, the storage for the descriptor will be | 181 * is NULL, the storage for the descriptor will be |
184 * allocated on the heap. | 182 * allocated on the heap. |
185 * \param[in] fmt Format for the image | 183 * \param[in] fmt Format for the image |
186 * \param[in] d_w Width of the image | 184 * \param[in] d_w Width of the image |
187 * \param[in] d_h Height of the image | 185 * \param[in] d_h Height of the image |
188 * \param[in] align Alignment, in bytes, of each row in the image. | 186 * \param[in] align Alignment, in bytes, of each row in the image. |
189 * \param[in] img_data Storage to use for the image | 187 * \param[in] img_data Storage to use for the image |
190 * | 188 * |
191 * \return Returns a pointer to the initialized image descriptor. If the img | 189 * \return Returns a pointer to the initialized image descriptor. If the img |
192 * parameter is non-null, the value of the img parameter will be | 190 * parameter is non-null, the value of the img parameter will be |
193 * returned. | 191 * returned. |
194 */ | 192 */ |
195 vpx_image_t *vpx_img_wrap(vpx_image_t *img, | 193 vpx_image_t *vpx_img_wrap(vpx_image_t *img, |
196 vpx_img_fmt_t fmt, | 194 vpx_img_fmt_t fmt, |
197 unsigned int d_w, | 195 unsigned int d_w, |
198 unsigned int d_h, | 196 unsigned int d_h, |
199 unsigned int align, | 197 unsigned int align, |
200 unsigned char *img_data); | 198 unsigned char *img_data); |
201 | 199 |
202 | 200 |
203 /*!\brief Set the rectangle identifying the displayed portion of the image | 201 /*!\brief Set the rectangle identifying the displayed portion of the image |
204 * | 202 * |
205 * Updates the displayed rectangle (aka viewport) on the image surface to | 203 * Updates the displayed rectangle (aka viewport) on the image surface to |
206 * match the specified coordinates and size. | 204 * match the specified coordinates and size. |
207 * | 205 * |
208 * \param[in] img Image descriptor | 206 * \param[in] img Image descriptor |
209 * \param[in] x leftmost column | 207 * \param[in] x leftmost column |
210 * \param[in] y topmost row | 208 * \param[in] y topmost row |
211 * \param[in] w width | 209 * \param[in] w width |
212 * \param[in] h height | 210 * \param[in] h height |
213 * | 211 * |
214 * \return 0 if the requested rectangle is valid, nonzero otherwise. | 212 * \return 0 if the requested rectangle is valid, nonzero otherwise. |
215 */ | 213 */ |
216 int vpx_img_set_rect(vpx_image_t *img, | 214 int vpx_img_set_rect(vpx_image_t *img, |
217 unsigned int x, | 215 unsigned int x, |
218 unsigned int y, | 216 unsigned int y, |
219 unsigned int w, | 217 unsigned int w, |
220 unsigned int h); | 218 unsigned int h); |
221 | 219 |
222 | 220 |
223 /*!\brief Flip the image vertically (top for bottom) | 221 /*!\brief Flip the image vertically (top for bottom) |
224 * | 222 * |
225 * Adjusts the image descriptor's pointers and strides to make the image | 223 * Adjusts the image descriptor's pointers and strides to make the image |
226 * be referenced upside-down. | 224 * be referenced upside-down. |
227 * | 225 * |
228 * \param[in] img Image descriptor | 226 * \param[in] img Image descriptor |
229 */ | 227 */ |
230 void vpx_img_flip(vpx_image_t *img); | 228 void vpx_img_flip(vpx_image_t *img); |
231 | 229 |
232 /*!\brief Close an image descriptor | 230 /*!\brief Close an image descriptor |
233 * | 231 * |
234 * Frees all allocated storage associated with an image descriptor. | 232 * Frees all allocated storage associated with an image descriptor. |
235 * | 233 * |
236 * \param[in] img Image descriptor | 234 * \param[in] img Image descriptor |
237 */ | 235 */ |
238 void vpx_img_free(vpx_image_t *img); | 236 void vpx_img_free(vpx_image_t *img); |
239 | 237 |
240 #endif | 238 #endif |
241 #ifdef __cplusplus | 239 #ifdef __cplusplus |
242 } | 240 } |
243 #endif | 241 #endif |
OLD | NEW |