Subversion Repositories Games.Prince of Persia

Rev

Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 8
Line 34... Line 34...
34
typedef struct WebPDecoderOptions WebPDecoderOptions;
34
typedef struct WebPDecoderOptions WebPDecoderOptions;
35
typedef struct WebPDecoderConfig WebPDecoderConfig;
35
typedef struct WebPDecoderConfig WebPDecoderConfig;
36
 
36
 
37
// Return the decoder's version number, packed in hexadecimal using 8bits for
37
// Return the decoder's version number, packed in hexadecimal using 8bits for
38
// each of major/minor/revision. E.g: v2.5.7 is 0x020507.
38
// each of major/minor/revision. E.g: v2.5.7 is 0x020507.
39
WEBP_EXTERN(int) WebPGetDecoderVersion(void);
39
WEBP_EXTERN int WebPGetDecoderVersion(void);
40
 
40
 
41
// Retrieve basic header information: width, height.
41
// Retrieve basic header information: width, height.
42
// This function will also validate the header, returning true on success,
42
// This function will also validate the header, returning true on success,
43
// false otherwise. '*width' and '*height' are only valid on successful return.
43
// false otherwise. '*width' and '*height' are only valid on successful return.
44
// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant.
44
// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant.
45
WEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, size_t data_size,
45
WEBP_EXTERN int WebPGetInfo(const uint8_t* data, size_t data_size,
46
                             int* width, int* height);
46
                            int* width, int* height);
47
 
47
 
48
// Decodes WebP images pointed to by 'data' and returns RGBA samples, along
48
// Decodes WebP images pointed to by 'data' and returns RGBA samples, along
49
// with the dimensions in *width and *height. The ordering of samples in
49
// with the dimensions in *width and *height. The ordering of samples in
50
// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent).
50
// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent).
51
// The returned pointer should be deleted calling WebPFree().
51
// The returned pointer should be deleted calling WebPFree().
52
// Returns NULL in case of error.
52
// Returns NULL in case of error.
53
WEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, size_t data_size,
53
WEBP_EXTERN uint8_t* WebPDecodeRGBA(const uint8_t* data, size_t data_size,
54
                                     int* width, int* height);
54
                                    int* width, int* height);
55
 
55
 
56
// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data.
56
// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data.
57
WEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, size_t data_size,
57
WEBP_EXTERN uint8_t* WebPDecodeARGB(const uint8_t* data, size_t data_size,
58
                                     int* width, int* height);
58
                                    int* width, int* height);
59
 
59
 
60
// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data.
60
// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data.
61
WEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, size_t data_size,
61
WEBP_EXTERN uint8_t* WebPDecodeBGRA(const uint8_t* data, size_t data_size,
62
                                     int* width, int* height);
62
                                    int* width, int* height);
63
 
63
 
64
// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data.
64
// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data.
65
// If the bitstream contains transparency, it is ignored.
65
// If the bitstream contains transparency, it is ignored.
66
WEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, size_t data_size,
66
WEBP_EXTERN uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size,
67
                                    int* width, int* height);
67
                                   int* width, int* height);
68
 
68
 
69
// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data.
69
// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data.
70
WEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, size_t data_size,
70
WEBP_EXTERN uint8_t* WebPDecodeBGR(const uint8_t* data, size_t data_size,
71
                                    int* width, int* height);
71
                                   int* width, int* height);
72
 
72
 
73
 
73
 
74
// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer
74
// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer
75
// returned is the Y samples buffer. Upon return, *u and *v will point to
75
// returned is the Y samples buffer. Upon return, *u and *v will point to
76
// the U and V chroma data. These U and V buffers need NOT be passed to
76
// the U and V chroma data. These U and V buffers need NOT be passed to
Line 78... Line 78...
78
// planes are both (*width + 1) / 2 and (*height + 1)/ 2.
78
// planes are both (*width + 1) / 2 and (*height + 1)/ 2.
79
// Upon return, the Y buffer has a stride returned as '*stride', while U and V
79
// Upon return, the Y buffer has a stride returned as '*stride', while U and V
80
// have a common stride returned as '*uv_stride'.
80
// have a common stride returned as '*uv_stride'.
81
// Return NULL in case of error.
81
// Return NULL in case of error.
82
// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr
82
// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr
83
WEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, size_t data_size,
83
WEBP_EXTERN uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size,
84
                                    int* width, int* height,
84
                                   int* width, int* height,
