mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-14 21:09:55 +02:00
Merge "add colorspace for premultiplied alpha"
This commit is contained in:
@ -477,7 +477,7 @@ static uint8_t* Decode(WEBP_CSP_MODE mode, const uint8_t* data,
|
||||
WebPCopyDecBuffer(&output, keep_info);
|
||||
}
|
||||
// return decoded samples (don't clear 'output'!)
|
||||
return (mode >= MODE_YUV) ? output.u.YUVA.y : output.u.RGBA.rgba;
|
||||
return WebPIsRGBMode(mode) ? output.u.RGBA.rgba : output.u.YUVA.y;
|
||||
}
|
||||
|
||||
uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size,
|
||||
@ -685,7 +685,7 @@ int WebPIoInitFromOptions(const WebPDecoderOptions* const options,
|
||||
h = options->crop_height;
|
||||
x = options->crop_left;
|
||||
y = options->crop_top;
|
||||
if (src_colorspace >= MODE_YUV) { // only snap for YUV420 or YUV422
|
||||
if (!WebPIsRGBMode(src_colorspace)) { // only snap for YUV420 or YUV422
|
||||
x &= ~1;
|
||||
y &= ~1; // TODO(later): only for YUV420, not YUV422.
|
||||
}
|
||||
|
Reference in New Issue
Block a user