26 Commits

Author SHA1 Message Date
Yves Rizoud
0aa43794cd Code cleanup: typedef all structs.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@671 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-03-14 01:08:39 +00:00
Yves Rizoud
761d62f761 Removed some unneeded dependencies to speed up compile.
Code "cleanup": Functions that create a button now return its address.
This helps reduce the number of files that use the globals "Fenetre_Liste_boutons_*"


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@642 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-02-19 02:10:40 +00:00
Adrien Destugues
00b67c23ef Fixes missing refresh on color select with keyboard shortcut
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@592 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-02-04 17:58:57 +00:00
Adrien Destugues
154f5e824a Fixes all the tabulation problems.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@465 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-01-05 22:55:30 +00:00
Adrien Destugues
428e1c36cf Some more optimizations to the color reduction algorithm. Now runs in a decent time on my laptop :)
There may be some more small optimisations possible in this area... i'm still thinking we could get a better palette by putting more priority on highly saturated clusters, but, as we don't store the saturation property in the clusters, it seems difficult to do. Probably it would require switching to HSL before doing the clustering, and finetune the multiplications done in Cluster_Split. Note: these modifications (and the one in the previous commit) will probably crash badly if using the reduction algorithm with a smaller precision than 24bpp. The program will try to do that if it is unable to malloc the big lookup tables (we need a table of 256^3 = 16Mbytes for the color lookup, and when loading we also have the 24b image in memory, and also the clustermap, and the occurence table, wich is 256^3*4=64Mbytes). So, either we assume every computer out there has 128Mb RAM, or I'll have to change my code back to use a lower precision if the malloc ever fails. Anyways, who's wanting to open files bigger than our marbles.pcx in grafx2 ? and who except me is running a computer without swap memory at all ?


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@374 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-09 16:40:36 +00:00
Adrien Destugues
de726cae2f Some small optimisations to speed up the color reduction algorithm... still a little bit slow for me ...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@373 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-08 20:28:38 +00:00
Adrien Destugues
7c658a6855 Some fixes to the floyd steinberg dithering. The error was added to the neughbour pixels, it is now substracted, the results are much better. However, the palette seems to lack saturated colors (in comparison to the one generated b ygimp, wich gives more dithering, but better overall subjective ressemblance to the 24bit image. Maybe having less dithering is fine for us, as we are in a pixelart painting program afterall...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@369 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-03 20:50:52 +00:00
Yves Rizoud
14accb544b Palette now uses RGB components in the full 0-255 range instead of 0-63.
All palette functions can be used in HSL color space too (multi-select, etc).
Fixed some more missing refreshes in Palette screen.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@368 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-03 01:03:32 +00:00
Adrien Destugues
fc0bd94113 Fixed the rgb2hls and hls2rgb functions. But we are losing too much precision when converting the RGB components back to "VGA" 0..63... I think it's time to switch to real 256 colors ...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@356 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-19 22:04:32 +00:00
Adrien Destugues
a60b2bfd01 Some more work on HLS colors. Broken...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@347 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-15 22:43:12 +00:00
Adrien Destugues
72c42b92ce fixed crash when drawing a vertical gradiation or a single-point (nonsense) gradiation.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@315 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-28 09:59:58 +00:00
Adrien Destugues
cef61562d0 Some progress on the gradiation rectangles. I messed up the vector calculation somehow. Is someone good at maths ?
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@301 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-22 19:56:30 +00:00
Adrien Destugues
e31b88ceed Palette sorting works
-still slow
-seems there is a bug in the HSL calculation for green and blue, they get sorted incorrectly
-maybe the new S parameter should be used in clustersets, because now we are not differenciating grey from red !! maybe it's done elsewhere, we'll have to check.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@291 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-20 18:14:10 +00:00
Adrien Destugues
fc41bbe89d Implemented palette sorting. There are problems as we're sortig with HSL color system and the rgb2hl function doesn't return s... we'll have to add that as we can't say if we're looking at red or grey (both have H=0).
Also, there is a problem with the makefile under linux. The .dep is set for checking the .o in the win32 folder. It still works but recompiles everything at each change.

Also added a button to enable HSL color editing in the palette screen. We'll need a hls2rgb function, and some other tweaks and reworks to the palette screen.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@290 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-19 18:52:10 +00:00
Yves Rizoud
b488ec9272 Fixed stricter compilation warnings, deleted unused asm code
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@288 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-18 19:23:35 +00:00
Yves Rizoud
5fd1e42ea0 Copyright notices in source files
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@217 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-08 19:40:47 +00:00
Adrien Destugues
ca9115aba6 Moved two loading functions from op_c.c to loadsave.c and converted to fopen/read_bytes.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@151 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-09-15 07:06:41 +00:00
Yves Rizoud
b3bcf1d841 Files are now opened in binary mode. Saving/Loading now works on windows (It didn't previously - including in the
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@140 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-09-12 22:51:52 +00:00
Adrien Destugues
fce305c1eb Floyd Steinberg dithering enabled on 24b picture loading... doesn' t give very impressing results on my test picture, however...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@122 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-08-13 18:05:17 +00:00
Adrien Destugues
867ac703ca Working palette reduction ! You can now load 24b pcx images !
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@121 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-08-13 17:31:32 +00:00
Adrien Destugues
027ffd4bf5 Smoothing, QuickShade.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@117 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-08-12 16:52:20 +00:00
Adrien Destugues
48cadad912 You can now move windows.
Warning, floyd steinberg dithering disabled for debugging purposes


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@116 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-08-10 17:19:14 +00:00
Adrien Destugues
216ea8c9c2 pi1 and paletized pcx loading works. Saving untested, truecolor pcx still broken (but does not crash and preview seems ok ?!)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@109 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-08-10 10:25:29 +00:00
Adrien Destugues
272506e850 Fixed all warnings, some little bugs, and improved compatibility with >1GB RAM
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@54 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-07-21 12:47:32 +00:00
Adrien Destugues
57fa46de8c Big cleanup, proper makefile
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@12 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2007-08-13 18:41:50 +00:00
Adrien Destugues
306a004e36 First upload of the code.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2007-04-14 20:18:30 +00:00