Commit Graph

474 Commits

Author SHA1 Message Date
David Capello
addddf78a5 Add color field to doc::UserData 2015-12-11 19:18:36 -03:00
David Capello
8b5d013b03 Serialize user data for layers and cel data
In this way undo/redo restore user data.
2015-12-11 15:11:24 -03:00
David Capello
08bef859e3 Add user data field on layers and cels 2015-12-10 18:34:25 -03:00
David Capello
e63dea61fd Include opacity and blend mode for each layer in JSON output 2015-12-09 11:00:57 -03:00
David Capello
2d2434daea Export AniDir field for FrameTags in JSON meta attribute 2015-12-03 12:07:46 -03:00
David Capello
e525fc10a6 Add --all-layers option to export hidden layers (fix #805)
Now Aseprite will export only visible layers by default.

- Added doc::LayersRange to simplify layer iteration
2015-11-05 13:01:53 -03:00
David Capello
4a67a96edd Use mask in flood fill as edges (fix #823) 2015-11-04 16:48:25 -03:00
David Capello
78daffba73 Fix shading mode on RGB mode when index 0 is involved (fix #794)
As now the RgbMap is generated correctly depending on the current layer
(if it’s opaque or transparent), we’ve fixed
LockAlpha/Transparent/Merge/Blur/Replace/JumbleInkProcessing for
Indexed images with a background layer, when a transparent layer is the
active one, and when a non-mask index has same RGB values than the mask
index.
2015-11-04 10:33:23 -03:00
David Capello
9225420eba Minor change in floodfill.h/cpp 2015-11-02 16:45:09 -03:00
David Capello
1bb0bca361 doc and gfx libraries depends on fixmath (fix #817) 2015-09-24 10:02:52 -03:00
David Capello
a9c3f82c11 Use a binary search to find cels in LayerImage 2015-09-15 08:18:52 -03:00
David Capello
510a686020 Change CelList and LayerList from std::list to std::vector
This change gives us an huge performance improvement to paint the
Timeline widget.
2015-09-14 17:37:21 -03:00
David Capello
dc9ee103f0 Make CelProperties dialog non-modal 2015-08-21 08:35:29 -03:00
David Capello
728432f9e5 Convert "Layer Properties" dialog in a non-modal window 2015-08-21 00:44:28 -03:00
David Capello
0ec21a461a Fix asserts in Palette::makeGradient() 2015-08-11 12:43:29 -03:00
David Capello
cc90c3e6f4 Fix remapping decoded gif files to the global colormap when mask != 0 2015-07-31 13:32:23 -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
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
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
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
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
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
af9d5c917f Keep the relative order of equal entries in sort_palette() 2015-07-14 07:47:22 -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
98297de464 Add backward compatibility for color palette in .ase files
With this change we save the new palette chunk when it's necessary, and
the old color2 chunk will be always present only for backward
compatibility. (So we can open a .ase file saved with v1.1 in v1.0.)
2015-07-07 12:18:56 -03:00
David Capello
8fd756c32a Add Edit > Shift commands (fix #681) 2015-07-06 18:48:55 -03:00
David Capello
210d9c7591 Add warning and correct undo information for unsafe remaps in 8-bit images (fix #715) 2015-07-06 16:15:54 -03:00
David Capello
b085fee918 Improve drag-and-drop in ColorBar/PaletteView widget 2015-07-04 19:11:50 -03:00
David Capello
be70c1645b Minor change in initBestfit() and Palette::findBestfit() 2015-07-03 14:35:01 -03:00
David Capello
66168d6b06 Change RgbMap behavior to act like a cache of Palette::findBestfit() calls
Instead of calling findBestfit() for all RGBA colors in
RgbMap::regenerate(), we mark all entries as invalid, and then we
validate them only when the user require one specific entry from
RgbMap::mapColor(). With this we avoid a lot of unnecessary computations
each time the palette changes.
2015-07-03 14:34:54 -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
318bc2e2f9 Add alpha channel to palette/color bar/color selector (issue #286) 2015-06-30 17:36:37 -03:00
David Capello
78918c0df8 Improve ColorQuantization UI to select the # of colors for the new palette 2015-06-30 15:25:23 -03:00
David Capello
7a63476a98 Add support to save .ase files with more than 256 palette color entries
We've added a new chunk type in .ase files to save palettes with alpha
channel, color name, and palettes with more than 256 colors.

Related to #668, #467, and #286
2015-06-30 13:34:55 -03:00
David Capello
4b213f3039 Improve selection tools performance
This commit reduce the number of computations needed to calculate the new
mask bounds. (E.g. avoiding get pixel calls in Mask::shrink().)
2015-06-25 17:53:11 -03:00
David Capello
66330dc39a Remove unused libart library source code 2015-06-23 12:45:05 -03:00
David Capello
c12a546c10 Remove unused variable in doc::Palette::resize() 2015-06-23 11:25:19 -03:00
David Capello
6a829727b7 Fix initialization order of LayerImage members 2015-06-23 11:25:00 -03:00
David Capello
7a6c9c3dde Fix clang compilation error in rotate.cpp 2015-06-23 11:24:10 -03:00
David Capello
430b0ca637 Improve image_scale2x_tpl() performance with iterators for dst image 2015-06-20 02:23:41 -03:00
David Capello
77fefa8ec0 Reduce memory usage for RotSprite algorithm (fix #691) 2015-06-20 01:59:15 -03:00
David Capello
07f42d620d Change cut/clear behavior to remove palette entries 2015-06-18 16:20:42 -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
312e3f9da0 Remove unused doc::Palette::make*Ramp() member functions 2015-06-17 17:02:43 -03:00
David Capello
3c60136631 Move PI constant to base/pi.h file 2015-06-16 15:04:00 -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
0a17a82fe0 Avoid two ImageIterators in MaskBoundaries ctor when we compile in release mode 2015-06-11 19:00:24 -03:00
David Capello
d732f5b05f Use get_pixel_address_fast() in ImageIterator 2015-06-11 18:59:51 -03:00
David Capello
826aafe2a4 Replace GIMP code to generate mask and brush boundaries 2015-06-11 17:44:27 -03:00
David Capello
5308303d8a Don't call FrameTag::setId() we are restoring them from data recovery 2015-06-10 18:22:07 -03:00
David Capello
5644d8fe18 Fix typo in doc/object.cpp 2015-06-10 17:57:57 -03:00
David Capello
e0781eb461 Include AniDir field for FrameTag undo and data recovery information 2015-06-10 17:57:50 -03:00
David Capello
4d055a7170 Rename gfx::Rect::createIntersect -> createIntersection 2015-06-09 16:22:47 -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
2d61412c68 Fix several compiler problems with clang on Mac OS X 10.10 SDK 2015-05-29 10:10:07 -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
15a227d06f Add support for .pal files (fix #349, related to #181) 2015-05-20 16:08:16 -03:00
David Capello
a4e7df6037 Fix loading/saving .gpl files inside folders with Unicode chars on Windows 2015-05-20 15:33:34 -03:00
David Capello
23a4cb3a0b Fix some problems updating the StatusBar cel opacity slider
Now the StatusBar observes changes in the cel opacity to update the
slider (e.g. when we change the cel opacity through Cel > Properties
menu, the StatusBar refresh its slider).
2015-05-19 16:39:47 -03:00
David Capello
15fb45f3a1 Avoid problems regenerating brush boundaries when the brush image ptr addresses are the same 2015-05-18 20:45:54 -03:00
David Capello
9fc7b993d4 Add ability to cut colors in the ColorBar 2015-05-10 21:36:46 -03:00
David Capello
c1324d196e Fix ColorBar::onCanPaste() to return true when we can still paste colors 2015-05-09 20:27:40 -03:00
David Capello
11d86bb7c5 Add ability to copy colors using Ctrl + drag & drop 2015-05-09 15:57:46 -03:00
David Capello
62a3594598 Add ability to copy & paste colors with Ctrl+C and Ctrl+V
This commit includes the new doc::PalettePicks class. It's a helper
class to identify which entries are selected in the ColorBar.

We've removed the Copy/Paste buttons from the Palette Editor window.
2015-05-09 12:20:58 -03:00
David Capello
6a9382a975 Add option to reverse colors 2015-05-08 14:28:27 -03:00
David Capello
575e94e559 Add popup menu to sort palette colors 2015-05-08 13:03:06 -03:00
Aurélien Gâteau
2855180dd9 Fix build with g++ 4.9 2015-05-07 22:59:10 +02:00
David Capello
c3d7a96a87 Replace ContextObserver::onActiveDocumentChange() with onActiveSiteChange() 2015-05-05 12:58:50 -03:00
David Capello
b519901cef Add support to specify tags in --filename-format option (related to #607)
Now we can use "{tag}" (or "{innertag}") and "{outertag}" in the filename
format.
2015-04-30 17:02:57 -03:00
David Capello
35e951ec70 Merge branch 'build-fixes' of https://github.com/agateau/aseprite into agateau-build-fixes 2015-04-30 12:03:29 -03:00
David Capello
2932add184 Fix BrushInkProcessing so we can use brushes between different pixel formats 2015-04-29 16:04:57 -03:00
David Capello
c5e79bb940 Optimize CompressedImage to get only bitmap information
When we create a CompressedImage from a Brush image, we want to know what
pixels are != the mask color, just to generate the PointShape (we don't
care the specific color of the scaneline/each pixel, that information is
used in the "ink processing" step).
2015-04-29 15:43:52 -03:00
David Capello
1b25c4e9e9 Add slots in the ContextBar to select brushes with Alt+1, Alt+2, etc.
Now the ContextBar contains a set of brushes. The ChangeBrushCommand
supports a new "slot" parameter and "change" = "custom" to select a
specific custom brush from the ContextBar. Alt+1, Alt+2, etc. are mapped
to this ChangeBrushCommand (see changes in gui.xml).

Also, as the ButtonSet that represent different brushes in the ContextBar
uses icons generated from the brush, we don't need the skin parts that
represent each brush type (we can generate those icons from some standard
brushes). Those skin parts were removed.
2015-04-29 12:32:44 -03:00
David Capello
b08b226aef Move active brush information to ContextBar 2015-04-28 18:21:33 -03:00
Aurélien Gâteau
ad1290b1c8 Fix build of document_api_test.cpp
Compiler could not find notifyActiveDocumentChanged.

/home/aurelien/src/aseprite/src/./doc/test_context.h: In instantiation of ‘void doc::TestContextT<Base>::onRemoveDocument(doc::Document*) [with Base = app::Context]’:
/home/aurelien/src/aseprite/src/app/document_api_tests.cpp:66:1:   required from here
/home/aurelien/src/aseprite/src/./doc/test_context.h:44:58: error: ‘notifyActiveDocumentChanged’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
         notifyActiveDocumentChanged(m_activeDoc = nullptr);
2015-04-27 18:08:21 +02:00
David Capello
96769d061e Rename BrushPattern::ALIGNED_FROM_SRC to ALIGNED_TO_SRC 2015-04-27 11:45:00 -03:00
David Capello
dfeff22b2f Add possibility to create brushes from selection
Changes:
* Add doc::kImageBrushType
* Add doc::BrushPattern enum
* Add pattern and pattern origin properties to doc::Brush
* Add NewBrush and DiscardBrush commands (new Ctrl+B shortcut to create
  brushes)
* Add BrushInkProcessing
2015-04-27 00:08:04 -03:00
David Capello
98cd5056b3 Remove now unused doc::draw_brush() function 2015-04-26 16:29:23 -03:00
David Capello
8382d1ca8f Replace Brush::m_scanline with doc::CompressedImage 2015-04-25 20:01:03 -03:00
David Capello
4a05436252 Replace internal doc::Brush image with a doc::ImageRef 2015-04-25 19:41:07 -03:00
David Capello
9fa26dc2f4 Fix problem saving transparent GIF and PNG files when the background layer is hidden 2015-04-21 13:20:36 -03:00
David Capello
21c4fd51d9 Move app::DocumentLocation to doc::Site
This is a first step to include the current selected range of layers
and frames inside the doc::Site structure. So in the future we'll not need
to know about the Timeline in commands that handle those ranges.
2015-04-20 16:27:09 -03:00
David Capello
43a0279a24 Fix crash converting sprite to grayscale 2015-04-15 13:58:35 -03:00
David Capello
13a977f0e6 Continue loading backup data if we fail loading one image 2015-04-15 12:20:41 -03:00
David Capello
045ece4114 Avoid reading invalid images in doc::read_image() 2015-04-10 11:26:36 -03:00
David Capello
989698dc6a Remove unused variable in doc::read_image() 2015-04-09 13:46:20 -03:00
David Capello
7b2b30564d Compress images in doc::read/write_image() functions 2015-04-09 11:02:26 -03:00
David Capello
a4478e9306 Add UI and logic to recover a backup session
Changes:
* Add DataRecoveryView
* Split SubObjectsIO into an interface and SubObjectsFromSprite
* Add a "setId" parameter to some doc::read_* functions (we need this
  functionality from session recovery)
2015-04-08 20:05:05 -03:00
David Capello
5cf0396d98 Add version to doc::Object to avoid making backups of unmodified objects 2015-04-07 17:53:31 -03:00
David Capello
f9a24096d3 Remove unused local variable in doc::write_layer() 2015-04-07 01:28:27 -03:00
David Capello
22c3c4f20e Remove implicit SharedPtr conversion to T* 2015-04-02 20:42:43 -03:00
David Capello
3d63e0e1b4 Move SharedPtr to base namespace 2015-04-01 12:35:18 -03:00
David Capello
b13601117f Add option to "remap" colors after a drag-and-drop (related to #563) 2015-03-23 12:57:59 -03:00
David Capello
d14e4e8896 Add support to drag-and-drop colors in ColorBar/PaletteView (fix #37) 2015-03-23 12:25:32 -03:00
David Capello
cedab5b553 Add const modifier to Sprite::rgbMap() member function 2015-03-19 18:47:57 -03:00
David Capello
50e9ed6326 Unify "Export Sprite Sheet" command with DocumentExporter 2015-03-17 16:43:51 -03:00
David Capello
b3232311ff Copy frame tags when we duplicate a sprite 2015-03-16 18:21:08 -03:00
Getty
85c569b2f1 Small fixes needed to build on Linux: missing #includes and shadowed templates 2015-03-14 17:28:02 -07:00
David Capello
e6dc94ddb2 Add undo info for FrameTags when frames are added/removed
Also we remove the entire FrameTag when all its frames are removed.
2015-03-12 15:05:20 -03:00
David Capello
cdc9b419c7 Fix crash adding/removing frames in sprites with frame tags 2015-03-11 18:45:35 -03:00
David Capello
a504ba3783 Delete all 'FrameTag's in ~FrameTags 2015-03-10 19:28:21 -03:00
David Capello
6d12deafe6 Use ObjectId to identify FrameTags in the Timeline/frame tags commands 2015-03-10 17:04:55 -03:00
David Capello
7c3e8326e6 Clicking on a tag name shows its properties 2015-03-10 16:25:20 -03:00
David Capello
1f4400b943 Keep FrameTags in order 2015-03-09 15:56:04 -03:00
David Capello
58d302749c Use a FrameTag for the loop section (fix #557)
Changes:
* Paint FrameTags in Timeline with labels
* Add app::ui::FrameTagWindow
* Fix FrameTag::m_aniDir initialization
* Add warning for files that doesn't support frame tags
* Remove document preferences related to the active loop
2015-03-09 13:57:54 -03:00
David Capello
e09cdd67cb Add support to compile with VS2013 x64 2015-03-06 17:01:08 -03:00
David Capello
b23194dfae Fix several warnings in MSVC, clang, and gcc 2015-03-05 15:19:00 -03:00
David Capello
7da6f3e857 Minor changes to some #include header files 2015-03-05 12:40:47 -03:00
David Capello
69d78a0add Add missing std:: so gcc on Linux works just fine (related to #604) 2015-03-04 23:24:01 -03:00
David Capello
2c7fe41d6d Fix minor problems with clang 2015-03-04 22:57:55 -03:00
David Capello
361a3084fd Merge branch 'new-workspace'
Conflicts:
	src/app/commands/cmd_open_file.cpp

Fixes:
	src/app/ui/timeline.cpp
2015-03-04 22:41:34 -03:00
David Capello
ad856b2a55 Use std:: when necessary, and std::numeric_limits instead of INT_MAX 2015-03-04 21:35:11 -03:00
David Capello
2dac7f3869 Add Frame Tags Properties dialog/command 2015-02-20 11:42:59 -03:00
David Capello
adf3e6c00d Add AniDir as a FrameTag property (it's persisted in .ase files) 2015-02-19 13:05:39 -03:00
David Capello
9e67942235 Persist FrameTags in .ase files 2015-02-17 18:05:34 -03:00
David Capello
d438fa09ed Displace all FrameTags in Sprite::add/removeFrame() 2015-02-17 16:07:20 -03:00
David Capello
446030a8e1 Implement FrameTags::add/remove() member functions 2015-02-17 16:07:03 -03:00
David Capello
a921ca171b Fix FrameTags::List type 2015-02-17 16:06:49 -03:00
David Capello
9e51cdce9c Implement Sprite::frameTags() 2015-02-17 16:06:33 -03:00
David Capello
bcf3b47962 Add doc::write/read_frame_tag() 2015-02-17 13:18:24 -03:00
David Capello
51a03f27ab Add doc::read/write_string() 2015-02-17 13:16:33 -03:00
David Capello
9106f3ada6 Separate frame_tags.cpp/h into frame_tag and frame_tags files 2015-02-17 12:52:27 -03:00
David Capello
f4603b3be1 Add FrameTag(s) classes 2015-02-17 11:37:42 -03:00
David Capello
f3974002d5 Fix int <-> double <-> float casts
It looks like allegro includes several implicit conversions between
float and double.
2015-02-14 22:37:56 -03:00
David Capello
16da2512b4 Remove dependency with Allegro library in config.h file
* Created base::write24bits() function (and detect endianness with a
  special base/config.h.cmakein)
* Use _WIN32 instead of ALLEGRO_WINDOWS
* Use _DEBUG instead of DEBUGMODE
* Replaced AL_CONST with "const" in bmp_format.cpp
* Replace stricmp() with base::utf8_icmp()
2015-02-12 10:55:58 -03:00
David Capello
3ebb708000 Add CelData to share image/position/opacity between linked cels
Changes:
- Merged app::cmd::ObjectIO into doc::SubObjectsIO
- Changed app::cmd::SetCelImage with app::cmd::SetCelData
- Added Cel::createCopy/Link() to avoid confunsion with Cel copy ctor
- Renamed Sprite::getImage() -> getImageRef()
- Added Sprite::getDataCelRef()
- Added doc::CelsRange helper to iterate cels
- Added Sprite::cels()/uniqueCels() member functions (removed
  Sprite::getCels())
- Added DocumentRange::convertToCels()
2015-02-09 11:40:43 -03:00
David Capello
e975d1c710 Add Sprite::first/lastLayer() member functions 2015-02-04 08:19:02 -03:00
David Capello
3f99737758 Fix bug undoing a removed layer with linked cels
Images must be stored independently of cels. So read/write_cel() just
read/write the Cel information (with image ID only), and the image data
must be read/written by the caller.
2015-01-22 10:28:07 -03:00
David Capello
06628a2ee7 Merge branch 'master' into feature/continuous-cels 2015-01-21 11:37:22 -03:00
David Capello
ce08c144e8 clang is not working with unordered_map (maybe because we use the old SDK) 2015-01-21 11:22:55 -03:00
David Capello
a6e76201de Fix bug in write_cel(): write the correct image ID for linked cels 2015-01-20 09:36:38 -03:00
David Capello
6e5db5b33d Add Cel::links() member function to know how many links has the cel's image 2015-01-20 09:36:01 -03:00
David Capello
74e69e0666 Add continuous layer flag (to indicate that the layer prefer linked cels) 2015-01-20 09:33:56 -03:00
David Capello
e55865843e Replace undo impl: replace undoers with cmds
Undoers were little objects to swap/revert an action. They didn't
execute the action itself, they just revert its previous state. Now
undoers were replaced with cmds: A cmd is an object that
executes/undoes/redoes just one action.

Changes:
* Remove old undo library and app/objects_container_impl.cpp
  (now we use the doc::ObjectId directly to store undo info)
* Remove all Undoers from app/undoers/
* Replace DocumentApi impl with little Cmds in app/cmd/, these
  cmds handle execute/undo/redo of each action at the logic layer
* Remove doc::Dirty object
* Remove doc::Settings: all undo configuration is in the app side
* Move undo options from app:ISettings to app::Preferences
* Rename UndoTransaction to Transaction
* Create a CmdSequence to store a sequence of Cmds (as now the new
  undo library doesn't support open/close groups)
* Add doc::get<T>(ObjectId) function to get any kind of object
  from the doc library by its ID
* Add Cel::document() and Sprite::document() members
* Add Sprite::cels(frame_t) to get all cels in the given frame
* Add Layer::displaceFrames() member function
* Move the "allow non-linear history" flag from undo2::UndoHistory
  to app::DocumentUndo
2015-01-18 22:05:33 -03:00
David Capello
f1f24cbcdd Replace doc::Stock with doc::ImageRef shared pointer
Changes:
* Add doc::ImageRef to count references to the same image between Cels
  (at this moment we cannot generate linked cels anyway)
* Remove doc:Stock class and doc::Sprite::m_stock member variable
* Remove app::undoers::Add/RemoveImage
* Add doc::SubObjectsIO and app::undoers::ObjectIO to
  replace doc::LayerSubObjectsSerializer
2015-01-04 10:58:14 -03:00
David Capello
1b55fe39dc Merge branch '1.0'
Conflicts:
	src/raster/conversion_alleg.cpp
2015-01-03 18:42:11 -03:00
David Capello
603dde343f Replace doc::LayerImage::getCel() with doc::Layer::cel() 2014-12-28 21:04:08 -03:00
David Capello
06d18f1e8a Replace doc::FrameNumber with doc::frame_t 2014-12-28 20:39:11 -03:00
David Capello
da1358c5dc Unify all render code in one library
Changes:
* Create render library (move util/render.cpp to render/render.cpp)
* Move app::Zoom class to render::Zoom
* Remove doc::Image::merge() member function
* Add gfx::Clip helper class (to clip dst/src rectangles before a blit)
* Move doc::composite_image() to render::composite_image()
* Remove doc::Sprite::render()
* Replace Sprite::getPixel() with render::get_sprite_pixel()
* Remove doc::layer_render() function
* Convert DitheringMethod to a enum class
* Add AppRender to configure a render::Render with the app configuration
* Move checked background preferences as document-specific configuration
* Add doc::Sprite::layer() and palette() member functions
* Add doc::Layer::cel() member function
* Add doc::Palette::entry() member function()
* Add doc::frame_t type
* Move create_palette_from_rgb/convert_pixel_format to render library
* ExportSpriteSheet doesn't need a temporary image now that we can specify
  the source rectangle in the render routine
2014-12-28 11:06:11 -03:00
David Capello
65da03d181 Use an internal ImageBuffer inside Mask class 2014-12-13 19:43:14 -03:00
David Capello
f66b48c698 Change Mask member functions to use gfx::Rect instead of x,y,w,h args 2014-12-13 19:10:54 -03:00
David Capello
e79314d4e5 Critical fix in Image::clip_rects() 2014-12-09 11:53:57 -03:00
David Capello
afbd3b2d96 Optimize ToolLoop with modified regions of pixels
Here we avoid copying and clearing pixels that will not be used
in the whole tool loop process.
Changes:
* Add several member functions in ToolLoop to validate/invalidate regions
  of source/destination images so we know what regions are safe to use
  by inks and can be shown in the editor
* Add new DocumentObserver::onExposeSpritePixels() member to validate
  pixels that will be displayed in the editor
* Add Ink::needs/createSpecialSourceArea() member functions to validate
  extra areas for inks like blur or jumble
* Add undoers::ModifiedRegion to save the undo information about the
  modified region
* Add ShowHideDrawingCursor class
* Change "blur" tool policy from overlap to accumulate

(This is a real fix for issue #239)
2014-12-08 14:57:56 -03:00
David Capello
07c7756638 Add Brush::kMax/MinBrushSize constants 2014-12-07 20:50:26 -03:00
David Capello
5aea29348e Merge branch '1.0'
Conflicts:
	data/gui.xml
	src/app/CMakeLists.txt
	src/app/color_utils.cpp
	src/app/color_utils.h
	src/app/commands/cmd_preview.cpp
	src/app/document_exporter.cpp
	src/app/document_exporter.h
	src/app/ui/editor/standby_state.cpp
	src/config.h
	src/main/resources_win32.rc
2014-12-03 11:15:09 -03:00
David Capello
bc9f4b2c9b Don't load a file if it's already open on drop files event
This avoids to open a document two times on Mac OS X
from the command line (the file is loaded when we
process the command line, and by Finder, which send us
an application:openFile: message).
2014-11-30 21:06:29 -03:00
David Capello
adf08ac7df Merge branch '1.0'
Conflicts:
	src/app/commands/cmd_preview.cpp
	src/app/thumbnail_generator.cpp
	src/app/ui/editor/editor.h
	src/app/util/render.h
	src/raster/image_buffer.h
2014-11-27 23:40:14 -03:00
David Capello
17b0bee0ae Refactor: Use gfx::Point in several places instead of two x,y integers
Changes:
* Add doc::Sprite::bounds()
* Use gfx::Point to store the doc::Cel position
* Replace "int x, int y" with a "const gfx::Point&" param
* Fix Mask::intersect(const gfx::Rect&) and Mask::crop(const Image*)
2014-11-24 00:09:22 -03:00
David Capello
cc889f2b2f Minor refactor to doc::Layer flags 2014-11-16 23:03:30 -03:00
David Capello
9bcc552129 Add override modifier to getMemSize() in doc::Object's sub-classes 2014-11-16 21:32:18 -03:00
David Capello
acfe155b24 Merge branch '1.0'
Conflicts:
	src/app/color_picker.cpp
	src/raster/sprite.h
2014-11-16 18:59:30 -03:00
David Capello
aefdf2fd4b Merge branch '1.0'
Conflicts:
	src/app/document.cpp
2014-11-12 23:20:27 -03:00
David Capello
ae9e2d173b Deselect timeline range when we modify sprite selection
Fix a problem selecting one cel in the timeline, using Ctrl+A and then
Ctrl+C to copy the whole image area. (This indicates that the user want
to copy the cel content, not the timeline cel.)
2014-11-12 11:24:26 -03:00
David Capello
5e2cefe212 Merge branch '1.0'
Conflicts:
	src/app/commands/cmd_sprite_size.cpp
	src/app/document_exporter.cpp
2014-11-07 19:30:39 -03:00
David Capello
ce962f4999 Add more command line options to export or convert sprites
Added --save-as, --scale, --split-layers, and --import-layer command line
options.
2014-11-06 21:04:32 -03:00
David Capello
7615c22827 Merge branch '1.0'
Conflicts:
	src/app/color_utils.cpp
	src/app/tools/ink_processing.h
2014-11-02 22:38:14 -03:00
David Capello
39b8e034b5 Merge branch '1.0'
Conflicts:
	.gitmodules
	CMakeLists.txt
	src/CMakeLists.txt
	src/app/app.h
	src/app/app_menus.cpp
	src/app/commands/cmd_move_mask.cpp
	src/app/commands/cmd_rotate.cpp
	src/app/modules/gui.cpp
	src/doc/resize_image_tests.cpp
	src/ui/accelerator.cpp
	third_party/CMakeLists.txt
2014-10-30 01:06:27 -03:00
David Capello
adaab1af98 Fix #507 clang compilation error in layer_io.cpp 2014-10-22 10:53:22 -03:00
David Capello
63995c6f0a Merge "raster" namespace into "doc" library 2014-10-20 22:21:31 -03:00
David Capello
07497ec8e5 Use enum class for doc::ColorMode 2014-08-18 01:13:24 -03:00
David Capello
51ab478f49 Fix order of members initialization detected by clang 2014-08-17 20:38:55 -03:00
David Capello
6824570c4b Remove base/override.h (use override keyword directly) 2014-08-14 23:07:47 -03:00
David Capello
df3c16b802 Add more options to export sprite sheet (e.g. best fit for texture) 2014-08-11 11:33:17 -03:00
David Capello
dfaf097b88 Rename base/compiler_specific.h to base/override.h 2014-08-09 08:08:20 -03:00
David Capello
c104b4812d Add doc::Settings to get the undo limit (or other settings that will be in the logic/doc layer) 2014-07-31 00:19:58 -03:00
David Capello
91b0c2d071 Refactor: Remove "get" part for member functions that act like a simple getter
Additional change:
- Added Cel::image() to get the related image of the cel directly
2014-07-30 01:28:15 -03:00
David Capello
81ffb0c5bd Refactor: Create doc::Context and move some logic from app::Document to doc::Document
The objective of these changes is to create a more testable doc/logic API.

Included changes:
- Added doc::Context, doc::Documents (the old app::Documents),
  and doc::Sprites (and observers for each)
- Added raster::Sprite::createBasicSprite()
- Added doc::ColorMode (equal to raster::PixelFormat)
- Added some methods to doc::Document: context(), sprites(), sprite()
  (to replace app::Document::getSprite()), width/height(), colorMode(),
  name(), and close()
- Moved app::DocumentObserver/Event to doc::DocumentObserver/Event
- Replaced app::ContextObserver with doc::DocumentsObserver and a couple
  of signals.
- Renamed app::Context::getActiveDocument() with
  doc::Context::activeDocument()
- Renamed app::Context::getActiveLocation() with
  app::Context::activeLocation()
- Removed app::ContextObserverList
- Removed app::DocumentId (now we can use doc::ObjectId)
- Removed app::Context::getSettings()
2014-07-29 00:53:24 -03:00
David Capello
78ce233756 Fix header of files distributed under the terms of the MIT license 2014-03-29 20:08:05 -03:00
David Capello
f4b2b47a2c Add #pragma once 2014-03-29 19:40:17 -03:00
David Capello
b16bf981d0 Implement issue #265 - command/keyboard shortcut for "last export" operation
- Add doc::ExportData with information about the last export operation.
- Add RepeatLastExport command.
- Add SaveFileBaseCommand as base Command class, to accept "filename"
  param.
- Add parameters to ExportSpriteSheet so we can call it without UI
  from "repeat last export".
2014-03-29 16:58:35 -03:00
David Capello
2a70e750cd Add a basic model layer (doc-lib) 2014-03-12 19:25:09 -03:00