85
                                    uint8_t** u, uint8_t** v,
85
                                   uint8_t** u, uint8_t** v,
86
                                    int* stride, int* uv_stride);
86
                                   int* stride, int* uv_stride);
87
 
87
 
88
// Releases memory returned by the WebPDecode*() functions above.
88
// Releases memory returned by the WebPDecode*() functions above.
89
WEBP_EXTERN(void) WebPFree(void* ptr);
89
WEBP_EXTERN void WebPFree(void* ptr);
90
 
90
 
91
// These five functions are variants of the above ones, that decode the image
91
// These five functions are variants of the above ones, that decode the image
92
// directly into a pre-allocated buffer 'output_buffer'. The maximum storage
92
// directly into a pre-allocated buffer 'output_buffer'. The maximum storage
93
// available in this buffer is indicated by 'output_buffer_size'. If this
93
// available in this buffer is indicated by 'output_buffer_size'. If this
94
// storage is not sufficient (or an error occurred), NULL is returned.
94
// storage is not sufficient (or an error occurred), NULL is returned.
95
// Otherwise, output_buffer is returned, for convenience.
95
// Otherwise, output_buffer is returned, for convenience.
96
// The parameter 'output_stride' specifies the distance (in bytes)
96
// The parameter 'output_stride' specifies the distance (in bytes)
97
// between scanlines. Hence, output_buffer_size is expected to be at least
97
// between scanlines. Hence, output_buffer_size is expected to be at least
98
// output_stride x picture-height.
98
// output_stride x picture-height.
99
WEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto(
99
WEBP_EXTERN uint8_t* WebPDecodeRGBAInto(
100
    const uint8_t* data, size_t data_size,
100
    const uint8_t* data, size_t data_size,
101
    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);
101
    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);
102
WEBP_EXTERN(uint8_t*) WebPDecodeARGBInto(
102
WEBP_EXTERN uint8_t* WebPDecodeARGBInto(
103
    const uint8_t* data, size_t data_size,
103
    const uint8_t* data, size_t data_size,
104
    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);
104
    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);
105
WEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto(
105
WEBP_EXTERN uint8_t* WebPDecodeBGRAInto(
106
    const uint8_t* data, size_t data_size,
106
    const uint8_t* data, size_t data_size,
107
    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);
107
    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);
108
 
108
 
109
// RGB and BGR variants. Here too the transparency information, if present,
109
// RGB and BGR variants. Here too the transparency information, if present,
110
// will be dropped and ignored.
110
// will be dropped and ignored.
111
WEBP_EXTERN(uint8_t*) WebPDecodeRGBInto(
111
WEBP_EXTERN uint8_t* WebPDecodeRGBInto(
112
    const uint8_t* data, size_t data_size,
112
    const uint8_t* data, size_t data_size,
113
    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);
113
    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);
114
WEBP_EXTERN(uint8_t*) WebPDecodeBGRInto(
114
WEBP_EXTERN uint8_t* WebPDecodeBGRInto(
115
    const uint8_t* data, size_t data_size,
115
    const uint8_t* data, size_t data_size,
116
    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);
116
    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);
117
 
117
 
118
// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly
118
// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly
119
// into pre-allocated luma/chroma plane buffers. This function requires the
119
// into pre-allocated luma/chroma plane buffers. This function requires the
120
// strides to be passed: one for the luma plane and one for each of the
120
// strides to be passed: one for the luma plane and one for each of the
121
// chroma ones. The size of each plane buffer is passed as 'luma_size',
121
// chroma ones. The size of each plane buffer is passed as 'luma_size',
122
// 'u_size' and 'v_size' respectively.
122
// 'u_size' and 'v_size' respectively.
123
// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred
123
// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred
124
// during decoding (or because some buffers were found to be too small).
124
// during decoding (or because some buffers were found to be too small).
125
WEBP_EXTERN(uint8_t*) WebPDecodeYUVInto(
125
WEBP_EXTERN uint8_t* WebPDecodeYUVInto(
126
    const uint8_t* data, size_t data_size,
126
    const uint8_t* data, size_t data_size,
127
    uint8_t* luma, size_t luma_size, int luma_stride,
127
    uint8_t* luma, size_t luma_size, int luma_stride,
128
    uint8_t* u, size_t u_size, int u_stride,
128
    uint8_t* u, size_t u_size, int u_stride,
129
    uint8_t* v, size_t v_size, int v_stride);
129
    uint8_t* v, size_t v_size, int v_stride);
