Commit Graph

474 Commits

Author SHA1 Message Date
Gaspar Capello
8eae7c00ae When eyedropper tool picks a pixel of mask color, the FG color changes to entry 0 (fix #2813) 2022-09-20 14:28:00 -03:00
David Capello
877b5e00a3 Add color_scales_tests 2022-08-30 14:14:06 -03:00
Gaspar Capello
bdcabdedf3 Add extended support to BMP files (fix #3277, fix #1495)
Before this addition, Aseprite supported following BMP formats:
- Size = 12 (OS/2 BMP 1.0)
- Size = 40 (Windows BMP v3)

Now extended support has been added to the BMP extension:
- Load BMP files with BMP header size:
  - Size = 12 (OS/2 BMP 1.0)
  - Size = 16 (OS/2 BMP 2.0 - size 16)
  - Size = 24 (OS/2 BMP 2.0 - size 24)
  - Size = 40 (Windows BMP v3)
  - Size = 52 (BITMAPV2INFOHEADER)
  - Size = 56 (BITMAPV3INFOHEADER)
  - Size = 60 (OS/2 BMP 2.0 - size 60)
  - Size = 64 (OS/2 BMP 2.0 - size 64)
  - Size = 108 (BITMAPV4INFOHEADER) at the moment colorimetry isn’t supported.
  - Size = 124 (BITMAPV5INFOHEADER) at the moment ICC profiles not supported.
- Load BMP with alpha channel.
- Load BMP 2bit color depth.
- Export BMP files with alpha channel (not palette based).
2022-08-30 13:34:32 -03:00
David Capello
8a7f6930d0 Fix minor memory leaks loading palettes using std::unique_ptrs 2022-08-23 15:08:01 -03:00
David Capello
2367c8526b Replace deprecated macro TYPED_TEST_CASE with TYPED_TEST_SUITE 2022-08-17 21:46:33 -03:00
Gaspar Capello
add1128248 Fix RotSprite transparency bug (fix #3444) 2022-08-08 10:37:32 -03:00
David Capello
52b1899e9d Fix crash Ctrl+clicking an ill-formed reference layer cel with width/height < 1.0
The width/height of a reference layer cel cannot be < 1.0, but in the
extreme case where this happens, Ctrl+clicking the reference layer
shouldn't crash the program.
2022-07-20 15:18:49 -03:00
David Capello
44bb1c4e48 Fix bug losing original image colors from custom brushes (fix #3375) 2022-07-15 10:05:50 -03:00
David Capello
9a3958278b Fix bug moving a cel, flattening all layers, and then undoing (fix #3416)
The m_boundsF position read from doc::read_celdata() was overwritting
the position of the cel when it was restored from the undo
information.
2022-07-11 10:24:43 -03:00
David Capello
62c052dd40 Use a std::unique_ptr for m_boundsF in doc::CelData 2022-07-11 10:21:38 -03:00
David Capello
daa7cc837a Minor change: Add const to some pointers in write_layer() 2022-07-07 16:10:51 -03:00
David Capello
4f2eae6b77 Use C++17 [[fallthrough]] if needed 2022-06-29 20:14:03 -03:00
David Capello
3d0b5d809c Fix bug in move_or_copy_palette_colors() accessing out-of-range index 2022-06-28 15:17:29 -03:00
David Capello
71d885d2a0 Replace base::clamp -> std::clamp as now we use C++17 2022-06-09 19:05:48 -03:00
David Capello
f886e85af9 Restore Reference Layer bounds correctly if we delete a cel & undo it (fix #3264) 2022-05-23 18:01:38 -03:00
David Capello
38fca8ed61 Don't use std::iterator<> as it's deprecated in C++17 2022-05-16 11:50:12 -03:00
David Capello
03e0bc26c9 Fix bug initializing auxiliary table for findBestfit() from multiple threads
This could happen if we generated thumbnails for GIF files from
multiple threads when showing the File > Open dialog for the first
time (calling findBestfit() from multiple threads).
2022-04-19 17:07:37 -03:00
David Capello
c5ee08e3b5 Add required include directory to use doc/dio/fixmath libraries
This is used for the fuzz project.
2022-03-04 23:53:43 -03:00
David Capello
2bb93247aa Fix modifying slice bounds before the 1st SliceKey frame (fix #3122)
This issue brought a lot of other related issues (like slice chunks
being saved incorrectly in .aseprite file, etc.). This is an
alternative fix to PR #3141 where a std::sort() was proposed.
2022-02-25 09:42:32 -03:00
David Capello
2100c45de2 Fix memory leaks when we use doc::Keyframes structure
Detected with LeakSanitizer on keyframes_tests but also reported in
PR #3141. We've finally solved this problem using std::unique_ptr.
2022-02-24 19:53:42 -03:00
David Capello
d16c34b247 Fix memory leaks in some tests found with LeakSanitizer 2022-02-24 19:43:22 -03:00
David Capello
d7ddb7feed Fix changing random values to transparent color for non-indexed sprite from cmd::SetPalette
Possible fix for #2970
Possible regression introduced in dd2d226264
2021-09-29 14:42:55 -03:00
Jeremy Behreandt
d14cf4038d Color Sort For Hue, Alpha
Removes switch case with fall through. Removes nested switch
cases. Refactors color sorting method to 1. push zero alpha colors to
the front of the palette; 2. resort to value as a criterion for gray
colors; 3. use saturation and value as back up comparisons for each
other for equivalent values; 4. approximate gamma-to-linear when
perceptual lightness is chosen.

Partial fix for #2901.
2021-08-30 15:33:53 -03:00
Joshua Ogunyinka
971ba32338 added support for loading/saving alpha channels in palette files 2021-08-30 10:57:20 -03:00
David Capello
c42c5e1453 Backport new laf API to main branch of aseprite
Some features from the beta branch of aseprite & laf were backported
to the main branch of aseprite.

Related commits:
- New memory handling (db4504e816)
- New get event with timeout (e6ec13cc31)
- Convert os::NativeCursor to an enum (06a5b4f3ae)
- Adapt code to the new os::Display -> os::Window refactor (5d31314cdb)
- Save/load main window layout correctly and limit to current workarea (d6acb9e20f)
- Redraw window immediately on "live resizing" (d0b39ebade)
2021-07-05 17:51:29 -03:00
Gaspar Capello
1eace24891 Improve aspect of ellipses for 16x16 or bigger sizes (fix #2217)
Now algo_ellipse() function supports additional parameters to create
rounded squares in the future.
2021-06-11 14:47:23 -03:00
David Capello
141bc434bf Fix bug undoing a Remap operation when several colors are removed from the palette 2021-05-20 19:43:18 -03:00
Gaspar Capello
b1203216be Fix crash when remap on palettes with more than 256 colors 2021-05-11 18:57:55 -03:00
David Capello
f3ab779bfd Don't transform hidden layers (fix #2680) 2021-04-08 11:24:55 -03:00
David Capello
4b1e4c67c5 Merge branch 'fix-2564' 2021-01-04 15:55:50 -03:00
David Capello
23559a9b44 Don't generate new slice keyframes when duplicating the sprite (duplicate only the slice keyframes)
Related to #2568
2021-01-04 15:52:56 -03:00
David Capello
85e51abcaa Minor changes about old "layer set" -> "layer group" 2020-11-27 19:26:18 -03:00
sumibi-yakitori
25ca9e4a13 Add duplicate slices 2020-11-23 16:41:14 +09:00
David Capello
b355f34a70 Export all groups (even collapsed ones) by default in JSON metadata (fix #2484) 2020-08-17 17:14:12 -03:00
David Capello
cd21d33fe7 Add missing #includes 2020-08-03 17:19:23 -03:00
David Capello
d75c9c443a Use LOG() with the printf-like interface (the only way to be thread safe) 2020-06-17 17:05:43 -03:00
David Capello
73ff0dc28c Fix exporting correct set of layers in JSON's meta.layers when -split-layers and -ignore-layer (fix #2432) 2020-06-10 12:55:26 -03:00
David Capello
0e47d0ec24 Minor changes in doc::ImageImpl to avoid using impl details in member functions 2020-06-10 09:58:55 -03:00
David Capello
b41f1ace30 Move function to convert doc::Image -> os::Surface to app/util 2020-06-09 19:56:25 -03:00
David Capello
3163d00e1e Avoid multi-line comment warning 2020-05-22 11:14:48 -03:00
David Capello
c6720b543a Move doc::rgba_to_graya_* functions from .h to .cpp 2020-05-21 20:07:23 -03:00
David Capello
3d2013b33c Draw mask boundaries with a gfx::Path
The path is also cached so on each re-paint we can re-use it while
it's still valid.
2020-05-18 17:58:22 -03:00
David Capello
d1843fcf55 Fix interpolation between stroke points with line brush (fix #728)
Related to #245, and there are still problems with gaps using new
dynamic angle parameters.
2020-04-23 11:30:36 -03:00
David Capello
3b370c2ff5 Minor formatting changes 2020-04-22 20:20:04 -03:00
David Capello
3c1ea2f407 Add/process dynamic data in/from stroke points (related to #710)
* Converted Stroke points from gfx::Point to Stroke::Pt
* Process gradient data to create shading betweens points or dithering
  with new doc::Brush patterns
2020-04-22 20:17:14 -03:00
David Capello
1f34d0e46e Add different formulas to convert RGB to Grayscale 2020-04-20 10:22:41 -03:00
David Capello
b628e21e76 Replace MIN/MAX() macros with std::min/max() functions 2020-04-08 12:20:53 -03:00
David Capello
86259a64fc Replace MID() macro with base::clamp() function
In the future we will replace base::clamp() with std::clamp().
2020-04-07 19:47:16 -03:00
David Capello
c1a62510a5 Fix crash clicking and deleting layers from timeline sequentially (and quickly
Reported in https://igarastudio.zendesk.com/agent/tickets/656
2020-04-07 10:40:56 -03:00
David Capello
c7b3e15d05 [lua] Fix crash using invalid width/height in Image() 2020-03-28 13:28:25 -03:00