mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
LibGfx: Read transform type in webp lossless decoder
Doesn't do anything with it yet, so this only makes the "not yet implemented" message a bit more detailed.
This commit is contained in:
parent
8e6911c8f6
commit
e8f5e699fe
1 changed files with 32 additions and 2 deletions
|
@ -463,8 +463,38 @@ static ErrorOr<void> decode_webp_chunk_VP8L(WebPLoadingContext& context, Chunk c
|
|||
// https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification#72_structure_of_transforms
|
||||
|
||||
// optional-transform = (%b1 transform optional-transform) / %b0
|
||||
if (TRY(bit_stream.read_bits(1)))
|
||||
return context.error("WebPImageDecoderPlugin: VP8L transform handling not yet implemented");
|
||||
while (TRY(bit_stream.read_bits(1))) {
|
||||
// transform = predictor-tx / color-tx / subtract-green-tx
|
||||
// transform =/ color-indexing-tx
|
||||
|
||||
enum TransformType {
|
||||
// predictor-tx = %b00 predictor-image
|
||||
PREDICTOR_TRANSFORM = 0,
|
||||
|
||||
// color-tx = %b01 color-image
|
||||
COLOR_TRANSFORM = 1,
|
||||
|
||||
// subtract-green-tx = %b10
|
||||
SUBTRACT_GREEN_TRANSFORM = 2,
|
||||
|
||||
// color-indexing-tx = %b11 color-indexing-image
|
||||
COLOR_INDEXING_TRANSFORM = 3,
|
||||
};
|
||||
|
||||
TransformType transform_type = static_cast<TransformType>(TRY(bit_stream.read_bits(2)));
|
||||
dbgln_if(WEBP_DEBUG, "transform type {}", (int)transform_type);
|
||||
|
||||
switch (transform_type) {
|
||||
case PREDICTOR_TRANSFORM:
|
||||
return context.error("WebPImageDecoderPlugin: VP8L PREDICTOR_TRANSFORM handling not yet implemented");
|
||||
case COLOR_TRANSFORM:
|
||||
return context.error("WebPImageDecoderPlugin: VP8L COLOR_TRANSFORM handling not yet implemented");
|
||||
case SUBTRACT_GREEN_TRANSFORM:
|
||||
return context.error("WebPImageDecoderPlugin: VP8L SUBTRACT_GREEN_TRANSFORM handling not yet implemented");
|
||||
case COLOR_INDEXING_TRANSFORM:
|
||||
return context.error("WebPImageDecoderPlugin: VP8L COLOR_INDEXING_TRANSFORM handling not yet implemented");
|
||||
}
|
||||
}
|
||||
|
||||
// https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification#623_decoding_entropy-coded_image_data
|
||||
// https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification#523_color_cache_coding
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue