Commit graph

256 commits

Author SHA1 Message Date
Filippos Karapetis
2d9ec1ae70 IMAGE: Use C++ 11 range-based for loops 2025-03-27 13:47:57 +08:00
Matthew Jimenez
35b005bd2c IMAGE: Use palette class in more codecs 2025-03-08 20:18:40 +02:00
Matthew Jimenez
b940265816 IMAGE: Use palette class in Cinepak decoder.
The Cinepak decoder had an unweighted euclidean color distance calculation for palette matching. This was moved and rewritten to a color distance method on the palette class.
2025-03-05 13:37:01 +02:00
Cameron Cawley
77523c844c CONFIGURE: Make SVQ1 and QDM2 optional components 2025-03-03 07:31:41 +02:00
Cameron Cawley
f60a41b244 IMAGE: Fix calling JPEGDecoder::getPixelFormat() before loading the frame 2025-03-03 07:30:22 +02:00
Cameron Cawley
1a3a290ce7 IMAGE: Improve default implementation of setOutputPixelFormat() 2025-03-03 07:30:22 +02:00
Cameron Cawley
4867e171bf IMAGE: Add more validation for Codec::setOutputPixelFormat 2025-03-02 02:34:07 +02:00
Matthew Jimenez
1413a8318c IMAGE: Fix 24bpp PCX image decoding.
The RGB planes were flipped and TESTBED image decoder tests revealed this bug. AGS is the only engine that allows for 24bpp PCX image, but an example game is currently unknown.
2025-02-28 02:57:34 +02:00
Matthew Jimenez
4a01560a44 IMAGE: Replace palette byte arrays with Palette class 2025-02-27 00:04:00 +02:00
Eugene Sandulenko
0988c49f5b
IMAGE: Put PICT parser debug messages into 'ggraphics' debug channel 2025-02-22 15:51:24 +01:00
sluicebox
c2dbf6fa7c IMAGE: Fix memory leak in CicnDecoder
CID 1587162

(Separate from ebda265761)
2025-02-03 22:15:34 -08:00
Le Philousophe
e31df4f730 IMAGE: Fix TGA color map loading
The color map ordering is now fixed according to the specifications and
the palette is now stored according to our requirements: in interleaved
RGB.
2025-01-26 02:56:53 +02:00
Le Philousophe
532c112e4c IMAGE: Fix undefined behaviours in Cinepak decoder
Left shifting a negative number is undefined (as it may eat the sign
bit).
Instead, multiply by 2 which is the same but properly defined.
Also fix the convertYUVToColor function signature as it takes int8
values.
2025-01-22 19:15:58 +01:00
sluicebox
ebda265761 IMAGE: Fix memory leak in CicnDecoder
CID 1587162
2025-01-21 03:29:32 -08:00
Le Philousophe
ad20f02070 IMAGE: Don't declare GIFDecoder when GIF support is not built
As gif.cpp is not built when GIF support is not enabled, don't declare
it and guard its uses.
2025-01-08 13:40:33 +02:00
Torbjörn Andersson
7a4ef28177 PEGASUS: Replaced cicn cursor loader, fixing #15600 in the process
The cicn cursor loader was introduced recently for the Mac SCUMM v6-7
games. I still haven't played Pegasus Prime, but I have forced it to
load all the nine cursors (ID 128-133, 900-901, and 20000) and it seems
to work fine for all of them. At least after I made a few fixes to the
loader itself.

I did get some crashes with the old code when trying to compare them, so
it's possible that we should backport this to 2.9. But I haven't seen
any bug reports about it, so maybe not...?
2025-01-04 11:54:58 +01:00
Torbjörn Andersson
3745e51b01 IMAGE: Remove unnecessary mask-related methods 2025-01-01 14:41:20 +02:00
Torbjörn Andersson
a1db6d8f6d IMAGE: Make the mask a Surface instead of a buffer
This is consistent with other masking.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson
a40fcc5401 SCUMM: MACGUI: Add support for icon masks
This fixes transparency for the slider widget handles in v6-7 games.
Someone may want to adjust the image decoder later, but it will do for
now. Not all icons have useful masks, but some do.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson
e5b964a24c SCUMM: MACGUI: Complete rework of v6-7 window palettes
When a dialog window is created now, all palettes from the individual
widgets (icons and pictures) are collected and combined into a single
palette. The widget palettes are remapped to this. The icon decoder is
now a proper image decoder, which makes icons and pictures very similar
to handle.
2025-01-01 14:41:20 +02:00
Eugene Sandulenko
49e43701d5
CONFIGURE: Turned gif into a component 2024-12-27 13:20:50 +01:00
Eugene Sandulenko
a7aec6c486
CONFIGURE: Implement mpeg2 as a component 2024-12-27 13:03:46 +01:00
Eugene Sandulenko
847c714e68
CONFIGURE: Split indeo into indeo3 and indeo45 components
Also, add indeo3 as a dependency to bbvs and add all codect to testbed
2024-12-27 12:40:26 +01:00
Eugene Sandulenko
bfd09fc81b
CONFIGURE: Added 'hnm' video codec as a component 2024-12-26 01:10:14 +01:00
Eugene Sandulenko
a6e3feed61
CONFIGURE: Turned Indeo codecs into 'indeo' component
For Director engine it is marked as optional, since so far onnly
one game is using it.

