Commit Graph

3663 Commits

Author SHA1 Message Date
David Capello
7cfdf76b0e Add rotation pivot options in context bar (fix #370)
With these options we can configure to show the pivot and the default
location when we select a sprite area.
2015-07-29 16:35:34 -03:00
David Capello
9ca83e2624 Add support to include any kind of widget inside a Menu 2015-07-29 12:32:01 -03:00
David Capello
de3d408581 Unhighlight menu items when the mouse leaves them 2015-07-29 11:42:57 -03:00
David Capello
45b9df78d6 Fix compilation error on clang and gcc 2015-07-28 18:04:31 -03:00
David Capello
1b4ff37112 Simplify remap between old -> new palette
Now the remap is calculated from the old palette to the new palette when
the "Remap" button is pressed. In this way we can remap after loading
a new palette (fix #737), or after generating an optimized palette, or
changing colors (fix #563).
2015-07-28 17:16:32 -03:00
David Capello
056e365cc3 Use a PopupWindow instead of a TipWindow for SnapToGridWindow 2015-07-28 14:55:40 -03:00
David Capello
694b1c8da6 Rename blit_valid_rgn parameter to blitValidRegion 2015-07-28 14:48:19 -03:00
David Capello
a7ea0f7ec5 Add "Snap to Grid" indicator when it's enabled (fix #122) 2015-07-28 13:05:59 -03:00
David Capello
9e5ccbcca9 Remove StatusBar color names in status_bar.cpp 2015-07-28 12:25:15 -03:00
David Capello
0898d685c2 Fix minor UI bug in the initial ContextBar::TransparentColorField state 2015-07-28 11:14:12 -03:00
David Capello
58db0fba09 Fix bug clearing an Image with color=0 in rotsprite
Introduced in commit 35229e99a6
2015-07-28 11:06:35 -03:00
David Capello
8e2feb31bd Implement LockAlphaInkProcessing for indexed images 2015-07-28 10:45:35 -03:00
David Capello
bee6baf812 Select faster ink (INK_COPY) when we use an opaque color and opacity = 255 2015-07-28 10:31:09 -03:00
David Capello
88c4cd8d87 Don't show brush boundaries when the brush & zoom are too small
We can use the CROSS brush preview type instead of BRUSH_BOUNDARIES
2015-07-28 10:21:33 -03:00
David Capello
a1dcb05a99 Add support to copy cels from Indexed <-> Indexed with different palettes 2015-07-27 13:31:19 -03:00
David Capello
bdbffc8e6c Fix bug copying cels from Indexed to RGB sprites 2015-07-27 13:08:25 -03:00
David Capello
8f891a4e25 Add asserts to detect bugs adding cels w/pixel format != sprite's pixel format 2015-07-27 12:40:02 -03:00
David Capello
5a5579973c Add missing palette parameter to render::composite_image()
This is needed when we copy a cel (or cel range) from an Indexed image
to an RGB image.
2015-07-27 12:24:54 -03:00
David Capello
41bb23f1f1 Change opaque/transparent selection by default depending on the layer 2015-07-27 11:43:48 -03:00
David Capello
bc29cd4bc5 Set alpha compositing as default
And "replace pixel" and "set alpha" were merged into "copy color" ink.
2015-07-27 11:24:00 -03:00
David Capello
940dd5f45c Fix alpha compositing on background layer using colors with alpha < 255 2015-07-27 10:53:02 -03:00
David Capello
0f38a7dace Don't use the ColorBar bg color when Background is visible in Flatten 2015-07-27 08:34:05 -03:00
David Capello
64ae80f0d3 Remove some TODO items 2015-07-27 08:21:51 -03:00
David Capello
02d0d7203a Show background layer after Flatten command 2015-07-27 08:20:15 -03:00
David Capello
ea09ada11b Add custom clipboard format on Win32 to copy/paste image+mask+palette 2015-07-26 19:07:51 -03:00
David Capello
c5f898e6a7 Fix compilation error resolving doc::color_t type in gcc and clang 2015-07-23 22:52:49 -03:00
David Capello
35229e99a6 Add opaque/transparent mode in context bar for transformations (fix #546)
With this change now we add a "mask" image/parameter in rotation
functions. In this way we can identify which specific pixels are
inside the original mask/selection, and in opaque mode we can
include/scale/rotate all those pixels inside the mask, whatever
value they are, even if they are the mask color.

Fixes #730
2015-07-23 22:42:14 -03:00
David Capello
ba4c34a70f Add options to sort the palette by RGBA channels 2015-07-23 11:13:43 -03:00
David Capello
6aeee0b8fa Show opacity when brush is an image (ignoring the ink type) 2015-07-23 10:43:16 -03:00
David Capello
66ddc62a76 Add an option to share ink/opacity parameters between all tools 2015-07-23 10:07:07 -03:00
David Capello
692a4cf009 Include layer opacity on merge down command 2015-07-23 09:19:08 -03:00
David Capello
ce7c34bb72 Avoid 32-bit integer overflow in median cut algorithm (fix #727)
This fixes a problem generating invalid RGBA entries for an optimized
palette. (E.g. Generating non-opaque pixels when we feed the algorithm
only with opaque pixels.)
2015-07-23 09:05:48 -03:00
David Capello
dd0a6d6a40 Make minor changes in color_histogram.h and median_cut.h 2015-07-23 08:52:37 -03:00
David Capello
5f44ac9d25 Remove unused dithering property in GifOptions 2015-07-23 06:50:08 -03:00
David Capello
b35fc87ec1 Add progress bar when a palette is created from a RGB file 2015-07-22 18:26:25 -03:00
David Capello
96080a378c Remove frameNum from GifEncoder::writeLoopExtension() 2015-07-22 17:41:14 -03:00
David Capello
e71fd36c24 Fix gif_format.cpp compilation on Linux and with giflib 4 2015-07-22 17:30:11 -03:00
David Capello
7f4d4936e1 Re-implement GIF encoder
- Correct usage of disposal methods (and possibility to generate records
  with "restore previous frame" disposal method)
- Create color maps for each frame when necessary
- Remove options to dither RGB images (to simplify encoder)
2015-07-22 16:40:44 -03:00
David Capello
91988de955 Remove unused function create_palette_from_images() 2015-07-22 14:31:59 -03:00
David Capello
8fbf0854b0 Fix layout bug when a file cannot be opened from the recent list in HomeView 2015-07-22 13:14:41 -03:00
David Capello
cee355ee61 Fix minor layout issues in the Preferences dialog 2015-07-18 13:29:23 -03:00
David Capello
65fe7dbccf A GIF color map cannot have more than 256 colors 2015-07-17 12:57:32 -03:00
David Capello
ae2f04f855 Fix creation of local colormaps in GifFormat::onSave() 2015-07-17 12:45:59 -03:00
David Capello
cb867b7f84 Re-implement GIF decoder to load some .gif files correctly (fix #729)
- Better palette creation depending on local colormaps
- Reuse palette colors from previous frames
- Use frame transparent index correctly
- Convert to RGB automatically if the image has more than 256 colors
- Remove onPostLoad()
- Add progress bar feedback
2015-07-17 12:26:11 -03:00
David Capello
065825c373 Change DisposalMethod type to enum class 2015-07-15 17:13:37 -03:00
David Capello
5036ffd738 Change the message to convert a GIF file to RGB on GifFormat::onPostLoad 2015-07-15 16:50:47 -03:00
David Capello
37478688c0 Fix problem loading gif files using subset of the original color map (fix #729)
There are gif files that use a subset of the original color map remapping
used entries into first indexes. E.g. the main palette contains 256 colors,
but then a frame can use 4-bit per pixel to reference 16 colors from the
original 256 color palette.
2015-07-15 15:42:54 -03:00
David Capello
008dceb55d Replace iterators with range-based loop in gif_format.cpp 2015-07-15 15:09:07 -03:00
David Capello
b426171679 Add new_mask_color parameter to convert_pixel_format() function
When we converted an Indexed image to RGB, the original sprite
transparent color was being kept but the mask color of all its images
was reset to 0. With this change we kept the same mask color on all images
to avoid an assert() in the render code.

Anyway the whole RGB <-> Indexed conversion should be reviewed in these
cases. I think there are some situation where a transparent color = 0 is
expected in RGB sprites (as we shouldn't be able to change the transparent
color of an RGB sprite).
2015-07-14 09:44:31 -03:00
David Capello
accc0e7942 Fix conversion from Indexed to RGB when multiple palettes are present (fix #726) 2015-07-14 08:23:26 -03:00