mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-31 10:25:46 +01:00 
			
		
		
		
	decode.h: use size_t consistently
replaces mixed use of int/uint32_t for buffer sizes further changes the API/ABI. Change-Id: I91d70fd82ee3e1ac34b884b8ead9a114a9b1015a
This commit is contained in:
		
							
								
								
									
										4
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								README
									
									
									
									
									
								
							| @@ -324,7 +324,7 @@ Decoding API: | |||||||
| This is mainly just one function to call: | This is mainly just one function to call: | ||||||
|  |  | ||||||
| #include "webp/decode.h" | #include "webp/decode.h" | ||||||
| uint8_t* WebPDecodeRGB(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, | ||||||
|                        int *width, int *height); |                        int *width, int *height); | ||||||
|  |  | ||||||
| Please have a look at the file src/webp/decode.h for the details. | Please have a look at the file src/webp/decode.h for the details. | ||||||
| @@ -333,7 +333,7 @@ decoding to raw Y'CbCr samples. One can also decode the image directly into a | |||||||
| pre-allocated buffer. | pre-allocated buffer. | ||||||
|  |  | ||||||
| To detect a WebP file and gather picture's dimensions, the function: | To detect a WebP file and gather picture's dimensions, the function: | ||||||
|   int WebPGetInfo(const uint8_t* data, uint32_t data_size, |   int WebPGetInfo(const uint8_t* data, size_t data_size, | ||||||
|                   int *width, int *height); |                   int *width, int *height); | ||||||
| is supplied. No decoding is involved when using it. | is supplied. No decoding is involved when using it. | ||||||
|  |  | ||||||
|   | |||||||
| @@ -40,10 +40,10 @@ static VP8StatusCode CheckDecBuffer(const WebPDecBuffer* const buffer) { | |||||||
|     ok = 0; |     ok = 0; | ||||||
|   } else if (mode >= MODE_YUV) {   // YUV checks |   } else if (mode >= MODE_YUV) {   // YUV checks | ||||||
|     const WebPYUVABuffer* const buf = &buffer->u.YUVA; |     const WebPYUVABuffer* const buf = &buffer->u.YUVA; | ||||||
|     const int size = buf->y_stride * height; |     const size_t size = buf->y_stride * height; | ||||||
|     const int u_size = buf->u_stride * ((height + 1) / 2); |     const size_t u_size = buf->u_stride * ((height + 1) / 2); | ||||||
|     const int v_size = buf->v_stride * ((height + 1) / 2); |     const size_t v_size = buf->v_stride * ((height + 1) / 2); | ||||||
|     const int a_size = buf->a_stride * height; |     const size_t a_size = buf->a_stride * height; | ||||||
|     ok &= (size <= buf->y_size); |     ok &= (size <= buf->y_size); | ||||||
|     ok &= (u_size <= buf->u_size); |     ok &= (u_size <= buf->u_size); | ||||||
|     ok &= (v_size <= buf->v_size); |     ok &= (v_size <= buf->v_size); | ||||||
| @@ -56,7 +56,8 @@ static VP8StatusCode CheckDecBuffer(const WebPDecBuffer* const buffer) { | |||||||
|     } |     } | ||||||
|   } else {    // RGB checks |   } else {    // RGB checks | ||||||
|     const WebPRGBABuffer* const buf = &buffer->u.RGBA; |     const WebPRGBABuffer* const buf = &buffer->u.RGBA; | ||||||
|     ok &= (buf->stride * height <= buf->size); |     const size_t size = buf->stride * height; | ||||||
|  |     ok &= (size <= buf->size); | ||||||
|     ok &= (buf->stride >= width * kModeBpp[mode]); |     ok &= (buf->stride >= width * kModeBpp[mode]); | ||||||
|   } |   } | ||||||
|   return ok ? VP8_STATUS_OK : VP8_STATUS_INVALID_PARAM; |   return ok ? VP8_STATUS_OK : VP8_STATUS_INVALID_PARAM; | ||||||
|   | |||||||
| @@ -548,7 +548,7 @@ WebPIDecoder* WebPINewDecoder(WebPDecBuffer* const output_buffer) { | |||||||
|   return idec; |   return idec; | ||||||
| } | } | ||||||
|  |  | ||||||
| WebPIDecoder* WebPIDecode(const uint8_t* data, uint32_t data_size, | WebPIDecoder* WebPIDecode(const uint8_t* data, size_t data_size, | ||||||
|                           WebPDecoderConfig* const config) { |                           WebPDecoderConfig* const config) { | ||||||
|   WebPIDecoder* idec; |   WebPIDecoder* idec; | ||||||
|  |  | ||||||
| @@ -595,7 +595,7 @@ WebPIDecoder* WebPINew(WEBP_CSP_MODE mode) { | |||||||
| } | } | ||||||
|  |  | ||||||
| WebPIDecoder* WebPINewRGB(WEBP_CSP_MODE mode, uint8_t* output_buffer, | WebPIDecoder* WebPINewRGB(WEBP_CSP_MODE mode, uint8_t* output_buffer, | ||||||
|                           int output_buffer_size, int output_stride) { |                           size_t output_buffer_size, int output_stride) { | ||||||
|   WebPIDecoder* idec; |   WebPIDecoder* idec; | ||||||
|   if (mode >= MODE_YUV) return NULL; |   if (mode >= MODE_YUV) return NULL; | ||||||
|   idec = WebPINewDecoder(NULL); |   idec = WebPINewDecoder(NULL); | ||||||
| @@ -608,9 +608,9 @@ WebPIDecoder* WebPINewRGB(WEBP_CSP_MODE mode, uint8_t* output_buffer, | |||||||
|   return idec; |   return idec; | ||||||
| } | } | ||||||
|  |  | ||||||
| WebPIDecoder* WebPINewYUV(uint8_t* luma, int luma_size, int luma_stride, | WebPIDecoder* WebPINewYUV(uint8_t* luma, size_t luma_size, int luma_stride, | ||||||
|                           uint8_t* u, int u_size, int u_stride, |                           uint8_t* u, size_t u_size, int u_stride, | ||||||
|                           uint8_t* v, int v_size, int v_stride) { |                           uint8_t* v, size_t v_size, int v_stride) { | ||||||
|   WebPIDecoder* const idec = WebPINewDecoder(NULL); |   WebPIDecoder* const idec = WebPINewDecoder(NULL); | ||||||
|   if (!idec) return NULL; |   if (!idec) return NULL; | ||||||
|   idec->output_.colorspace = MODE_YUV; |   idec->output_.colorspace = MODE_YUV; | ||||||
| @@ -641,7 +641,7 @@ static VP8StatusCode IDecCheckStatus(const WebPIDecoder* const idec) { | |||||||
| } | } | ||||||
|  |  | ||||||
| VP8StatusCode WebPIAppend(WebPIDecoder* const idec, | VP8StatusCode WebPIAppend(WebPIDecoder* const idec, | ||||||
|                           const uint8_t* const data, uint32_t data_size) { |                           const uint8_t* const data, size_t data_size) { | ||||||
|   VP8StatusCode status; |   VP8StatusCode status; | ||||||
|   if (idec == NULL || data == NULL) { |   if (idec == NULL || data == NULL) { | ||||||
|     return VP8_STATUS_INVALID_PARAM; |     return VP8_STATUS_INVALID_PARAM; | ||||||
| @@ -662,7 +662,7 @@ VP8StatusCode WebPIAppend(WebPIDecoder* const idec, | |||||||
| } | } | ||||||
|  |  | ||||||
| VP8StatusCode WebPIUpdate(WebPIDecoder* const idec, | VP8StatusCode WebPIUpdate(WebPIDecoder* const idec, | ||||||
|                           const uint8_t* const data, uint32_t data_size) { |                           const uint8_t* const data, size_t data_size) { | ||||||
|   VP8StatusCode status; |   VP8StatusCode status; | ||||||
|   if (idec == NULL || data == NULL) { |   if (idec == NULL || data == NULL) { | ||||||
|     return VP8_STATUS_INVALID_PARAM; |     return VP8_STATUS_INVALID_PARAM; | ||||||
|   | |||||||
| @@ -275,7 +275,7 @@ struct VP8Decoder { | |||||||
|  |  | ||||||
|   // extensions |   // extensions | ||||||
|   const uint8_t* alpha_data_;   // compressed alpha data (if present) |   const uint8_t* alpha_data_;   // compressed alpha data (if present) | ||||||
|   uint32_t alpha_data_size_; |   size_t alpha_data_size_; | ||||||
|   uint8_t* alpha_plane_;        // output |   uint8_t* alpha_plane_;        // output | ||||||
|  |  | ||||||
|   int layer_colorspace_; |   int layer_colorspace_; | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ | |||||||
| extern "C" { | extern "C" { | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| static const int kHeaderBytes = 5; | static const size_t kHeaderBytes = 5; | ||||||
| static const uint32_t kImageSizeBits = 14; | static const uint32_t kImageSizeBits = 14; | ||||||
|  |  | ||||||
| static const int kCodeLengthLiterals = 16; | static const int kCodeLengthLiterals = 16; | ||||||
| @@ -94,7 +94,7 @@ static int ReadImageSize(VP8LBitReader* const br, | |||||||
|   return 1; |   return 1; | ||||||
| } | } | ||||||
|  |  | ||||||
| int VP8LGetInfo(const uint8_t* data, int data_size, | int VP8LGetInfo(const uint8_t* data, size_t data_size, | ||||||
|                 int* width, int* height) { |                 int* width, int* height) { | ||||||
|   if (data_size < kHeaderBytes) { |   if (data_size < kHeaderBytes) { | ||||||
|     return 0;         // not enough data |     return 0;         // not enough data | ||||||
|   | |||||||
| @@ -102,7 +102,7 @@ typedef struct { | |||||||
| // width and height. Returns 0 in case of formatting error. width/height | // width and height. Returns 0 in case of formatting error. width/height | ||||||
| // can be passed NULL. | // can be passed NULL. | ||||||
| int VP8LGetInfo(const uint8_t* data, | int VP8LGetInfo(const uint8_t* data, | ||||||
|                 int data_size,    // data available so far |                 size_t data_size,    // data available so far | ||||||
|                 int *width, int *height); |                 int *width, int *height); | ||||||
|  |  | ||||||
| // Allocates and initialize a new lossless decoder instance. | // Allocates and initialize a new lossless decoder instance. | ||||||
|   | |||||||
| @@ -56,7 +56,7 @@ static WEBP_INLINE uint32_t get_le32(const uint8_t* const data) { | |||||||
| //         VP8_STATUS_OK otherwise. | //         VP8_STATUS_OK otherwise. | ||||||
| // In case there are not enough bytes (partial RIFF container), return 0 for | // In case there are not enough bytes (partial RIFF container), return 0 for | ||||||
| // riff_size. Else return the riff_size extracted from the header. | // riff_size. Else return the riff_size extracted from the header. | ||||||
| static VP8StatusCode ParseRIFF(const uint8_t** data, uint32_t* data_size, | static VP8StatusCode ParseRIFF(const uint8_t** data, size_t* data_size, | ||||||
|                                size_t* riff_size) { |                                size_t* riff_size) { | ||||||
|   assert(data); |   assert(data); | ||||||
|   assert(data_size); |   assert(data_size); | ||||||
| @@ -87,7 +87,7 @@ static VP8StatusCode ParseRIFF(const uint8_t** data, uint32_t* data_size, | |||||||
| //         VP8_STATUS_OK otherwise. | //         VP8_STATUS_OK otherwise. | ||||||
| // If a VP8X chunk is found, found_vp8x is set to true and *width, *height and | // If a VP8X chunk is found, found_vp8x is set to true and *width, *height and | ||||||
| // *flags are set to the corresponding values extracted from the VP8X chunk. | // *flags are set to the corresponding values extracted from the VP8X chunk. | ||||||
| static VP8StatusCode ParseVP8X(const uint8_t** data, uint32_t* data_size, | static VP8StatusCode ParseVP8X(const uint8_t** data, size_t* data_size, | ||||||
|                                int* found_vp8x, |                                int* found_vp8x, | ||||||
|                                int* width, int* height, uint32_t* flags) { |                                int* width, int* height, uint32_t* flags) { | ||||||
|   const uint32_t vp8x_size = CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE; |   const uint32_t vp8x_size = CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE; | ||||||
| @@ -130,12 +130,12 @@ static VP8StatusCode ParseVP8X(const uint8_t** data, uint32_t* data_size, | |||||||
| //         VP8_STATUS_OK otherwise. | //         VP8_STATUS_OK otherwise. | ||||||
| // If an alpha chunk is found, alpha_data and alpha_size are set appropriately. | // If an alpha chunk is found, alpha_data and alpha_size are set appropriately. | ||||||
| static VP8StatusCode ParseOptionalChunks(const uint8_t** data, | static VP8StatusCode ParseOptionalChunks(const uint8_t** data, | ||||||
|                                          uint32_t* data_size, |                                          size_t* data_size, | ||||||
|                                          uint32_t riff_size, |                                          size_t riff_size, | ||||||
|                                          const uint8_t** alpha_data, |                                          const uint8_t** alpha_data, | ||||||
|                                          uint32_t* alpha_size) { |                                          size_t* alpha_size) { | ||||||
|   const uint8_t* buf; |   const uint8_t* buf; | ||||||
|   uint32_t buf_size; |   size_t buf_size; | ||||||
|   uint32_t total_size = TAG_SIZE +           // "WEBP". |   uint32_t total_size = TAG_SIZE +           // "WEBP". | ||||||
|                         CHUNK_HEADER_SIZE +  // "VP8Xnnnn". |                         CHUNK_HEADER_SIZE +  // "VP8Xnnnn". | ||||||
|                         VP8X_CHUNK_SIZE;     // data. |                         VP8X_CHUNK_SIZE;     // data. | ||||||
| @@ -195,7 +195,7 @@ static VP8StatusCode ParseOptionalChunks(const uint8_t** data, | |||||||
| // If a VP8/VP8L chunk is found, chunk_size is set to the total number of bytes | // If a VP8/VP8L chunk is found, chunk_size is set to the total number of bytes | ||||||
| // extracted from the VP8/VP8L chunk header. | // extracted from the VP8/VP8L chunk header. | ||||||
| // The flag 'is_lossless' is set to 1 in case of VP8L chunk. | // The flag 'is_lossless' is set to 1 in case of VP8L chunk. | ||||||
| static VP8StatusCode ParseVP8Header(const uint8_t** data, uint32_t* data_size, | static VP8StatusCode ParseVP8Header(const uint8_t** data, size_t* data_size, | ||||||
|                                     size_t riff_size, |                                     size_t riff_size, | ||||||
|                                     size_t* chunk_size, int* is_lossless) { |                                     size_t* chunk_size, int* is_lossless) { | ||||||
|   const int is_vp8 = !memcmp(*data, "VP8 ", TAG_SIZE); |   const int is_vp8 = !memcmp(*data, "VP8 ", TAG_SIZE); | ||||||
| @@ -231,7 +231,7 @@ static VP8StatusCode ParseVP8Header(const uint8_t** data, uint32_t* data_size, | |||||||
|  |  | ||||||
| VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) { | VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) { | ||||||
|   const uint8_t* buf; |   const uint8_t* buf; | ||||||
|   uint32_t buf_size; |   size_t buf_size; | ||||||
|   int found_vp8x; |   int found_vp8x; | ||||||
|   VP8StatusCode status; |   VP8StatusCode status; | ||||||
|  |  | ||||||
| @@ -296,7 +296,7 @@ void WebPResetDecParams(WebPDecParams* const params) { | |||||||
| // "Into" decoding variants | // "Into" decoding variants | ||||||
|  |  | ||||||
| // Main flow | // Main flow | ||||||
| static VP8StatusCode DecodeInto(const uint8_t* data, uint32_t data_size, | static VP8StatusCode DecodeInto(const uint8_t* data, size_t data_size, | ||||||
|                                 WebPDecParams* const params) { |                                 WebPDecParams* const params) { | ||||||
|   VP8StatusCode status; |   VP8StatusCode status; | ||||||
|   VP8Io io; |   VP8Io io; | ||||||
| @@ -370,8 +370,8 @@ static VP8StatusCode DecodeInto(const uint8_t* data, uint32_t data_size, | |||||||
|  |  | ||||||
| // Helpers | // Helpers | ||||||
| static uint8_t* DecodeIntoRGBABuffer(WEBP_CSP_MODE colorspace, | static uint8_t* DecodeIntoRGBABuffer(WEBP_CSP_MODE colorspace, | ||||||
|                                      const uint8_t* data, uint32_t data_size, |                                      const uint8_t* data, size_t data_size, | ||||||
|                                      uint8_t* rgba, int stride, int size) { |                                      uint8_t* rgba, int stride, size_t size) { | ||||||
|   WebPDecParams params; |   WebPDecParams params; | ||||||
|   WebPDecBuffer buf; |   WebPDecBuffer buf; | ||||||
|   if (rgba == NULL) { |   if (rgba == NULL) { | ||||||
| @@ -391,35 +391,35 @@ static uint8_t* DecodeIntoRGBABuffer(WEBP_CSP_MODE colorspace, | |||||||
|   return rgba; |   return rgba; | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeRGBInto(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeRGBInto(const uint8_t* data, size_t data_size, | ||||||
|                            uint8_t* output, int size, int stride) { |                            uint8_t* output, size_t size, int stride) { | ||||||
|   return DecodeIntoRGBABuffer(MODE_RGB, data, data_size, output, stride, size); |   return DecodeIntoRGBABuffer(MODE_RGB, data, data_size, output, stride, size); | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeRGBAInto(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeRGBAInto(const uint8_t* data, size_t data_size, | ||||||
|                             uint8_t* output, int size, int stride) { |                             uint8_t* output, size_t size, int stride) { | ||||||
|   return DecodeIntoRGBABuffer(MODE_RGBA, data, data_size, output, stride, size); |   return DecodeIntoRGBABuffer(MODE_RGBA, data, data_size, output, stride, size); | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeARGBInto(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeARGBInto(const uint8_t* data, size_t data_size, | ||||||
|                             uint8_t* output, int size, int stride) { |                             uint8_t* output, size_t size, int stride) { | ||||||
|   return DecodeIntoRGBABuffer(MODE_ARGB, data, data_size, output, stride, size); |   return DecodeIntoRGBABuffer(MODE_ARGB, data, data_size, output, stride, size); | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeBGRInto(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeBGRInto(const uint8_t* data, size_t data_size, | ||||||
|                            uint8_t* output, int size, int stride) { |                            uint8_t* output, size_t size, int stride) { | ||||||
|   return DecodeIntoRGBABuffer(MODE_BGR, data, data_size, output, stride, size); |   return DecodeIntoRGBABuffer(MODE_BGR, data, data_size, output, stride, size); | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeBGRAInto(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeBGRAInto(const uint8_t* data, size_t data_size, | ||||||
|                             uint8_t* output, int size, int stride) { |                             uint8_t* output, size_t size, int stride) { | ||||||
|   return DecodeIntoRGBABuffer(MODE_BGRA, data, data_size, output, stride, size); |   return DecodeIntoRGBABuffer(MODE_BGRA, data, data_size, output, stride, size); | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeYUVInto(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeYUVInto(const uint8_t* data, size_t data_size, | ||||||
|                            uint8_t* luma, int luma_size, int luma_stride, |                            uint8_t* luma, size_t luma_size, int luma_stride, | ||||||
|                            uint8_t* u, int u_size, int u_stride, |                            uint8_t* u, size_t u_size, int u_stride, | ||||||
|                            uint8_t* v, int v_size, int v_stride) { |                            uint8_t* v, size_t v_size, int v_stride) { | ||||||
|   WebPDecParams params; |   WebPDecParams params; | ||||||
|   WebPDecBuffer output; |   WebPDecBuffer output; | ||||||
|   if (luma == NULL) return NULL; |   if (luma == NULL) return NULL; | ||||||
| @@ -446,7 +446,7 @@ uint8_t* WebPDecodeYUVInto(const uint8_t* data, uint32_t data_size, | |||||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||||
|  |  | ||||||
| static uint8_t* Decode(WEBP_CSP_MODE mode, const uint8_t* data, | static uint8_t* Decode(WEBP_CSP_MODE mode, const uint8_t* data, | ||||||
|                        uint32_t data_size, int* width, int* height, |                        size_t data_size, int* width, int* height, | ||||||
|                        WebPDecBuffer* keep_info) { |                        WebPDecBuffer* keep_info) { | ||||||
|   WebPDecParams params; |   WebPDecParams params; | ||||||
|   WebPDecBuffer output; |   WebPDecBuffer output; | ||||||
| @@ -474,32 +474,32 @@ static uint8_t* Decode(WEBP_CSP_MODE mode, const uint8_t* data, | |||||||
|   return (mode >= MODE_YUV) ? output.u.YUVA.y : output.u.RGBA.rgba; |   return (mode >= MODE_YUV) ? output.u.YUVA.y : output.u.RGBA.rgba; | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeRGB(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, | ||||||
|                        int* width, int* height) { |                        int* width, int* height) { | ||||||
|   return Decode(MODE_RGB, data, data_size, width, height, NULL); |   return Decode(MODE_RGB, data, data_size, width, height, NULL); | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeRGBA(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeRGBA(const uint8_t* data, size_t data_size, | ||||||
|                         int* width, int* height) { |                         int* width, int* height) { | ||||||
|   return Decode(MODE_RGBA, data, data_size, width, height, NULL); |   return Decode(MODE_RGBA, data, data_size, width, height, NULL); | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeARGB(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeARGB(const uint8_t* data, size_t data_size, | ||||||
|                         int* width, int* height) { |                         int* width, int* height) { | ||||||
|   return Decode(MODE_ARGB, data, data_size, width, height, NULL); |   return Decode(MODE_ARGB, data, data_size, width, height, NULL); | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeBGR(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeBGR(const uint8_t* data, size_t data_size, | ||||||
|                        int* width, int* height) { |                        int* width, int* height) { | ||||||
|   return Decode(MODE_BGR, data, data_size, width, height, NULL); |   return Decode(MODE_BGR, data, data_size, width, height, NULL); | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeBGRA(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeBGRA(const uint8_t* data, size_t data_size, | ||||||
|                         int* width, int* height) { |                         int* width, int* height) { | ||||||
|   return Decode(MODE_BGRA, data, data_size, width, height, NULL); |   return Decode(MODE_BGRA, data, data_size, width, height, NULL); | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeYUV(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size, | ||||||
|                        int* width, int* height, uint8_t** u, uint8_t** v, |                        int* width, int* height, uint8_t** u, uint8_t** v, | ||||||
|                        int* stride, int* uv_stride) { |                        int* stride, int* uv_stride) { | ||||||
|   WebPDecBuffer output;   // only to preserve the side-infos |   WebPDecBuffer output;   // only to preserve the side-infos | ||||||
| @@ -523,7 +523,7 @@ static void DefaultFeatures(WebPBitstreamFeatures* const features) { | |||||||
|   features->bitstream_version = 0; |   features->bitstream_version = 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| static VP8StatusCode GetFeatures(const uint8_t* data, uint32_t data_size, | static VP8StatusCode GetFeatures(const uint8_t* data, size_t data_size, | ||||||
|                                  WebPBitstreamFeatures* const features) { |                                  WebPBitstreamFeatures* const features) { | ||||||
|   size_t chunk_size = 0; |   size_t chunk_size = 0; | ||||||
|   size_t riff_size = 0; |   size_t riff_size = 0; | ||||||
| @@ -584,7 +584,7 @@ static VP8StatusCode GetFeatures(const uint8_t* data, uint32_t data_size, | |||||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||||
| // WebPGetInfo() | // WebPGetInfo() | ||||||
|  |  | ||||||
| int WebPGetInfo(const uint8_t* data, uint32_t data_size, | int WebPGetInfo(const uint8_t* data, size_t data_size, | ||||||
|                 int* width, int* height) { |                 int* width, int* height) { | ||||||
|   WebPBitstreamFeatures features; |   WebPBitstreamFeatures features; | ||||||
|  |  | ||||||
| @@ -619,7 +619,7 @@ int WebPInitDecoderConfigInternal(WebPDecoderConfig* const config, | |||||||
|   return 1; |   return 1; | ||||||
| } | } | ||||||
|  |  | ||||||
| VP8StatusCode WebPGetFeaturesInternal(const uint8_t* data, uint32_t data_size, | VP8StatusCode WebPGetFeaturesInternal(const uint8_t* data, size_t data_size, | ||||||
|                                       WebPBitstreamFeatures* const features, |                                       WebPBitstreamFeatures* const features, | ||||||
|                                       int version) { |                                       int version) { | ||||||
|   VP8StatusCode status; |   VP8StatusCode status; | ||||||
| @@ -637,7 +637,7 @@ VP8StatusCode WebPGetFeaturesInternal(const uint8_t* data, uint32_t data_size, | |||||||
|   return status; |   return status; | ||||||
| } | } | ||||||
|  |  | ||||||
| VP8StatusCode WebPDecode(const uint8_t* data, uint32_t data_size, | VP8StatusCode WebPDecode(const uint8_t* data, size_t data_size, | ||||||
|                          WebPDecoderConfig* const config) { |                          WebPDecoderConfig* const config) { | ||||||
|   WebPDecParams params; |   WebPDecParams params; | ||||||
|   VP8StatusCode status; |   VP8StatusCode status; | ||||||
|   | |||||||
| @@ -60,7 +60,7 @@ typedef struct { | |||||||
|   size_t data_size;            // input buffer size |   size_t data_size;            // input buffer size | ||||||
|   size_t offset;               // offset to main data chunk (VP8 or VP8L) |   size_t offset;               // offset to main data chunk (VP8 or VP8L) | ||||||
|   const uint8_t* alpha_data;   // points to alpha chunk (if present) |   const uint8_t* alpha_data;   // points to alpha chunk (if present) | ||||||
|   uint32_t alpha_data_size;    // alpha chunk size |   size_t alpha_data_size;      // alpha chunk size | ||||||
|   size_t compressed_size;      // VP8/VP8L compressed data size |   size_t compressed_size;      // VP8/VP8L compressed data size | ||||||
|   size_t riff_size;            // size of the riff payload (or 0 if absent) |   size_t riff_size;            // size of the riff payload (or 0 if absent) | ||||||
|   int is_lossless;             // true if a VP8L chunk is present |   int is_lossless;             // true if a VP8L chunk is present | ||||||
|   | |||||||
| @@ -28,29 +28,29 @@ WEBP_EXTERN(int) WebPGetDecoderVersion(void); | |||||||
| // This function will also validate the header and return 0 in | // This function will also validate the header and return 0 in | ||||||
| // case of formatting error. | // case of formatting error. | ||||||
| // Pointers *width/*height can be passed NULL if deemed irrelevant. | // Pointers *width/*height can be passed NULL if deemed irrelevant. | ||||||
| WEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, uint32_t data_size, | WEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, size_t data_size, | ||||||
|                              int* width, int* height); |                              int* width, int* height); | ||||||
|  |  | ||||||
| // Decodes WEBP images pointed to by *data and returns RGB samples, along | // Decodes WEBP images pointed to by *data and returns RGB samples, along | ||||||
| // with the dimensions in *width and *height. | // with the dimensions in *width and *height. | ||||||
| // The returned pointer should be deleted calling free(). | // The returned pointer should be deleted calling free(). | ||||||
| // Returns NULL in case of error. | // Returns NULL in case of error. | ||||||
| WEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, uint32_t data_size, | WEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, size_t data_size, | ||||||
|                                     int* width, int* height); |                                     int* width, int* height); | ||||||
|  |  | ||||||
| // Same as WebPDecodeRGB, but returning RGBA data. | // Same as WebPDecodeRGB, but returning RGBA data. | ||||||
| WEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, uint32_t data_size, | WEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, size_t data_size, | ||||||
|                                      int* width, int* height); |                                      int* width, int* height); | ||||||
|  |  | ||||||
| // Same as WebPDecodeRGBA, but returning ARGB data. | // Same as WebPDecodeRGBA, but returning ARGB data. | ||||||
| WEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, uint32_t data_size, | WEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, size_t data_size, | ||||||
|                                      int* width, int* height); |                                      int* width, int* height); | ||||||
|  |  | ||||||
| // This variant decode to BGR instead of RGB. | // This variant decode to BGR instead of RGB. | ||||||
| WEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, uint32_t data_size, | WEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, size_t data_size, | ||||||
|                                     int* width, int* height); |                                     int* width, int* height); | ||||||
| // This variant decodes to BGRA instead of RGBA. | // This variant decodes to BGRA instead of RGBA. | ||||||
| WEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, uint32_t data_size, | WEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, size_t data_size, | ||||||
|                                      int* width, int* height); |                                      int* width, int* height); | ||||||
|  |  | ||||||
| // Decode WEBP images stored in *data in Y'UV format(*). The pointer returned is | // Decode WEBP images stored in *data in Y'UV format(*). The pointer returned is | ||||||
| @@ -62,7 +62,7 @@ WEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, uint32_t data_size, | |||||||
| // have a common stride returned as '*uv_stride'. | // have a common stride returned as '*uv_stride'. | ||||||
| // Return NULL in case of error. | // Return NULL in case of error. | ||||||
| // (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr | // (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr | ||||||
| WEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, uint32_t data_size, | WEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, size_t data_size, | ||||||
|                                     int* width, int* height, |                                     int* width, int* height, | ||||||
|                                     uint8_t** u, uint8_t** v, |                                     uint8_t** u, uint8_t** v, | ||||||
|                                     int* stride, int* uv_stride); |                                     int* stride, int* uv_stride); | ||||||
| @@ -76,21 +76,21 @@ WEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, uint32_t data_size, | |||||||
| // between scanlines. Hence, output_buffer_size is expected to be at least | // between scanlines. Hence, output_buffer_size is expected to be at least | ||||||
| // output_stride x picture-height. | // output_stride x picture-height. | ||||||
| WEBP_EXTERN(uint8_t*) WebPDecodeRGBInto( | WEBP_EXTERN(uint8_t*) WebPDecodeRGBInto( | ||||||
|     const uint8_t* data, uint32_t data_size, |     const uint8_t* data, size_t data_size, | ||||||
|     uint8_t* output_buffer, int output_buffer_size, int output_stride); |     uint8_t* output_buffer, size_t output_buffer_size, int output_stride); | ||||||
| WEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto( | WEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto( | ||||||
|     const uint8_t* data, uint32_t data_size, |     const uint8_t* data, size_t data_size, | ||||||
|     uint8_t* output_buffer, int output_buffer_size, int output_stride); |     uint8_t* output_buffer, size_t output_buffer_size, int output_stride); | ||||||
| WEBP_EXTERN(uint8_t*) WebPDecodeARGBInto( | WEBP_EXTERN(uint8_t*) WebPDecodeARGBInto( | ||||||
|     const uint8_t* data, uint32_t data_size, |     const uint8_t* data, size_t data_size, | ||||||
|     uint8_t* output_buffer, int output_buffer_size, int output_stride); |     uint8_t* output_buffer, size_t output_buffer_size, int output_stride); | ||||||
| // BGR variants | // BGR variants | ||||||
| WEBP_EXTERN(uint8_t*) WebPDecodeBGRInto( | WEBP_EXTERN(uint8_t*) WebPDecodeBGRInto( | ||||||
|     const uint8_t* data, uint32_t data_size, |     const uint8_t* data, size_t data_size, | ||||||
|     uint8_t* output_buffer, int output_buffer_size, int output_stride); |     uint8_t* output_buffer, size_t output_buffer_size, int output_stride); | ||||||
| WEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto( | WEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto( | ||||||
|     const uint8_t* data, uint32_t data_size, |     const uint8_t* data, size_t data_size, | ||||||
|     uint8_t* output_buffer, int output_buffer_size, int output_stride); |     uint8_t* output_buffer, size_t output_buffer_size, int output_stride); | ||||||
|  |  | ||||||
| // WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly | // WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly | ||||||
| // into pre-allocated luma/chroma plane buffers. This function requires the | // into pre-allocated luma/chroma plane buffers. This function requires the | ||||||
| @@ -100,10 +100,10 @@ WEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto( | |||||||
| // Pointer to the luma plane ('*luma') is returned or NULL if an error occurred | // Pointer to the luma plane ('*luma') is returned or NULL if an error occurred | ||||||
| // during decoding (or because some buffers were found to be too small). | // during decoding (or because some buffers were found to be too small). | ||||||
| WEBP_EXTERN(uint8_t*) WebPDecodeYUVInto( | WEBP_EXTERN(uint8_t*) WebPDecodeYUVInto( | ||||||
|     const uint8_t* data, uint32_t data_size, |     const uint8_t* data, size_t data_size, | ||||||
|     uint8_t* luma, int luma_size, int luma_stride, |     uint8_t* luma, size_t luma_size, int luma_stride, | ||||||
|     uint8_t* u, int u_size, int u_stride, |     uint8_t* u, size_t u_size, int u_stride, | ||||||
|     uint8_t* v, int v_size, int v_stride); |     uint8_t* v, size_t v_size, int v_stride); | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||||
| // Output colorspaces and buffer | // Output colorspaces and buffer | ||||||
| @@ -122,7 +122,7 @@ typedef enum { MODE_RGB = 0, MODE_RGBA = 1, | |||||||
| typedef struct {    // view as RGBA | typedef struct {    // view as RGBA | ||||||
|   uint8_t* rgba;    // pointer to RGBA samples |   uint8_t* rgba;    // pointer to RGBA samples | ||||||
|   int stride;       // stride in bytes from one scanline to the next. |   int stride;       // stride in bytes from one scanline to the next. | ||||||
|   int size;         // total size of the *rgba buffer. |   size_t size;      // total size of the *rgba buffer. | ||||||
| } WebPRGBABuffer; | } WebPRGBABuffer; | ||||||
|  |  | ||||||
| typedef struct {              // view as YUVA | typedef struct {              // view as YUVA | ||||||
| @@ -130,9 +130,9 @@ typedef struct {              // view as YUVA | |||||||
|   int y_stride;               // luma stride |   int y_stride;               // luma stride | ||||||
|   int u_stride, v_stride;     // chroma strides |   int u_stride, v_stride;     // chroma strides | ||||||
|   int a_stride;               // alpha stride |   int a_stride;               // alpha stride | ||||||
|   int y_size;                 // luma plane size |   size_t y_size;              // luma plane size | ||||||
|   int u_size, v_size;         // chroma planes size |   size_t u_size, v_size;      // chroma planes size | ||||||
|   int a_size;                 // alpha-plane size |   size_t a_size;              // alpha-plane size | ||||||
| } WebPYUVABuffer; | } WebPYUVABuffer; | ||||||
|  |  | ||||||
| // Output buffer | // Output buffer | ||||||
| @@ -220,7 +220,7 @@ WEBP_EXTERN(WebPIDecoder*) WebPINew(WEBP_CSP_MODE mode); | |||||||
| // is specified by 'output_stride'. Returns NULL if the allocation failed. | // is specified by 'output_stride'. Returns NULL if the allocation failed. | ||||||
| WEBP_EXTERN(WebPIDecoder*) WebPINewRGB( | WEBP_EXTERN(WebPIDecoder*) WebPINewRGB( | ||||||
|     WEBP_CSP_MODE mode, |     WEBP_CSP_MODE mode, | ||||||
|     uint8_t* output_buffer, int output_buffer_size, int output_stride); |     uint8_t* output_buffer, size_t output_buffer_size, int output_stride); | ||||||
|  |  | ||||||
| // This function allocates and initializes an incremental-decoder object, which | // This function allocates and initializes an incremental-decoder object, which | ||||||
| // will output the raw luma/chroma samples into a preallocated planes. The luma | // will output the raw luma/chroma samples into a preallocated planes. The luma | ||||||
| @@ -230,9 +230,9 @@ WEBP_EXTERN(WebPIDecoder*) WebPINewRGB( | |||||||
| // and 'v_size'. | // and 'v_size'. | ||||||
| // Returns NULL if the allocation failed. | // Returns NULL if the allocation failed. | ||||||
| WEBP_EXTERN(WebPIDecoder*) WebPINewYUV( | WEBP_EXTERN(WebPIDecoder*) WebPINewYUV( | ||||||
|     uint8_t* luma, int luma_size, int luma_stride, |     uint8_t* luma, size_t luma_size, int luma_stride, | ||||||
|     uint8_t* u, int u_size, int u_stride, |     uint8_t* u, size_t u_size, int u_stride, | ||||||
|     uint8_t* v, int v_size, int v_stride); |     uint8_t* v, size_t v_size, int v_stride); | ||||||
|  |  | ||||||
| // Deletes the WebPIDecoder object and associated memory. Must always be called | // Deletes the WebPIDecoder object and associated memory. Must always be called | ||||||
| // if WebPINew, WebPINewRGB or WebPINewYUV succeeded. | // if WebPINew, WebPINewRGB or WebPINewYUV succeeded. | ||||||
| @@ -242,7 +242,7 @@ WEBP_EXTERN(void) WebPIDelete(WebPIDecoder* const idec); | |||||||
| // the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more | // the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more | ||||||
| // data is expected. Returns error in other cases. | // data is expected. Returns error in other cases. | ||||||
| WEBP_EXTERN(VP8StatusCode) WebPIAppend( | WEBP_EXTERN(VP8StatusCode) WebPIAppend( | ||||||
|     WebPIDecoder* const idec, const uint8_t* const data, uint32_t data_size); |     WebPIDecoder* const idec, const uint8_t* const data, size_t data_size); | ||||||
|  |  | ||||||
| // A variant of the above function to be used when data buffer contains | // A variant of the above function to be used when data buffer contains | ||||||
| // partial data from the beginning. In this case data buffer is not copied | // partial data from the beginning. In this case data buffer is not copied | ||||||
| @@ -250,7 +250,7 @@ WEBP_EXTERN(VP8StatusCode) WebPIAppend( | |||||||
| // Note that the value of the 'data' pointer can change between calls to | // Note that the value of the 'data' pointer can change between calls to | ||||||
| // WebPIUpdate, for instance when the data buffer is resized to fit larger data. | // WebPIUpdate, for instance when the data buffer is resized to fit larger data. | ||||||
| WEBP_EXTERN(VP8StatusCode) WebPIUpdate( | WEBP_EXTERN(VP8StatusCode) WebPIUpdate( | ||||||
|     WebPIDecoder* const idec, const uint8_t* const data, uint32_t data_size); |     WebPIDecoder* const idec, const uint8_t* const data, size_t data_size); | ||||||
|  |  | ||||||
| // Returns the r/g/b/(a) image decoded so far. Returns NULL if output params | // Returns the r/g/b/(a) image decoded so far. Returns NULL if output params | ||||||
| // are not initialized yet. The r/g/b/(a) output type corresponds to the mode | // are not initialized yet. The r/g/b/(a) output type corresponds to the mode | ||||||
| @@ -326,14 +326,14 @@ typedef struct { | |||||||
|  |  | ||||||
| // Internal, version-checked, entry point | // Internal, version-checked, entry point | ||||||
| WEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal( | WEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal( | ||||||
|     const uint8_t*, uint32_t, WebPBitstreamFeatures* const, int); |     const uint8_t*, size_t, WebPBitstreamFeatures* const, int); | ||||||
|  |  | ||||||
| // Retrieve features from the bitstream. The *features structure is filled | // Retrieve features from the bitstream. The *features structure is filled | ||||||
| // with information gathered from the bitstream. | // with information gathered from the bitstream. | ||||||
| // Returns false in case of error or version mismatch. | // Returns false in case of error or version mismatch. | ||||||
| // In case of error, features->bitstream_status will reflect the error code. | // In case of error, features->bitstream_status will reflect the error code. | ||||||
| static WEBP_INLINE VP8StatusCode WebPGetFeatures( | static WEBP_INLINE VP8StatusCode WebPGetFeatures( | ||||||
|     const uint8_t* data, uint32_t data_size, |     const uint8_t* data, size_t data_size, | ||||||
|     WebPBitstreamFeatures* const features) { |     WebPBitstreamFeatures* const features) { | ||||||
|   return WebPGetFeaturesInternal(data, data_size, features, |   return WebPGetFeaturesInternal(data, data_size, features, | ||||||
|                                  WEBP_DECODER_ABI_VERSION); |                                  WEBP_DECODER_ABI_VERSION); | ||||||
| @@ -380,13 +380,13 @@ static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* const config) { | |||||||
| // The return WebPIDecoder object must always be deleted calling WebPIDelete(). | // The return WebPIDecoder object must always be deleted calling WebPIDelete(). | ||||||
| // Returns NULL in case of error (and config->status will then reflect | // Returns NULL in case of error (and config->status will then reflect | ||||||
| // the error condition). | // the error condition). | ||||||
| WEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, uint32_t data_size, | WEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size, | ||||||
|                                        WebPDecoderConfig* const config); |                                        WebPDecoderConfig* const config); | ||||||
|  |  | ||||||
| // Non-incremental version. This version decodes the full data at once, taking | // Non-incremental version. This version decodes the full data at once, taking | ||||||
| // 'config' into account. Return decoding status (VP8_STATUS_OK if decoding | // 'config' into account. Return decoding status (VP8_STATUS_OK if decoding | ||||||
| // was successful). | // was successful). | ||||||
| WEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, uint32_t data_size, | WEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size, | ||||||
|                                       WebPDecoderConfig* const config); |                                       WebPDecoderConfig* const config); | ||||||
|  |  | ||||||
| #if defined(__cplusplus) || defined(c_plusplus) | #if defined(__cplusplus) || defined(c_plusplus) | ||||||
|   | |||||||
| @@ -35,8 +35,6 @@ | |||||||
| // Decoder specific | // Decoder specific | ||||||
|  |  | ||||||
| %apply int *OUTPUT { int *width, int *height } | %apply int *OUTPUT { int *width, int *height } | ||||||
| %apply int { uint32_t data_size } |  | ||||||
| %apply Number NONNEGATIVE { uint32_t data_size } |  | ||||||
|  |  | ||||||
| // free the buffer returned by these functions after copying into | // free the buffer returned by these functions after copying into | ||||||
| // the native type | // the native type | ||||||
| @@ -48,18 +46,18 @@ | |||||||
| %typemap(newfree) uint8_t* "free($1);" | %typemap(newfree) uint8_t* "free($1);" | ||||||
|  |  | ||||||
| int WebPGetDecoderVersion(void); | int WebPGetDecoderVersion(void); | ||||||
| int WebPGetInfo(const uint8_t* data, uint32_t data_size, | int WebPGetInfo(const uint8_t* data, size_t data_size, | ||||||
|                 int *width, int *height); |                 int *width, int *height); | ||||||
|  |  | ||||||
| uint8_t* WebPDecodeRGB(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, | ||||||
|                        int *width, int *height); |                        int *width, int *height); | ||||||
| uint8_t* WebPDecodeRGBA(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeRGBA(const uint8_t* data, size_t data_size, | ||||||
|                         int *width, int *height); |                         int *width, int *height); | ||||||
| uint8_t* WebPDecodeARGB(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeARGB(const uint8_t* data, size_t data_size, | ||||||
|                         int* width, int* height); |                         int* width, int* height); | ||||||
| uint8_t* WebPDecodeBGR(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeBGR(const uint8_t* data, size_t data_size, | ||||||
|                        int *width, int *height); |                        int *width, int *height); | ||||||
| uint8_t* WebPDecodeBGRA(const uint8_t* data, uint32_t data_size, | uint8_t* WebPDecodeBGRA(const uint8_t* data, size_t data_size, | ||||||
|                         int *width, int *height); |                         int *width, int *height); | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||||
|   | |||||||
							
								
								
									
										
											BIN
										
									
								
								swig/libwebp.jar
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								swig/libwebp.jar
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -923,10 +923,10 @@ SWIGEXPORT jint JNICALL Java_com_google_webp_libwebpJNI_WebPGetDecoderVersion(JN | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| SWIGEXPORT jint JNICALL Java_com_google_webp_libwebpJNI_WebPGetInfo(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jintArray jarg3, jintArray jarg4) { | SWIGEXPORT jint JNICALL Java_com_google_webp_libwebpJNI_WebPGetInfo(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jlong jarg2, jintArray jarg3, jintArray jarg4) { | ||||||
|   jint jresult = 0 ; |   jint jresult = 0 ; | ||||||
|   uint8_t *arg1 = (uint8_t *) 0 ; |   uint8_t *arg1 = (uint8_t *) 0 ; | ||||||
|   uint32_t arg2 ; |   size_t arg2 ; | ||||||
|   int *arg3 = (int *) 0 ; |   int *arg3 = (int *) 0 ; | ||||||
|   int *arg4 = (int *) 0 ; |   int *arg4 = (int *) 0 ; | ||||||
|   jbyte *jarr1 ; |   jbyte *jarr1 ; | ||||||
| @@ -937,7 +937,7 @@ SWIGEXPORT jint JNICALL Java_com_google_webp_libwebpJNI_WebPGetInfo(JNIEnv *jenv | |||||||
|   (void)jenv; |   (void)jenv; | ||||||
|   (void)jcls; |   (void)jcls; | ||||||
|   if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; |   if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; | ||||||
|   arg2 = (uint32_t)jarg2; |   arg2 = (size_t)jarg2; | ||||||
|   { |   { | ||||||
|     if (!jarg3) { |     if (!jarg3) { | ||||||
|       SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); |       SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); | ||||||
| @@ -960,13 +960,6 @@ SWIGEXPORT jint JNICALL Java_com_google_webp_libwebpJNI_WebPGetInfo(JNIEnv *jenv | |||||||
|     } |     } | ||||||
|     arg4 = &temp4; |     arg4 = &temp4; | ||||||
|   } |   } | ||||||
|   { |  | ||||||
|     if (arg2 < 0) { |  | ||||||
|       { |  | ||||||
|         SWIG_JavaException(jenv, SWIG_ValueError, "Expected a non-negative value."); return 0; |  | ||||||
|       }; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|   result = (int)WebPGetInfo((uint8_t const *)arg1,arg2,arg3,arg4); |   result = (int)WebPGetInfo((uint8_t const *)arg1,arg2,arg3,arg4); | ||||||
|   jresult = (jint)result; |   jresult = (jint)result; | ||||||
|   SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); |   SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); | ||||||
| @@ -985,10 +978,10 @@ SWIGEXPORT jint JNICALL Java_com_google_webp_libwebpJNI_WebPGetInfo(JNIEnv *jenv | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeRGB(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jintArray jarg3, jintArray jarg4) { | SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeRGB(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jlong jarg2, jintArray jarg3, jintArray jarg4) { | ||||||
|   jbyteArray jresult = 0 ; |   jbyteArray jresult = 0 ; | ||||||
|   uint8_t *arg1 = (uint8_t *) 0 ; |   uint8_t *arg1 = (uint8_t *) 0 ; | ||||||
|   uint32_t arg2 ; |   size_t arg2 ; | ||||||
|   int *arg3 = (int *) 0 ; |   int *arg3 = (int *) 0 ; | ||||||
|   int *arg4 = (int *) 0 ; |   int *arg4 = (int *) 0 ; | ||||||
|   jbyte *jarr1 ; |   jbyte *jarr1 ; | ||||||
| @@ -999,7 +992,7 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeRGB(JNIE | |||||||
|   (void)jenv; |   (void)jenv; | ||||||
|   (void)jcls; |   (void)jcls; | ||||||
|   if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; |   if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; | ||||||
|   arg2 = (uint32_t)jarg2; |   arg2 = (size_t)jarg2; | ||||||
|   { |   { | ||||||
|     if (!jarg3) { |     if (!jarg3) { | ||||||
|       SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); |       SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); | ||||||
| @@ -1022,13 +1015,6 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeRGB(JNIE | |||||||
|     } |     } | ||||||
|     arg4 = &temp4; |     arg4 = &temp4; | ||||||
|   } |   } | ||||||
|   { |  | ||||||
|     if (arg2 < 0) { |  | ||||||
|       { |  | ||||||
|         SWIG_JavaException(jenv, SWIG_ValueError, "Expected a non-negative value."); return 0; |  | ||||||
|       }; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|   result = (uint8_t *)WebPDecodeRGB((uint8_t const *)arg1,arg2,arg3,arg4); |   result = (uint8_t *)WebPDecodeRGB((uint8_t const *)arg1,arg2,arg3,arg4); | ||||||
|   jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); |   jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); | ||||||
|   SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); |   SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); | ||||||
| @@ -1048,10 +1034,10 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeRGB(JNIE | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeRGBA(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jintArray jarg3, jintArray jarg4) { | SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeRGBA(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jlong jarg2, jintArray jarg3, jintArray jarg4) { | ||||||
|   jbyteArray jresult = 0 ; |   jbyteArray jresult = 0 ; | ||||||
|   uint8_t *arg1 = (uint8_t *) 0 ; |   uint8_t *arg1 = (uint8_t *) 0 ; | ||||||
|   uint32_t arg2 ; |   size_t arg2 ; | ||||||
|   int *arg3 = (int *) 0 ; |   int *arg3 = (int *) 0 ; | ||||||
|   int *arg4 = (int *) 0 ; |   int *arg4 = (int *) 0 ; | ||||||
|   jbyte *jarr1 ; |   jbyte *jarr1 ; | ||||||
| @@ -1062,7 +1048,7 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeRGBA(JNI | |||||||
|   (void)jenv; |   (void)jenv; | ||||||
|   (void)jcls; |   (void)jcls; | ||||||
|   if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; |   if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; | ||||||
|   arg2 = (uint32_t)jarg2; |   arg2 = (size_t)jarg2; | ||||||
|   { |   { | ||||||
|     if (!jarg3) { |     if (!jarg3) { | ||||||
|       SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); |       SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); | ||||||
| @@ -1085,13 +1071,6 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeRGBA(JNI | |||||||
|     } |     } | ||||||
|     arg4 = &temp4; |     arg4 = &temp4; | ||||||
|   } |   } | ||||||
|   { |  | ||||||
|     if (arg2 < 0) { |  | ||||||
|       { |  | ||||||
|         SWIG_JavaException(jenv, SWIG_ValueError, "Expected a non-negative value."); return 0; |  | ||||||
|       }; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|   result = (uint8_t *)WebPDecodeRGBA((uint8_t const *)arg1,arg2,arg3,arg4); |   result = (uint8_t *)WebPDecodeRGBA((uint8_t const *)arg1,arg2,arg3,arg4); | ||||||
|   jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); |   jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); | ||||||
|   SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); |   SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); | ||||||
| @@ -1111,10 +1090,10 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeRGBA(JNI | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeARGB(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jintArray jarg3, jintArray jarg4) { | SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeARGB(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jlong jarg2, jintArray jarg3, jintArray jarg4) { | ||||||
|   jbyteArray jresult = 0 ; |   jbyteArray jresult = 0 ; | ||||||
|   uint8_t *arg1 = (uint8_t *) 0 ; |   uint8_t *arg1 = (uint8_t *) 0 ; | ||||||
|   uint32_t arg2 ; |   size_t arg2 ; | ||||||
|   int *arg3 = (int *) 0 ; |   int *arg3 = (int *) 0 ; | ||||||
|   int *arg4 = (int *) 0 ; |   int *arg4 = (int *) 0 ; | ||||||
|   jbyte *jarr1 ; |   jbyte *jarr1 ; | ||||||
| @@ -1125,7 +1104,7 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeARGB(JNI | |||||||
|   (void)jenv; |   (void)jenv; | ||||||
|   (void)jcls; |   (void)jcls; | ||||||
|   if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; |   if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; | ||||||
|   arg2 = (uint32_t)jarg2; |   arg2 = (size_t)jarg2; | ||||||
|   { |   { | ||||||
|     if (!jarg3) { |     if (!jarg3) { | ||||||
|       SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); |       SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); | ||||||
| @@ -1148,13 +1127,6 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeARGB(JNI | |||||||
|     } |     } | ||||||
|     arg4 = &temp4; |     arg4 = &temp4; | ||||||
|   } |   } | ||||||
|   { |  | ||||||
|     if (arg2 < 0) { |  | ||||||
|       { |  | ||||||
|         SWIG_JavaException(jenv, SWIG_ValueError, "Expected a non-negative value."); return 0; |  | ||||||
|       }; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|   result = (uint8_t *)WebPDecodeARGB((uint8_t const *)arg1,arg2,arg3,arg4); |   result = (uint8_t *)WebPDecodeARGB((uint8_t const *)arg1,arg2,arg3,arg4); | ||||||
|   jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); |   jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); | ||||||
|   SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); |   SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); | ||||||
| @@ -1174,10 +1146,10 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeARGB(JNI | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeBGR(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jintArray jarg3, jintArray jarg4) { | SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeBGR(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jlong jarg2, jintArray jarg3, jintArray jarg4) { | ||||||
|   jbyteArray jresult = 0 ; |   jbyteArray jresult = 0 ; | ||||||
|   uint8_t *arg1 = (uint8_t *) 0 ; |   uint8_t *arg1 = (uint8_t *) 0 ; | ||||||
|   uint32_t arg2 ; |   size_t arg2 ; | ||||||
|   int *arg3 = (int *) 0 ; |   int *arg3 = (int *) 0 ; | ||||||
|   int *arg4 = (int *) 0 ; |   int *arg4 = (int *) 0 ; | ||||||
|   jbyte *jarr1 ; |   jbyte *jarr1 ; | ||||||
| @@ -1188,7 +1160,7 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeBGR(JNIE | |||||||
|   (void)jenv; |   (void)jenv; | ||||||
|   (void)jcls; |   (void)jcls; | ||||||
|   if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; |   if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; | ||||||
|   arg2 = (uint32_t)jarg2; |   arg2 = (size_t)jarg2; | ||||||
|   { |   { | ||||||
|     if (!jarg3) { |     if (!jarg3) { | ||||||
|       SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); |       SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); | ||||||
| @@ -1211,13 +1183,6 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeBGR(JNIE | |||||||
|     } |     } | ||||||
|     arg4 = &temp4; |     arg4 = &temp4; | ||||||
|   } |   } | ||||||
|   { |  | ||||||
|     if (arg2 < 0) { |  | ||||||
|       { |  | ||||||
|         SWIG_JavaException(jenv, SWIG_ValueError, "Expected a non-negative value."); return 0; |  | ||||||
|       }; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|   result = (uint8_t *)WebPDecodeBGR((uint8_t const *)arg1,arg2,arg3,arg4); |   result = (uint8_t *)WebPDecodeBGR((uint8_t const *)arg1,arg2,arg3,arg4); | ||||||
|   jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); |   jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); | ||||||
|   SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); |   SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); | ||||||
| @@ -1237,10 +1202,10 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeBGR(JNIE | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeBGRA(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jintArray jarg3, jintArray jarg4) { | SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeBGRA(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jlong jarg2, jintArray jarg3, jintArray jarg4) { | ||||||
|   jbyteArray jresult = 0 ; |   jbyteArray jresult = 0 ; | ||||||
|   uint8_t *arg1 = (uint8_t *) 0 ; |   uint8_t *arg1 = (uint8_t *) 0 ; | ||||||
|   uint32_t arg2 ; |   size_t arg2 ; | ||||||
|   int *arg3 = (int *) 0 ; |   int *arg3 = (int *) 0 ; | ||||||
|   int *arg4 = (int *) 0 ; |   int *arg4 = (int *) 0 ; | ||||||
|   jbyte *jarr1 ; |   jbyte *jarr1 ; | ||||||
| @@ -1251,7 +1216,7 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeBGRA(JNI | |||||||
|   (void)jenv; |   (void)jenv; | ||||||
|   (void)jcls; |   (void)jcls; | ||||||
|   if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; |   if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0; | ||||||
|   arg2 = (uint32_t)jarg2; |   arg2 = (size_t)jarg2; | ||||||
|   { |   { | ||||||
|     if (!jarg3) { |     if (!jarg3) { | ||||||
|       SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); |       SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); | ||||||
| @@ -1274,13 +1239,6 @@ SWIGEXPORT jbyteArray JNICALL Java_com_google_webp_libwebpJNI_WebPDecodeBGRA(JNI | |||||||
|     } |     } | ||||||
|     arg4 = &temp4; |     arg4 = &temp4; | ||||||
|   } |   } | ||||||
|   { |  | ||||||
|     if (arg2 < 0) { |  | ||||||
|       { |  | ||||||
|         SWIG_JavaException(jenv, SWIG_ValueError, "Expected a non-negative value."); return 0; |  | ||||||
|       }; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|   result = (uint8_t *)WebPDecodeBGRA((uint8_t const *)arg1,arg2,arg3,arg4); |   result = (uint8_t *)WebPDecodeBGRA((uint8_t const *)arg1,arg2,arg3,arg4); | ||||||
|   jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); |   jresult = SWIG_JavaArrayOutSchar(jenv, result, FillMeInAsSizeCannotBeDeterminedAutomatically); | ||||||
|   SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); |   SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user