119 Commits

Author SHA1 Message Date
Thomas Bernard
84242cef78 Save_GIF() set "Color resolution" to 8bit / 256 colors 2018-01-30 21:09:02 +01:00
Thomas Bernard
8c6f89af46 Save_GIF() translated and clarified comments.
No change in algorithm, same output.
2018-01-29 16:14:19 +01:00
Thomas Bernard
9f3af34968 More efficiently store Animated GIFs
Do not store the whole canvas for additional images
2018-01-29 16:07:17 +01:00
Thomas Bernard
5c932dd2d9 Save_GIF(): fix for 1 pixel GIFs 2018-01-29 15:52:43 +01:00
Thomas Bernard
ea81cbb46b Save_GIF()/GIF_next_pixel() support saving sub-area of the canvas 2018-01-29 15:52:43 +01:00
Thomas Bernard
207e487d99 Show palette in preview (instead of image) when loading palette ! 2018-01-25 22:55:27 +01:00
Thomas Bernard
a53d6da6ea Add visible_image and backups to the T_Document structure 2018-01-22 16:16:39 +01:00
Thomas Bernard
8ae651c75f put common fields for Main and Spare page in a T_Document structure 2018-01-22 14:46:44 +01:00
Thomas Bernard
afb1feb75d PCX : the CGA "color burst" bit is not taken into account by Paintbrush 3.11 2018-01-20 11:56:03 +01:00
Thomas Bernard
34c7f96535 Better PCX support
support 3 plane 8 colors files
Correctly set CGA palette for 1bpp and 2bpp images
2018-01-19 16:22:53 +01:00
Thomas Bernard
3271d6ba8d Fix BMP loading for big endian machines (68k, PPC)
also removed some debug printf
2018-01-19 10:14:14 +01:00
Thomas Bernard
1232675b59 Save_ICO()
With transparency data
2018-01-18 11:20:51 +01:00
Thomas Bernard
ad9306498f Add support for 2bpp BMP's (Win CE)
File extension is usually 2bp (ic2 for icons)
2018-01-18 00:59:00 +01:00
Thomas Bernard
d0d0b64ecf Support transparency in ICO files with 256 colors or less 2018-01-18 00:43:36 +01:00
Thomas Bernard
2a04e363be fix for loading CUR files 2018-01-17 17:54:28 +01:00
Thomas Bernard
674fc76649 Fix minor issues 2018-01-17 17:31:32 +01:00
Thomas Bernard
d9ca2e1092 Load .ico files containing PNG images 2018-01-17 10:21:34 +01:00
Thomas Bernard
37a5a0a85c Splitted Load_PNG to allow usage by Load_ICO
Introduces Load_PNG_Sub()
some .ico contain PNG images
2018-01-17 10:19:58 +01:00
Thomas Bernard
c2486ed629 Support of .ICO file loading
only loading the biggest icon

see http://pulkomandy.tk/projects/GrafX2/ticket/69
2018-01-17 00:54:10 +01:00
Thomas Bernard
c2c36849b5 Refactor of Load_BMP() + support of OS/2 BMP 2018-01-17 00:53:32 +01:00
Thomas Bernard
ee322ed437 Fix GIF save - last byte
The last byte was not saved for sure, depending on the codesize.
Also if the codesize was big (12 bits which is the max)
in some case an additional 0 byte was store (which is harmless but
useless)

This bug only appears if the bit per code are < 8
which is possible since commit 834050c2c4cf6ed87f3192fa31f8ae13a704a5b5
2017-12-19 17:17:02 +01:00
Thomas Bernard
834050c2c4 Optimize GIF size by using only the number of bits needed in LZW codes
It was always storing images in 8bpp whatever the values of pixels are,
so the minimum LZW code size was 9 bits.

Now the bpp is chosen according to the maximum pixel value.

Please note that the Whole 256 color palette is still stored entirely,
so this commit doesn't change the user experience in anyway, except saving
a few bytes :)
2017-12-19 10:00:08 +01:00
Adrien Destugues
5b6095f0bc Fix all warnings and enable -Werror
mostly unused variables and broken indentation.
2017-05-06 15:13:50 +02:00
Adrien Destugues
2fc6b9375c Fix loading some Atari ST IFF files
IFF is a versatile format, and can store data in Atari ST display RAM format.
This allows to load several of our IFF test files, but the result for most
seems corrupt (either that, or the files in our testsuite are ugly).

Thanks to miniupnp for the patch!

Fixes #38.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2168 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2016-11-22 20:42:15 +00:00
Adrien Destugues
8808625851 Add a "tall 3" drawing mode.
Pixels with 3:4 aspect ratio. Why not?

