add a decoding option to flip image vertically

New API options: WebPDecoderOptions.flip and 'dwebp -flip ...'

it uses negative stride trick.

Also changed the decoder code to support user-supplied
buffers with negative stride, independently of the
WebPDecoderOptions.flip value.

Change-Id: I4dc0d06f0c87e51a3f3428be4fee2d6b5ad76053
This commit is contained in:
skal
2014-01-16 15:48:43 +01:00
parent 00c3c4e114
commit 5da185522b
8 changed files with 99 additions and 37 deletions

View File

@ -512,6 +512,10 @@ static VP8StatusCode DecodeInto(const uint8_t* const data, size_t data_size,
if (status != VP8_STATUS_OK) {
WebPFreeDecBuffer(params->output);
}
if (params->options != NULL && params->options->flip) {
status = WebPFlipBuffer(params->output);
}
return status;
}