Commit Graph

15 Commits

Author SHA1 Message Date
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 db21a17fba Add DST_OVER blend mode for grayscale color mode 2019-03-09 12:47:23 -03:00
Gaspar Capello f53544842c Fix non-normal blend modes when the backdrop is transparent (fix #1096) 2019-03-09 12:40:31 -03:00
David Capello 14ba0ab411 Add addition/subtract/divide blending modes
Changes:
* Added SeparatorInView() to add separators inside a ListBox or ComboBox.
* Added BlendModeItem() to represent each item in the blending modes
  ComboBox.
* Now a ComboBox can contain any kind of widgets as children (not just
  ListItem). This is required to add separators in the blending modes
  ComboBox.

Feature request:
https://community.aseprite.org/t/additive-blending-feature/121
2017-07-24 15:25:13 -03:00
David Capello c06ce39357 Remove rgba/graya_blender_normal() without opacity 2017-07-19 10:33:01 -03:00
David Capello fd408247cf Add some comments in rgba_blender_normal()
In this way we can see how we get the final blending formula which is
equivalent to Rc=(Sc*Sa + Bc*Ba*(1-Sa))/Ra
2017-07-18 23:33:54 -03:00
David Capello dd3ce20133 Minor changes in rgba_blender_normal() function 2017-07-18 17:05:33 -03:00
David Capello c23967b547 Fix soft light layer blending mode 2017-03-29 17:35:09 -03:00
David Capello cf380ab1a2 Fix selection feedback when we have foreground/background color w/alpha=0 (fix #1133) 2016-05-13 16:00:19 -03:00
David Capello 736f63132b Fix red/blue tint for black/white colors (fix #1125) 2016-05-10 13:19:16 -03:00
David Capello d4faf04946 Add a rgba_blender_normal() version without opacity
This can be used to speed up text rendering and rotation algorithm.
2016-03-22 18:40:47 -03:00
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 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