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).
The old impl was using get/put_pixel(), the new slow one is using the
get/put_pixel_fast(), and the new default flip_image() is using just
raw pointers.
Added some utilites like random_image() for testing purposes, and
DOC_DISPATCH_BY_COLOR_MODE() macros to avoid switch/case for each
color mode. In a future these might use generic lambdas.
This is the first commit with a simple tilemap editor. Still buggy but
functional in several ways. Several changes were made:
* NewLayer command can receive a tilemap=true to create a new tilemap
layer
* New ToggleTilesMode command added to switch between the palette and
the tileset in the ColorBar (the ColorBar was expanded to show
colors or tilesets with a generic AbstractPaletteViewAdapter)
* All commands to create new layers were moved to Layer >
New... submenu
* There are a new tileset chunk to save tilesets in .aseprite files,
and a new kind of cels to save tilemaps
* Added doc::LayerTilemap, doc::Tileset, etc. and several other types
to handle tilesets/tilemaps in the doc layer.
* Added doc::Grid class with grid specifications that indicates how a
tilemap <-> tileset must be drawn
* Added and expanded cel operations to work with tilemaps and
conversions between regular LayerImage cels <-> LayerTilemap cels
(e.g. copy cels in the timeline between layer types)
Improves the performance when we edit big images (shrink + crop +
image allocations are the performance issues we have when we're
editing big images).
The real solution for image allocations would be to change the
internal representation of images to a tile-based images with a cache
of tiles. But that is not planned in the short-term.
The purpose of this fix is enable drawing of one pixel with contour
tool is active and we drag the cursor inside of the same
pixel (https://community.aseprite.org/t/3509).
Added 3 tests in polygon_tests.cpp to test polygon function when the
expected results is a simple pixel.
The purpose of this fix is that createUnion handles situations
which union results in contiguous segment collapses.
Added some treatments of eventual illogical inputs arguments like:
- pairs.size() < ints
- ints is 1
- ints is a odd number
Fixed treatment of some union cases like:
- x == pairs[i+1] + 1
- x == pairs[i+1]
Simplification of some vector::insert execution.
Added a bool return type to know if the function was
successfully executed when is called (used in tests).
We change the “static void createUnion(…)” to
“bool algorithm::createUnion(…)” to conditioning it to
future tests.
Added some comments modifications.
Added tests to polygon_tests.cpp
Added special treatment in cases of horizontal lines which input
argument to createUnion is “ints == 0”. Conditionals were sorted, it
was being generate extra scan segment pair next to pair in analysis,
instead of an augmentation of it.
This fix is intended to create a polygon that matches with its preview
in one drawing step (needed when we want to draw with Contour or
Polygon tool with custom brushes with alpha content). Before this fix,
the polygon was being created in a first step, and then a second step
that patches the contour (over writing the Image with an extra
joinStroke execution of the entire contour).
- Added createUnion function in polygon.cpp to force drawing of the
input points in each scan line render.
- Added algo_line_continuous inside polygon function to interpolate
holes between input vertices.
- Deleted extra joinStroke execution in fillStroke function in class
IntertwineAsLines and class IntertwineAsPixelPerfect inside
intertwines.h
- Added Stroke::erase function to Stroke class. It is needed inside
IntertwineAsPixelPerfect class to get a clear m_pts (without the
extra points due to mini L shapes, due to pixel perfect process). In
fillStroke function in class IntertwineAsPixelPerfect inside
intertwiners.h, when it executed, m_pts is delivered to polygon
function instead of stroke argument in order to pass a pixel perfect
processed vector instead of stroke vector which is a raw vector of
vertices.