Commit Graph

59 Commits

Author SHA1 Message Date
David Capello
5f97e66a8b Include base/base.h on files that use MIN/MID/MAX 2016-03-03 19:18:46 -03:00
David Capello
4f6a7a7742 Include base/debug.h on files that use ASSERT or TRACE 2016-03-03 19:17:07 -03:00
David Capello
d78f892236 Add more zoom levels 2016-02-25 18:51:13 -03:00
David Capello
15e10ad9f6 Add touch magnify event to support OS X trackpad gesture 2016-02-18 13:58:45 -03:00
David Capello
3c219571b1 Don't change mask-index entry if it's out of the bound in PaletteOptimizer::calculate() 2015-09-24 23:39:36 -03:00
David Capello
ffba179712 Avoid an extra palette entry for the mask color in PaletteOptimizer::calculate() (fix #771) 2015-08-24 19:05:36 -03:00
David Capello
0d5ba77ba4 Add support to create palettes for Indexed images (fix #751) 2015-08-20 12:37:58 -03:00
David Capello
a08352d4b5 Add minor ASSERT() in Render::renderLayer() to check preview image pixel format 2015-08-19 12:53:15 -03:00
David Capello
1cd551554b Fix possible ambiguous condition on Render::renderLayer() 2015-08-18 14:29:17 -03:00
David Capello
4dc6da286e Add zoom slider in StatusBar (issue #420) 2015-08-14 19:46:48 -03:00
David Capello
8e47e507fd Fix Editor::screenToEditor() for sprite positions < (0,0) 2015-08-14 14:26:05 -03:00
David Capello
1b930d4d42 Draw document's extra cel (brush preview) in the current frame only 2015-08-12 17:24:48 -03:00
David Capello
45219abfec Fix brush preview in transparent layers
This bug was introduced bf54fd26d3
2015-08-11 19:58:39 -03:00
David Capello
3103f54131 Change zoom scale to avoid similar zoom levels
- Renamed Editor::offset() with padding()
- Changed padding size (and added Editor::calcExtraPadding() function)
- Added Zoom::linearScale() and Zoom::fromLinearScale()
2015-08-04 12:26:58 -03:00
David Capello
1b217f257c Add missing src/render/onionskin_position.h file 2015-07-31 16:07:24 -03:00
David Capello
bf54fd26d3 Add option to put the onion skin behind the sprite
Fix #526 and fix #412
2015-07-31 15:55:06 -03:00
David Capello
80b47419fd Add an option to onionskin the current layer only (related to #526) 2015-07-31 14:30:11 -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
c5f898e6a7 Fix compilation error resolving doc::color_t type in gcc and clang 2015-07-23 22:52:49 -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
b35fc87ec1 Add progress bar when a palette is created from a RGB file 2015-07-22 18:26:25 -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
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
55f90d8b8b Add target_link_libraries() for sublibraries
With this change we remove some internal variables/lists like sys_libs,
libs3rdparty, etc. And we fix dependencies problems between targets.
2015-07-13 12:16:55 -03:00
David Capello
e9308c2d35 Add alpha channel in quantization (related to #286) 2015-07-02 11:18:43 -03:00
David Capello
372d604d93 Add support for alpha channel in RgbMap and Palette::findBestfit()
This include several changes:
- Color::getIndex() can return palette values with alpha != 255
- Fix Transparent and Blurs ink for indexed images to make better use
  of palette entries with alpha values
- Fix bilinear resize algorithm for indexed images with alpha
- New RgbMap with four parameters: R, G, B, A
- Add one extra color scale function used in the alpha channel of the
  new RgbMap
- Fix color curve, convolution matrix, invert color, and median filters
  to take care of this new alpha channel on indexed images
- Fix ordered dithering and quantization

Related to #286
2015-07-01 21:33:30 -03:00
David Capello
8f24c05451 Fix indexed -> RGB/grayscale conversion when palette colors have alpha 2015-06-30 21:25:27 -03:00
David Capello
318bc2e2f9 Add alpha channel to palette/color bar/color selector (issue #286) 2015-06-30 17:36:37 -03:00
David Capello
8abc486c85 Use doc:: namespace to access Rgb/IndexedTraits in render::OrderedDither 2015-06-23 11:27:05 -03:00
David Capello
b9e7e1b373 Replace std::array with a raw C array
The clang version we're using don't support this feature (from OS X 10.7)
2015-06-23 11:23:05 -03:00
David Capello
70ea54aa20 Re-implement ordered dither in render library 2015-06-22 20:58:33 -03:00
David Capello
ae0bf75965 Fix creation of optimized palettes from RGB images
It's working again, now we create palettes with 256 colors (or less)
for RGB images.
2015-06-22 19:40:28 -03:00
David Capello
89e0392daa Add support for palettes with more less (and more) than 256 colors (fix #668)
With this commit we've removed doc::Palette::MaxColors constant.
2015-06-18 12:50:33 -03:00
David Capello
fb4b2e76c8 Add layer opacity property (fix #225) 2015-06-14 20:23:49 -03:00
David Capello
21ca87862c Add layer blending modes (fix #318)
- Added doc::BlendMode enum and doc::BlendFunc type
- Renamed LayerImage::getBlendMode() -> blendMode()
- BLEND_MODE_COPY is BlendMode::SRC now
- BLEND_MODE_NORMAL is BlendMode::NORMAL now
- Added app::cmd::SetLayerBlendMode
2015-06-13 21:29:16 -03:00
David Capello
9a6ac48bfa Fix circular dependencies between image_impl.h <-> image_iterator.h
This problem was introduced in d732f5b05f

Now image_iterator.h and image_bits.h use forward declarations. And if
someone want to use the Image implementation, ImageBits, LockImageBits,
ImageIterators, or some function inside primitive_fast.h, they just have
to include image_impl.h file.
2015-06-12 13:56:18 -03:00
David Capello
4d055a7170 Rename gfx::Rect::createIntersect -> createIntersection 2015-06-09 16:22:47 -03:00
David Capello
1eb94d746d Fix red/blue onion skin for Indexed images 2015-06-08 19:58:23 -03:00
David Capello
0a1dfe0633 Merge branch 'onionskin'
Conflicts:
	src/app/ui/editor/play_state.cpp
	src/render/render.cpp
	third_party/gtest
2015-06-05 15:53:15 -03:00
David Capello
557c7854bc Fix random crash using Eyedropper with Alt+click
This was a problem related to uninitialized memory in Render class.
The Render::renderLayer() member function was accessing to an invalid
m_previewImage pointer.
2015-06-05 01:05:35 -03:00
David Capello
3388eaffde Show onion skinning depending on the configured loop section (fix #555)
There is a new option (per document) to disable this behavior.
2015-05-27 17:42:41 -03:00
David Capello
625aa1ee55 Move onionskin options into render::OnionskinOptions class 2015-05-27 14:49:01 -03:00
David Capello
85d638097b Use rendered images to create optimized palette in render::create_palette_from_rgb() 2015-05-21 10:17:59 -03:00
David Capello
1ef1f9e3e7 Add option for color quantization in the ColorBar options popup 2015-05-08 17:34:51 -03:00
David Capello
4e6db14cae Use a PreviewToolLoopImpl to preview the current tool ink/point shape/etc
With this we can see the exact preview in real-time of the the left
click paiting (e.g. using real Indexed composition, ink, point shape, etc.)
We are able to preview blur, eraser, or flood fill preview too (anyway
these are not enabled at this moment).
Changes:
* Add render::ExtraType enum to indicate if the extra cel acts like a
  patch for the current cel (e.g. cursor), or as an extra layer for
  composition (e.g. selection/moving pixels)
* Add ExtraCelType property to app::Document and to render::Render
* Add ToolBox::getPointShapeById()
* As the current cursor preview depends on the current layer, when
  we change the current layer we've to update the Preview editor
  with the new selected layer (now we listen to
  Document:.onAfterLayerChanged())
* Add create_tool_loop_preview() and PreviewToolLoopImpl
2015-04-26 15:59:28 -03:00
David Capello
22c3c4f20e Remove implicit SharedPtr conversion to T* 2015-04-02 20:42:43 -03:00
David Capello
827eddd459 Fix problem copying background cels in indexed images
Now index 0 is persisted in the copy.
2015-03-16 18:04:57 -03:00