This could lead to regressions since we were not tracking which
games use Indeo codecs since we added them in 2016 (Indeo 4&5) and
2010 (Indeo 3). So, there could be an AVI video which is now stops
playing and produces a warning. In this case, the 'indeo' component
must be added to the respective engine.
2024-12-26 01:10:14 +01:00
Torbjörn Andersson
9e4a4f8c77 GRAPHICS: Cleaned up and renamed unpackBitsRgn()
This is actually used for images without Rgn as well. The new code
should be easier to understand, and it handles all of the black and
white images from the Mac versions of Loom, Indy 3, Indy 4, MI1, and
MI2. It's still unfortunate - and perhaps unnecessary - that we had two
different decoders for Rect/Rgn, but I'm not comfortable modifying the
old one. Maybe later.
2024-10-28 08:24:59 +01:00
AndywinXp
679d3eab25 IMAGE: PICT: Add opcodes PnPat, ShortLine, ShortLineFrom 2024-10-28 08:24:59 +01:00
elasota
64a95c3b43 IMAGE: Add codec accuracy options 2024-09-04 10:14:05 +03:00
Eugene Sandulenko
8df0a89aba QDENGINE: Mark image/video decoders used by the engine 2024-08-22 22:09:48 +02:00
Donovan Watteau
630c764ac8 IMAGE: Fix ALIGN() macro redefinition warning on NDS 2024-08-11 16:33:53 +02:00
Paul Gilbert
3d71d8e08c COMMON: Move huffman.h to common/compression/ 2024-07-15 02:56:12 +02:00
Filippos Karapetis
8ee953e910 IMAGE: Fix compilation of MPEG decoder 2024-07-04 00:15:36 +03:00
Filippos Karapetis
7347a82df2 COMMON: Remove inttypes.h
It contains defines that should be available from scummsys.h.
Also, it contains defines to support ancient and
now unsupported versions of MSVC (2013 and earlier)
2024-07-04 00:03:15 +03:00
Hubert Maier
5401ee3b13 JANITORIAL: Fix auxillary typo in png.cpp 2024-05-18 13:52:31 +02:00
Filippos Karapetis
94d960597e IMAGE: Whitespace fixes 2024-05-04 00:06:15 +02:00
Cameron Cawley
67fc0b6b7d IMAGE: INDEO3: Make more use of aligned loads 2024-05-04 00:06:15 +02:00
Cameron Cawley
f55925e58a IMAGE: INDEO3: Reduce the size of _corrector_type 2024-05-04 00:06:15 +02:00
Scott Percival
91857fecb4 IMAGES: Add Indeo 3 to QuickTime codec list 2024-04-25 00:54:17 +02:00
Cameron Cawley
604708ad98 IMAGE: Combine lookup tables for Cinepak with VFW dithering 2024-04-22 02:07:47 +02:00
Cameron Cawley
011e468fa1 IMAGE: Handle the surface pitch in Cinepak videos 2024-04-22 02:07:47 +02:00
Cameron Cawley
2cb46c19ed IMAGE: Split Cinepak CodebookConverterRaw into 8bpp and 24bpp versions 2024-04-22 02:07:47 +02:00
Cameron Cawley
ed59ab8a3b IMAGE: Make use of aligned loads and stores when dithering Cinepak videos 2024-04-22 02:07:47 +02:00
Cameron Cawley
f683ecbf7b IMAGE: Cache the dithered Cinepak codebooks when using VFW-style dithering 2024-04-22 02:07:47 +02:00
elasota
649dfb8a31 IMAGE: Use readMultipleLE in AniDecoder parser 2024-04-01 08:32:52 +03:00
elasota
d58254b3e9 IMAGE: Fix wrong defines in ICO/CUR/ANI loader 2024-04-01 08:32:52 +03:00
Matthew Jimenez
ee5ebec7ca IMAGE: Remove palette start from image decoder.
The palette start value was always zero, adding complexity without benefit.
2024-03-31 23:16:59 +03:00
elasota
26c054e0c5 IMAGE: Add support for loading CUR and ANI files 2024-03-31 14:39:28 -04:00
neuromancer
be73c89bc1 IMAGE: SCR: tweaked palette to match real hardware 2024-03-23 14:30:26 +01:00
never
3dfb5efbfe IMAGE: PICT: Added rowbytes checking if there is lack of PixMap headers
This fixes rendering for certain PICT files, for example
for opcode 0098 http://cd.textfiles.com/fantaziasampler/CLIPART/PCT/FC19.PCT
for opcode 0099 https://github.com/nevernever69/PICT_FILES/blob/main/pict-2000.dat
for opcode 009A https://www.fileformat.info/format/macpict/sample/ec987832ed03482aa788f99677e06e84/download
for opcode 0090 http://cd.textfiles.com/fantaziasampler/CLIPART/PCT/FC10.PCT
for opcode 0091 https://github.com/nevernever69/PICT_FILES/blob/main/pict-1001.dat
and for testing this files use hardcoded palette
2024-01-02 00:55:25 +02:00
Cameron Cawley
5b1b14ad80 COMMON: Mark more symbols as const 2023-12-26 20:23:59 +01:00