1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:57:45 +00:00

LibGfx: Integrate JPEG decoder with rest of the system

This patch adds functions like `load_jpeg` to JPGLoader to make the
JPEG decoder conform to the API that bitmap loader uses :^)
This commit is contained in:
devashish 2020-06-22 12:33:56 +05:30 committed by Andreas Kling
parent 8b71b839fa
commit a8b00780a8
5 changed files with 55 additions and 30 deletions

View file

@ -87,6 +87,9 @@
namespace Gfx {
RefPtr<Gfx::Bitmap> load_jpg(const StringView& path);
RefPtr<Gfx::Bitmap> load_jpg_from_memory(const u8* data, size_t length);
/**
* MCU means group of data units that are coded together. A data unit is an 8x8
* block of component data. In interleaved scans, number of non-interleaved data
@ -165,8 +168,8 @@ struct JPGLoadingContext {
};
State state { State::NotDecoded };
const u8* compressed_data { nullptr };
size_t compressed_size { 0 };
const u8* data { nullptr };
size_t data_size { 0 };
u32 luma_table[64];
u32 chroma_table[64];
StartOfFrame frame;