130
 
130
 
Line 166... Line 166...
166
 
166
 
167
static WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) {
167
static WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) {
168
  return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB ||
168
  return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB ||
169
          mode == MODE_RGBA_4444 || mode == MODE_YUVA ||
169
          mode == MODE_RGBA_4444 || mode == MODE_YUVA ||
170
          WebPIsPremultipliedMode(mode));
170
          WebPIsPremultipliedMode(mode));
171
}
171
}
172
 
172
 
173
static WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) {
173
static WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) {
174
  return (mode < MODE_YUV);
174
  return (mode < MODE_YUV);
175
}
175
}
176
 
176
 
Line 179... Line 179...
179
 
179
 
180
struct WebPRGBABuffer {    // view as RGBA
180
struct WebPRGBABuffer {    // view as RGBA
181
  uint8_t* rgba;    // pointer to RGBA samples
181
  uint8_t* rgba;    // pointer to RGBA samples
182
  int stride;       // stride in bytes from one scanline to the next.
182
  int stride;       // stride in bytes from one scanline to the next.
183
  size_t size;      // total size of the *rgba buffer.
183
  size_t size;      // total size of the *rgba buffer.
184
};
184
};
185
 
185
 
186
struct WebPYUVABuffer {              // view as YUVA
186
struct WebPYUVABuffer {              // view as YUVA
187
  uint8_t* y, *u, *v, *a;     // pointer to luma, chroma U/V, alpha samples
187
  uint8_t* y, *u, *v, *a;     // pointer to luma, chroma U/V, alpha samples
188
  int y_stride;               // luma stride
188
  int y_stride;               // luma stride
189
  int u_stride, v_stride;     // chroma strides
189
  int u_stride, v_stride;     // chroma strides
Line 204... Line 204...
204
  union {
204
  union {
205
    WebPRGBABuffer RGBA;
205
    WebPRGBABuffer RGBA;
206
    WebPYUVABuffer YUVA;
206
    WebPYUVABuffer YUVA;
207
  } u;                       // Nameless union of buffer parameters.
207
  } u;                       // Nameless union of buffer parameters.
208
  uint32_t       pad[4];     // padding for later use
208
  uint32_t       pad[4];     // padding for later use
209
 
209
 
210
  uint8_t* private_memory;   // Internally allocated memory (only when
210
  uint8_t* private_memory;   // Internally allocated memory (only when
211
                             // is_external_memory is 0). Should not be used
211
                             // is_external_memory is 0). Should not be used
212
                             // externally, but accessed via the buffer union.
212
                             // externally, but accessed via the buffer union.
213
};
213
};
214
 
214
 
215
// Internal, version-checked, entry point
215
// Internal, version-checked, entry point
216
WEBP_EXTERN(int) WebPInitDecBufferInternal(WebPDecBuffer*, int);
216
WEBP_EXTERN int WebPInitDecBufferInternal(WebPDecBuffer*, int);
217
 
217
 
218
// Initialize the structure as empty. Must be called before any other use.
218
// Initialize the structure as empty. Must be called before any other use.
219
// Returns false in case of version mismatch
219
// Returns false in case of version mismatch
220
static WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) {
220
static WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) {
221
  return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION);
221
  return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION);
222
}
222
}
223
 
223
 
224
// Free any memory associated with the buffer. Must always be called last.
224
// Free any memory associated with the buffer. Must always be called last.
225
// Note: doesn't free the 'buffer' structure itself.
225
// Note: doesn't free the 'buffer' structure itself.
226
WEBP_EXTERN(void) WebPFreeDecBuffer(WebPDecBuffer* buffer);
226
WEBP_EXTERN void WebPFreeDecBuffer(WebPDecBuffer* buffer);
227
 
227
 
228
//------------------------------------------------------------------------------
228
//------------------------------------------------------------------------------
229
// Enumeration of the status codes
229
// Enumeration of the status codes
230
 
230
 
231
typedef enum VP8StatusCode {
231
typedef enum VP8StatusCode {
Line 275... Line 275...
275
// not set to 0. In such a case, it is allowed to modify the pointers, size and
275
// not set to 0. In such a case, it is allowed to modify the pointers, size and
276
// stride of output_buffer.u.RGBA or output_buffer.u.YUVA, provided they remain
276
// stride of output_buffer.u.RGBA or output_buffer.u.YUVA, provided they remain
277
// within valid bounds.
277
// within valid bounds.
278
// All other fields of WebPDecBuffer MUST remain constant between calls.
278
// All other fields of WebPDecBuffer MUST remain constant between calls.
279
// Returns NULL if the allocation failed.
279
// Returns NULL if the allocation failed.
280
WEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer);
280
WEBP_EXTERN WebPIDecoder* WebPINewDecoder(WebPDecBuffer* output_buffer);
281
 
281
 
282
// This function allocates and initializes an incremental-decoder object, which
282
// This function allocates and initializes an incremental-decoder object, which
283
// will output the RGB/A samples specified by 'csp' into a preallocated
283
// will output the RGB/A samples specified by 'csp' into a preallocated
284
// buffer 'output_buffer'. The size of this buffer is at least
284
// buffer 'output_buffer'. The size of this buffer is at least
285
// 'output_buffer_size' and the stride (distance in bytes between two scanlines)
285
// 'output_buffer_size' and the stride (distance in bytes between two scanlines)
Line 287... Line 287...
287
// Additionally, output_buffer can be passed NULL in which case the output
287
// Additionally, output_buffer can be passed NULL in which case the output
288
// buffer will be allocated automatically when the decoding starts. The
288
// buffer will be allocated automatically when the decoding starts. The
289
// colorspace 'csp' is taken into account for allocating this buffer. All other
289
// colorspace 'csp' is taken into account for allocating this buffer. All other
290
// parameters are ignored.
290
// parameters are ignored.
291
// Returns NULL if the allocation failed, or if some parameters are invalid.
291
// Returns NULL if the allocation failed, or if some parameters are invalid.
292
WEBP_EXTERN(WebPIDecoder*) WebPINewRGB(
292
WEBP_EXTERN WebPIDecoder* WebPINewRGB(
293
    WEBP_CSP_MODE csp,
293
    WEBP_CSP_MODE csp,
294
    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);
294
    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);
295
 
295
 
296
// This function allocates and initializes an incremental-decoder object, which
296
// This function allocates and initializes an incremental-decoder object, which
297
// will output the raw luma/chroma samples into a preallocated planes if
297
// will output the raw luma/chroma samples into a preallocated planes if
Line 302... Line 302...
302
// can be pass NULL in case one is not interested in the transparency plane.
302
// can be pass NULL in case one is not interested in the transparency plane.
303
// Conversely, 'luma' can be passed NULL if no preallocated planes are supplied.
303
// Conversely, 'luma' can be passed NULL if no preallocated planes are supplied.
304
// In this case, the output buffer will be automatically allocated (using
304
// In this case, the output buffer will be automatically allocated (using
305
// MODE_YUVA) when decoding starts. All parameters are then ignored.
305
// MODE_YUVA) when decoding starts. All parameters are then ignored.
306
// Returns NULL if the allocation failed or if a parameter is invalid.
306
// Returns NULL if the allocation failed or if a parameter is invalid.
307
WEBP_EXTERN(WebPIDecoder*) WebPINewYUVA(
307
WEBP_EXTERN WebPIDecoder* WebPINewYUVA(
308
    uint8_t* luma, size_t luma_size, int luma_stride,
308
    uint8_t* luma, size_t luma_size, int luma_stride,
309
    uint8_t* u, size_t u_size, int u_stride,
309
    uint8_t* u, size_t u_size, int u_stride,
310
    uint8_t* v, size_t v_size, int v_stride,
310
    uint8_t* v, size_t v_size, int v_stride,
311
    uint8_t* a, size_t a_size, int a_stride);
311
    uint8_t* a, size_t a_size, int a_stride);
312
 
312
 
313
// Deprecated version of the above, without the alpha plane.
313
// Deprecated version of the above, without the alpha plane.
314
// Kept for backward compatibility.
314
// Kept for backward compatibility.
315
WEBP_EXTERN(WebPIDecoder*) WebPINewYUV(
315
WEBP_EXTERN WebPIDecoder* WebPINewYUV(
316
    uint8_t* luma, size_t luma_size, int luma_stride,
316
    uint8_t* luma, size_t luma_size, int luma_stride,
317
    uint8_t* u, size_t u_size, int u_stride,
317
    uint8_t* u, size_t u_size, int u_stride,
318
    uint8_t* v, size_t v_size, int v_stride);
318
    uint8_t* v, size_t v_size, int v_stride);
319
 
319
 
320
// Deletes the WebPIDecoder object and associated memory. Must always be called
320
// Deletes the WebPIDecoder object and associated memory. Must always be called
321
// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded.
321
// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded.
322
WEBP_EXTERN(void) WebPIDelete(WebPIDecoder* idec);
322
WEBP_EXTERN void WebPIDelete(WebPIDecoder* idec);
323
 
323
 
324
// Copies and decodes the next available data. Returns VP8_STATUS_OK when
324
// Copies and decodes the next available data. Returns VP8_STATUS_OK when
325
// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more
325
// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more
326
// data is expected. Returns error in other cases.
326
// data is expected. Returns error in other cases.
327
WEBP_EXTERN(VP8StatusCode) WebPIAppend(
327
WEBP_EXTERN VP8StatusCode WebPIAppend(
328
    WebPIDecoder* idec, const uint8_t* data, size_t data_size);
328
    WebPIDecoder* idec, const uint8_t* data, size_t data_size);
329
 
329
 
330
// A variant of the above function to be used when data buffer contains
330
// A variant of the above function to be used when data buffer contains
331
// partial data from the beginning. In this case data buffer is not copied
331
// partial data from the beginning. In this case data buffer is not copied
332
// to the internal memory.
332
// to the internal memory.
333
// Note that the value of the 'data' pointer can change between calls to
333
// Note that the value of the 'data' pointer can change between calls to
334
// WebPIUpdate, for instance when the data buffer is resized to fit larger data.
334
// WebPIUpdate, for instance when the data buffer is resized to fit larger data.
335
WEBP_EXTERN(VP8StatusCode) WebPIUpdate(
335
WEBP_EXTERN VP8StatusCode WebPIUpdate(
336
    WebPIDecoder* idec, const uint8_t* data, size_t data_size);
336
    WebPIDecoder* idec, const uint8_t* data, size_t data_size);
337
 
337
 
338
// Returns the RGB/A image decoded so far. Returns NULL if output params
338
// Returns the RGB/A image decoded so far. Returns NULL if output params
339
// are not initialized yet. The RGB/A output type corresponds to the colorspace
339
// are not initialized yet. The RGB/A output type corresponds to the colorspace
340
// specified during call to WebPINewDecoder() or WebPINewRGB().
340
// specified during call to WebPINewDecoder() or WebPINewRGB().
341
// *last_y is the index of last decoded row in raster scan order. Some pointers
341
// *last_y is the index of last decoded row in raster scan order. Some pointers
342
// (*last_y, *width etc.) can be NULL if corresponding information is not
342
// (*last_y, *width etc.) can be NULL if corresponding information is not
-
 
343
// needed. The values in these pointers are only valid on successful (non-NULL)
343
// needed.
344
// return.
344
WEBP_EXTERN(uint8_t*) WebPIDecGetRGB(
345
WEBP_EXTERN uint8_t* WebPIDecGetRGB(
345
    const WebPIDecoder* idec, int* last_y,
346
    const WebPIDecoder* idec, int* last_y,
346
    int* width, int* height, int* stride);
347
    int* width, int* height, int* stride);
347
 
348
 
348
// Same as above function to get a YUVA image. Returns pointer to the luma
349
// Same as above function to get a YUVA image. Returns pointer to the luma
349
// plane or NULL in case of error. If there is no alpha information
350
// plane or NULL in case of error. If there is no alpha information
350
// the alpha pointer '*a' will be returned NULL.
351
// the alpha pointer '*a' will be returned NULL.
351
WEBP_EXTERN(uint8_t*) WebPIDecGetYUVA(
352
WEBP_EXTERN uint8_t* WebPIDecGetYUVA(
352
    const WebPIDecoder* idec, int* last_y,
353
    const WebPIDecoder* idec, int* last_y,
353
    uint8_t** u, uint8_t** v, uint8_t** a,
354
    uint8_t** u, uint8_t** v, uint8_t** a,
354
    int* width, int* height, int* stride, int* uv_stride, int* a_stride);
355
    int* width, int* height, int* stride, int* uv_stride, int* a_stride);
355
 
356
 
356
// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the
357
// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the
Line 366... Line 367...
366
// If non NULL, the left/right/width/height pointers are filled with the visible
367
// If non NULL, the left/right/width/height pointers are filled with the visible
367
// rectangular area so far.
368
// rectangular area so far.
368
// Returns NULL in case the incremental decoder object is in an invalid state.
369
// Returns NULL in case the incremental decoder object is in an invalid state.
369
// Otherwise returns the pointer to the internal representation. This structure
370
// Otherwise returns the pointer to the internal representation. This structure
370
// is read-only, tied to WebPIDecoder's lifespan and should not be modified.
371
// is read-only, tied to WebPIDecoder's lifespan and should not be modified.
371
WEBP_EXTERN(const WebPDecBuffer*) WebPIDecodedArea(
372
WEBP_EXTERN const WebPDecBuffer* WebPIDecodedArea(
372
    const WebPIDecoder* idec, int* left, int* top, int* width, int* height);
373
    const WebPIDecoder* idec, int* left, int* top, int* width, int* height);
373
 
374
 
374
//------------------------------------------------------------------------------
375
//------------------------------------------------------------------------------
375
// Advanced decoding parametrization
376
// Advanced decoding parametrization
376
//
377
//
Line 414... Line 415...
414
 
415
 
415
  uint32_t pad[5];    // padding for later use
416
  uint32_t pad[5];    // padding for later use
416
};
417
};
417
 
418
 
418
// Internal, version-checked, entry point
419
// Internal, version-checked, entry point
419
WEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal(
420
WEBP_EXTERN VP8StatusCode WebPGetFeaturesInternal(
420
    const uint8_t*, size_t, WebPBitstreamFeatures*, int);
421
    const uint8_t*, size_t, WebPBitstreamFeatures*, int);
421
 
422
 
422
// Retrieve features from the bitstream. The *features structure is filled
423
// Retrieve features from the bitstream. The *features structure is filled
423
// with information gathered from the bitstream.
424
// with information gathered from the bitstream.
424
// Returns VP8_STATUS_OK when the features are successfully retrieved. Returns
425
// Returns VP8_STATUS_OK when the features are successfully retrieved. Returns
Line 455... Line 456...
455
  WebPDecBuffer output;         // Output buffer (can point to external mem)
456
  WebPDecBuffer output;         // Output buffer (can point to external mem)
456
  WebPDecoderOptions options;   // Decoding options
457
  WebPDecoderOptions options;   // Decoding options
457
};
458
};
458
 
459
 
459
// Internal, version-checked, entry point
460
// Internal, version-checked, entry point
460
WEBP_EXTERN(int) WebPInitDecoderConfigInternal(WebPDecoderConfig*, int);
461
WEBP_EXTERN int WebPInitDecoderConfigInternal(WebPDecoderConfig*, int);
461
 
