Commit Graph

11 Commits

Author SHA1 Message Date
David Capello
8f7bf09263 Fix doc::blend_image() to support different color modes (fix #4530, fix #4531)
The code was refactored moving the BlenderHelper class from "render"
to "doc", and now doc::blend_image() supports blending different color
modes.

Some work is still needed to work with grayscale images correctly.
2024-06-11 21:48:57 -03:00
David Capello
ca8c970c5d Remove ';' chars from lua tests 2023-11-02 14:30:36 -03:00
Martín Capello
3cfa5ef1da [lua] Fix crash when saving tilemap's cel image (fix #4069) 2023-11-02 14:12:55 -03:00
David Capello
aeeef8e255 Add suppor for doc::Image row stride size > width size
This patch solves several problems introducing the possibility to
specify a row stride bigger than the width (visible pixels) on each
image row. Useful in case that we want to align the initial pixel
address of each row (if DOC_USE_ALIGNED_PIXELS is defined).

This allows us to use some SIMD intrinsics (e.g. SSE2) for some image
functions in the future (right now implemented only in the new
is_same_image_simd_templ() for is_same_image()).

Anyway to avoid breaking some existing code, by default we'll still
keep the old behavior: row stride bytes = width bytes (so
DOC_USE_ALIGNED_PIXELS is undefined).
2023-08-07 15:27:39 -03:00
David Capello
637d71a276 [lua] Test Image:flip() with sprite and without sprite (#3854) 2023-05-18 13:20:41 -03:00
Gaspar Capello
f3ed22e1a6 [lua] Add Image:flip() 2023-05-18 13:02:07 -03:00
Gaspar Capello
d4d18c99be [lua] Add Image:clear(Rectangle, color) overload (fix #3799)
We can use:

  Image:clear()
  Image:clear(color)
  Image:clear(rectangle)
  Image:clear(rectangle, color)

If the color is not specified it will be the transparent color of the
image.

Co-authored-by: David Capello <david@igara.com>
2023-04-12 15:30:12 -03:00
Gaspar Capello
637632eafb [lua] Add blend modes to Image:drawImage() 2023-03-27 20:31:58 -03:00
David Capello
8447a097c6 [lua] Add Image.id and Image.version getters 2022-12-26 17:20:27 -03:00
David Capello
914e14377c [lua] Add Image.bounds and Image:shrinkBounds() 2022-12-19 12:27:30 -03:00
David Capello
c7cafca69a Merge remote-tracking branch 'tests/main' 2022-10-25 15:30:38 -03:00