Commit graph

5 commits

Author SHA1 Message Date
Lucas CHOLLET
3f9c5af553 LibGfx/JPEG: More support for scans with a single component
Introduced in 2c98eff, support for non-interleaved scans was not working
for frames with a number of MCU per line or column that is odd. Indeed,
the decoder assumed that they have scans that include a fabricated MCU
like scans with multiple components.

This patch makes the decoder handle images with a number of MCU per line
or column that is odd. To do so, as in the current decoder state we do
not know if components are interleaved at allocation time, we skip over
falsely-created macroblocks when filling them. As stated in 2c98eff,
this is probably not a good solution and a whole refactor will be
welcome.

It also comes with a test that open a square image with a side of 600px,
meaning 75 MCUs.
2023-03-25 21:31:21 +01:00
Lucas CHOLLET
b820f9ffbd LibGfx/JPEG: Rename mb_index to macroblock_index 2023-03-25 21:31:21 +01:00
Lucas CHOLLET
3d7888f309 LibGfx/JPEG: Log components present in a scan 2023-03-25 21:31:21 +01:00
Lucas CHOLLET
f66de973ff LibGfx/JPEG: Replace a FIXME with some explanations
Calling the `ycbcr_to_rgb` function still looks unsuitable for this
usage, but it does the job correctly.
2023-03-22 08:57:51 +01:00
Lucas CHOLLET
496b7ffb2b LibGfx: Move all image loaders and writers to a subdirectory 2023-03-21 22:39:25 +01:00
Renamed from Userland/Libraries/LibGfx/JPEGLoader.cpp (Browse further)