fix WebPIDecGetRGB() to accept any RGB(A) mode, not just MODE_RGB

Change-Id: I8780582ecd0868c84e2b1310addebd6c8989e727
This commit is contained in:
Pascal Massimino 2011-04-20 08:42:08 -07:00
parent 8aa50efd38
commit ca554137d2
2 changed files with 8 additions and 7 deletions

View File

@ -538,9 +538,9 @@ VP8StatusCode WebPIUpdate(WebPIDecoder* const idec, const uint8_t* data,
//------------------------------------------------------------------------------
uint8_t* WebPIDecGetRGB(const WebPIDecoder* const idec, int *last_y,
int* width, int* height, int* stride) {
if (!idec || !idec->dec_ || idec->params_.mode != MODE_RGB ||
uint8_t* WebPIDecGetRGB(const WebPIDecoder* const idec, int *last_y, int* width,
int* height, int* stride) {
if (!idec || !idec->dec_ || idec->params_.mode == MODE_YUV ||
idec->state_ <= STATE_PARTS0) {
return NULL;
}

View File

@ -178,10 +178,11 @@ VP8StatusCode WebPIAppend(WebPIDecoder* const idec, const uint8_t* data,
VP8StatusCode WebPIUpdate(WebPIDecoder* const idec, const uint8_t* data,
uint32_t data_size);
// Returns the RGB image decoded so far. Returns NULL if output params are not
// initialized yet. *last_y is the index of last decoded row in raster scan
// order. Some pointers (*last_y, *width etc.) can be NULL if corresponding
// information is not needed.
// 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
// specified in WebPINew()/WebPINewRGB(). *last_y is the index of last decoded
// row in raster scan order. Some pointers (*last_y, *width etc.) can be NULL if
// corresponding information is not needed.
uint8_t* WebPIDecGetRGB(const WebPIDecoder* const idec, int *last_y,
int* width, int* height, int* stride);