53 Commits

Author SHA1 Message Date
Thomas Bernard
76f3860712 fix after rebase 2018-01-25 22:55:27 +01:00
Thomas Bernard
1c6a9e2db2 fix UI colors Remaping when several windows are open 2018-01-25 22:55:27 +01:00
Thomas Bernard
2d26bb8a1f WIP: "Load" button in Palette Dialog
see http://pulkomandy.tk/projects/GrafX2/ticket/24

still some issues :

1) UI color remapping

2) File type selector (need to add a Palette selector
in addition to the Main and Brush selector)
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
Adrien Destugues
aef77744e1 EGX mode for CPC
In this custom mode, odd lines use MODE 0 (wide pixels, 16 colors), and
even lines use MODE 1 (square pixels, 4 colors).

- Add a settings window to the 8-bit effect where you can chose what you
want to draw
- Add the customizations required to make it work in graph.c
- Tweak some other places so it is easier to add other modes later on.
- Groundwork for some more modes: EGX2, ZX spectrum, Game Boy color.
2017-05-06 22:22:52 +02:00
Adrien Destugues
092e092c18 Finish tweaking layout of palette settings window. 2017-03-21 21:55:55 +01:00
Adrien Destugues
32b3996cb8 Add Gamma correction in palette editor
Particularly useful when working for platforms with non-linear palettes.
For example the Thomson TO8 has a Gamma correction of 2.8, so the
darkest shade of color is already very bright. It is important to take
this into account when drawing pictures to avoid bad surprises when
showing them on the real machine.

The setting is available from the command line, or from the extended
palette window, which gets a little relayout using horizontal sliders
now that these are available.
2017-03-19 09:49:35 +01:00
Adrien Destugues
fa80a10093 Implement "save palette" button
* Actually a shortcut to "save picture" with preset PAL format and different window title.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2110 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2015-03-04 10:08:34 +00:00
Adrien Destugues
e517902a4b Rework palette screen to be better usable
* RGB sliders are twice as high as before (128 pixels)
* Preview area is larger
* Add save/load buttons (not implemented yet)


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2106 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2015-03-03 14:11:11 +00:00
Adrien Destugues
5a8faa6d42 Implement "sort by histogram" in palette.
* Most used colors are moved to the start of the palette
* Stable sorting is used, so unused colors at the end of the palette are not moved at all


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2104 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2015-03-03 08:57:34 +00:00
Yves Rizoud
c821dbebf4 Modify the RGB scale formula
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2070 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2014-02-15 17:34:43 +00:00
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