462
 
462
// Initialize the configuration as empty. This function must always be
463
// Initialize the configuration as empty. This function must always be
463
// called first, unless WebPGetFeatures() is to be called.
464
// called first, unless WebPGetFeatures() is to be called.
464
// Returns false in case of mismatched version.
465
// Returns false in case of mismatched version.
465
static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) {
466
static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) {
Line 475... Line 476...
475
// as some references to its fields will be used. No internal copy of 'config'
476
// as some references to its fields will be used. No internal copy of 'config'
476
// is made.
477
// is made.
477
// The return WebPIDecoder object must always be deleted calling WebPIDelete().
478
// The return WebPIDecoder object must always be deleted calling WebPIDelete().
478
// Returns NULL in case of error (and config->status will then reflect
479
// Returns NULL in case of error (and config->status will then reflect
479
// the error condition, if available).
480
// the error condition, if available).
480
WEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size,
481
WEBP_EXTERN WebPIDecoder* WebPIDecode(const uint8_t* data, size_t data_size,
481
                                       WebPDecoderConfig* config);
482
                                      WebPDecoderConfig* config);
482
 
483
 
483
// Non-incremental version. This version decodes the full data at once, taking
484
// Non-incremental version. This version decodes the full data at once, taking
484
// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK
485
// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK
485
// if the decoding was successful). Note that 'config' cannot be NULL.
486
// if the decoding was successful). Note that 'config' cannot be NULL.
486
WEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size,
487
WEBP_EXTERN VP8StatusCode WebPDecode(const uint8_t* data, size_t data_size,
487
                                      WebPDecoderConfig* config);
488
                                     WebPDecoderConfig* config);
488
 
489
 
489
#ifdef __cplusplus
490
#ifdef __cplusplus
490
}    // extern "C"
491
}    // extern "C"
491
#endif
492
#endif
492
 
493