Contributed by Nic Soudée (zoner/xylem). Thanks!


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2166 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2016-10-15 18:57:14 +00:00
Adrien Destugues
d164d1d4cc Don't free the palette, it is owned by libpng.
Fixes #21.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2118 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2015-04-24 18:24:39 +00:00
Adrien Destugues
d9f2cd2d40 Remove no-op function Palette_loaded.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2109 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2015-03-04 09:28:23 +00:00
Yves Rizoud
56cdbc4c10 Issue 505: Support for saving IFF/ILBM format, compatible with Deluxe Paint 3
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1993 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-09-15 18:05:44 +00:00
Yves Rizoud
a43c9eb31b Yet another fix for GIF loading of animations. Fixes case when Backcolor is different from Transparent color, such as this image http://i49.tinypic.com/35j08j4.gif (WIP by Hapiel)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1987 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-08-11 20:38:06 +00:00
Yves Rizoud
a630a84822 Removed all usage of __attribute__((unused)), replaced by void cast which is supported both on GCC and VBCC
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1984 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-08-11 16:19:07 +00:00
Yves Rizoud
7613093df9 Fix issue 496: Some animated GIF images don't load well. Also fixed the handling of transparency in preview (fileselector) and loading anim GIF as a brush loads first frame.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1969 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-07-12 22:27:49 +00:00
Yves Rizoud
d29bbee941 Fix an error when loading layered image that used a transparent color different from zero ,which resulted in corrupted image. Thanks iLKke!
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1947 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-05-05 16:01:14 +00:00
Yves Rizoud
d8bb1e1d55 Fix some mostly harmless warnings and re-generated dependencies. Now compiles with zero warnings on Linux (gcc 4.1.2)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1945 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-05-03 21:32:59 +00:00
Yves Rizoud
be96447f3b Anim: Improved support of extreme durations (O included to 655.350s included); Adding frames now inherits parent's duration cleanly; Default duration now 100ms (instead of 1ms). Removed blanks in Time window and made tooltips more explicit for next/prev frame, thanks to 00ai99 for reporting.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1931 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-13 00:21:12 +00:00
Yves Rizoud
b435ff2582 Added minimal support of ANIM format as part of the LBM loader : The first frame can be read.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1923 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-07 19:44:37 +00:00
Yves Rizoud
a292f4e356 Fileselector : Now only previews frame 1 of animations, instead of loading everything
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1914 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-04 17:03:46 +00:00
Yves Rizoud
20055dca31 Fix loading of GIF animations that use the 'restore to BGcolor' disposal method.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1913 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-04 16:53:40 +00:00
Yves Rizoud
e73eb2786a Animation now has correct visual display and input feedback. Loading GIF guesses it's an anim if it loops, layers otherwise : Some rare non-looping GIF anims (usaully broken) will be misunderstood as layered. Editing of anims and layers seems flawless and stable. Still requires an auto-switch to the best toolbar (anim/layers) when relevant, but you can already switch manually.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1910 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-02 23:19:47 +00:00
Yves Rizoud
30edcddd07 Fix a color imprecision in the ILBM (IFF) loader. It has existed forever in the SDL port, though it was always better than the 6bit/channel of the DOS version.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1872 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-16 23:01:19 +00:00
Yves Rizoud
59a20c6e3e GIF format now saves pixel ratio in the Logical Screen Descriptor if you use tall or wide pixels. I know no viewer that respects it, so the only effect is that Grafx2 automatically switches to the right scaler when you reload the file.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1855 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-10-31 19:45:57 +00:00
Yves Rizoud
8fb16e7089 Re-integrated anim in trunk, fixing the 999-layer limit at the same time
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1841 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-10-19 23:35:56 +00:00
Adrien Destugues
6672966661 * Avoid crash when enabling mode 5 without enough layers (they are created)
* Display error code to terminal when loading an image fails. Mainly for debugging purposes.
 * Use different error codes for different errors in ILBM loader.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1818 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-07-12 19:31:48 +00:00
Adrien Destugues
706049a2d9 Merge all changes from trunk in CPCMode5 branch.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1809 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-06-19 18:30:53 +00:00
nokturnal
7184fb857f bugfix in Add_element_to_list(), there were changes in function interface, but they were not applied in function call, so this resulted in program hang when calling fileselector.
Bugfix there was no Atari_Memory_free() declaration when __MINT_ define was declared.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1799 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-06-15 19:29:11 +00:00
Yves Rizoud
1af5ee33f1 Merge r1787 (Fix loading of BMPs with negative heights) from release (2.3) to trunk (2.4wip)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1795 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-06-12 18:07:08 +00:00
Yves Rizoud
1f10338f60 Merged trunk into branches/mode5 (=update mode5 branch to latest)
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1785 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-04-25 15:17:18 +00:00
Franck Charlet
431484914e more work done on Mac OSX version
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1752 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-03-10 22:16:42 +00:00
Adrien Destugues
eae47aa0e8 * Factory : if message is longer than 24 chars, cut it instead of not doing anything
* Fileformats : remove outdated comment in gif loader

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1750 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-03-07 21:53:39 +00:00
Yves Rizoud
504f25f1e1 Fix issue 414: Incomplete loading of some GIF images
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1747 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-03-05 17:29:28 +00:00
Yves Rizoud
55422d160e (mode5 branch) Fix a bug in saving, including autosave every few minutes, that auto-selects the last layer to draw.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1743 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-03-02 22:07:24 +00:00