41 Commits

Author SHA1 Message Date
Adrien Destugues
1dce247656 Improve XOR table computation.
Set the initial state to XOR[i]=i, so that on very low color images, the algorithm will try 
to swap around the first colors.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2049 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2013-02-02 08:38:08 +00:00
Adrien Destugues
878c926ce4 Fix issue 185 (XOR highlight) :
* Use a simple optimization algorithm to compute a good set of XOR color pairs
 * Algorothm is not very optimized (complexity is up to n^3). In practize, it stabilizes after 2 to 3 rounds of swapping colors
 * Use this color table for all XOR effects
 * Setting for grid color is now removed


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2048 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2013-01-06 12:46:46 +00:00
Adrien Destugues
8f76bce566 Quick try at issue #185 (XOR highlight optimal color repartition).
Untested, need to plug it at the right places and debug it.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2046 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2013-01-05 21:01:08 +00:00
Yves Rizoud
aa0ce85706 Fix issue 514: Palette changes that modify the pixels can't be undone
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2034 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-10-16 00:10:31 +00:00
Yves Rizoud
e87f9140c7 Fix issue 516: Some changes can't be undone on animations > 32 frames
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2033 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-10-16 00:07:42 +00:00
Yves Rizoud
a137e063f0 Fix a crash that happened in Palette screen when right-clicking near top of screen: it opened the 'Copy/Paste' dropdown outside of screen edge. Now this dropdown menu only appears when you click in the palette area
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1938 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-25 14:44:29 +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
Yves Rizoud
775ee56ed0 Paste in Text tool: fix a graphic overflow.
Palette reduce: use DawnBringer's formula for color likeness

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1837 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-10-01 19:26:13 +00:00
Yves Rizoud
50aa747510 Palette: Disabled Undo after operations that perform remapping (x-swap, x-inv, sort, reduce) because the undo was incomplete anyway.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1745 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-03-05 16:28:08 +00:00
Yves Rizoud
cdbc5be351 Fix issue 354: Palette undo unreliable
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1744 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-03-05 16:16:32 +00:00
Yves Rizoud
e01b310317 Some work on brush remapping
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1700 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-01-29 21:20:54 +00:00
Yves Rizoud
7aefad850d Fix issue 396: increasing Saturation makes greyscale red
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1658 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-12-12 18:09:11 +00:00
Yves Rizoud
730903251c Fix issue 384: Imprecise palette sliders when RGB scale is lower than 256 (but bigger than 3)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1606 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-09-06 23:33:50 +00:00
Yves Rizoud
cf8af1902c In /rgb 3 mode: If skin colors are compatible with /rgb 3, they are the ideal colors for matching, and those you add when loading low-color images or typing 'Backspace' in Palette. Otherwise the ideal color set is hard-coded black/dark_blue/grey/white
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1603 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-09-02 00:39:43 +00:00
Yves Rizoud
d78c33855b Drag-n-drop file in Grafx2 window is now cleanly prevented while a window is open: The OS's mouse cursor is the 'forbidden' sign. Preparatory work for horizontal slider controls.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1597 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-08-29 19:21:33 +00:00
Yves Rizoud
236a026137 File selector: display preview no longer changes GUI colors when the image uses less than 253 colors. Fixes many cases of issue 215, and generally allows much smoother browsing.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1592 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-08-25 18:55:48 +00:00
Yves Rizoud
fc42854490 Even more work on GUI color auto-detection. Now additionally tries to find a specific color scheme for CPC palettes (pale green and grey), if the skin's colors can't be accurately represented in /rgb 3.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1591 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-08-24 22:29:48 +00:00
Yves Rizoud
80b8c4e5a5 Palette: moved color# to the 'Reduce' dropdown, which allows nicer names for buttons 'Used' and 'Histo' (I hesitated to name it 'Stats', in case expand this screen)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1564 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-08-08 02:30:00 +00:00
Yves Rizoud
684034c687 Histogram: Shows pixel count, and selects the clicked color.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1563 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-08-08 02:17:21 +00:00
Yves Rizoud
378555d943 Palette: Fix bad placement of color count after recent change. Removed the 'Preset' function entierely (default pa
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1545 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-08-01 19:41:52 +00:00
Yves Rizoud
8df74d8e6b Palette screen: Separated the 'Used' buttons in two, one that shows the marks and the other that shows histogram. MAde 'Sort' a dropdown button.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1534 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-07-29 19:18:12 +00:00
Yves Rizoud
d5ecba7b6c Palette sort (on brightness) now uses a better formula, provided by DawnBringer. Text tool no longer crashes with some fonts. Added support for bitmap fonts from 'Bitmap Font Writer', such as those from http://www.zone38.net/font/bmpfont.html or http://www.matriaxweb.com/others.htm or http://www.genvid.com/moonstruck/downloads/fonts.html
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1530 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-07-14 19:33:53 +00:00
Yves Rizoud
d459f3f824 Palette: Tags on used colors (click 'Used' button)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1526 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-06-29 23:29:17 +00:00
Yves Rizoud
60d253d21f Palette: Fix badly positioned color count after Reduce
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1525 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-06-29 17:59:59 +00:00
Yves Rizoud
ce6aa4cad6 Palette: Can now input color by typing RGB value in hex (Issue 299)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1523 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-06-24 23:56:06 +00:00
Yves Rizoud
d5a772f5ae Changed layout of the palette screen, in preparation for issue 299: direct input of #rrggbb colors. Fixed the position of slider gradations, that weren't at 1/4, 1/2 and 3/4. Now the Reduce button works with either mouse button.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1521 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-06-23 22:27:22 +00:00
Yves Rizoud
d4d1975322 Palette: contextual menu on RMB for Copy/Paste
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1519 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-06-19 19:50:05 +00:00
Yves Rizoud
8160a8ab90 Implemented basic Cut-and-paste in Palette: Ctrl-C / Ctrl-V. It doesn't use the clipboard, but you can copy in one page and paste in another.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1518 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-06-19 19:11:37 +00:00
Yves Rizoud
038d1bc0f6 Fixes missing icon updates: On tool toggle (line,freehand,curve), On split buttons (ellipses, polygons), Palette scroll arrows (vertical or horizontal). Only missing: on skin change
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1497 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-06-07 18:47:08 +00:00
Yves Rizoud
9456b06143 Changed skin format to allow skinmakers to provide 'selected' versions of buttons. Still slightly buggy
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1495 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-06-06 19:29:28 +00:00
Yves Rizoud
c7d7938797 Settings: Added the missing mouse sensitivity; Fixed mouse droppings; Toggle settings in the other direction with right mouse button. Skins: Fixed small problem when changing skins, note taking color change into account immediately.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1465 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-04-26 19:22:00 +00:00
Yves Rizoud
8887d4ece5 Palette: fix a harmless display problem after color reduce (introduced with histogram, which redesigned the window)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1457 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-04-14 18:25:55 +00:00
Yves Rizoud
39629a8cba Palette: some refactoring. Fix an old bug with Swap, it was not updating the internal color count, so a 'Zap unused' would be based on wrong data. Added missing update of (visual) pixel count, after Copy and Swap, and Next/Prev color (hotkeys). The Palette screen now uses the user's current hotkeys for Prev/Next FGColor, Prev/Next BGcolor, and Colorpicker (instead of the defaults [ ] shift+[ shift+] ~ ).
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1441 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-04-05 00:17:19 +00:00
Yves Rizoud
6bf9fc7020 Palette histogram: Autodetect the useful range. Now draws a 1-pixel column when the color is present (can more easily see unused colors). Black outline (not really sure if it looks better). Fixed the marker on the column of the window color, sometimes it was on wrong column because of missing parenthesis
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1440 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-04-04 22:50:15 +00:00
Yves Rizoud
97d8d3600c Palette: Fix an erasing of the histogram button that happened when playing with ranges (drag a range from multiple to single color). Fix the pixel count that was printed one character to the left without erasing previous number, thus appearing 10x too much
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1439 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-04-04 21:14:26 +00:00
Adrien Destugues
f47d377534 fix stupid bug in histogram window.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1438 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-04-04 11:35:55 +00:00
Adrien Destugues
f6ecbb24ea Added an histogram window to see the color usage
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1437 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-04-04 10:35:37 +00:00
Adrien Destugues
e1f8e2837a Relayouting the palette screen to make a little more space and sense. Removed the button to recount the color, consider the option to disable autocounting now deprecated.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1436 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-04-04 09:33:42 +00:00
Adrien Destugues
777d2c318a Dividing by 256 works much better when working on integers. This avoids weird stuff happening to the sliders indicators in the palette screen...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1406 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-03-22 18:30:44 +00:00
Yves Rizoud
e0b0b41a76 Fix a bug from r1369: In Palette Invert, when the rangehad an even number of colors, the colors in the middle would not be swapped
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1377 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-03-08 23:38:50 +00:00
Yves Rizoud
3ca5322379 Reorganized source code and directory tree.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1375 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-03-05 02:53:19 +00:00