Hermet Park
b60a291edc
sw_engine: code refactoring
...
Removed the fake blender structure.
Unified matting and join as Surface methods.
2023-06-20 11:30:18 +09:00
Hermet Park
814d87626c
common engines: optimizing data packing for compactness.
...
Standardized the opacity data type to use 1 byte
across all instances to maintain consistency and reduce scattered usage.
2023-06-15 10:35:34 +09:00
Hermet Park
dbdf103e82
sw_engine texmap: code clean up.
...
eliminate logic duplication by introducing a c++ template mechanism.
This will retain the opacity condition branches to minimize binary size.
2023-06-05 16:52:57 +09:00
Hermet Park
fddc409728
common sw_engine: adds missing composite methods.
...
Now tvg user could combine Mask Alpha & Mask Method like this:
paint->composite(target, tvg::CompositeMethod::AddMask);
binary size diff: 201307 -> 223399 (+22kb)
@APIs:
- CompositeMethod::AddMask
- CompositeMethod::SubtractMask
- CompositeMethod::IntersectMask
- CompositeMethod::DifferenceMask
@Issue: https://github.com/thorvg/thorvg/issues/404
2023-06-03 15:50:48 +09:00
Hermet Park
9032c00347
sw_engine texmap: code optimization.
...
Unify textmap methods that are overly duplicated with each other.
Still trying to simplifying raster code so that thorvg could introduce
the a bunch of masking method code nicely.
This reduces the size like: 214773 -> 212843 (-2kb)
2023-05-31 18:07:57 +09:00
Hermet Park
ee9b947c0c
sw_engine: optimize alpha blending operation.
...
Compact blending instructions by distinquish the
shape & images. since we gurantee the shape color is
premultiplied alpha.
As a result, this enhanced performance by 0.002s in examples/Performance
on my local machine.
This also contains code cleanup chores.
2023-05-29 09:45:21 +09:00
Hermet Park
5643ecabd8
sw_engine: code refactoring
...
Introduced a blender alpha() to maintain clean and organized code.
2023-05-20 20:11:58 +09:00
Hermet Park
3376f44de5
sw_engine: ++8bit grayscale rasterizer.
...
These rasterizers are added for 8bit maskings.
2023-05-08 10:55:03 +09:00
Hermet Park
4893746eb2
sw_engine: code refactoring
...
use shorter name.
2023-05-08 10:55:03 +09:00
Hermet Park
da6216f9bf
sw_engine: specify buffer size so that we can clearly access the buffer data.
...
Also, it introduces the 'pixel_t' type to ensure that anonymous pixel data
follows the system's decision.
2023-05-08 10:55:03 +09:00
Hermet Park
84012651cc
common engine: code refactoring
...
Introduce the RenderMesh structure to reduce the number of required parameters.
2023-04-27 10:16:12 +09:00
Mira Grudzinska
f65d410b9f
sw_engine: fix safety check
...
An incorrect check introduced in bf07eb11f2
as a solution of the #1327 issue. As a consequence rotated images
were not drawn. Fixed.
2023-03-26 12:46:28 +09:00
Hermet Park
c9657e3e68
sw_engine - ++safety
...
Prevent any potential crash.
@Issues: https://github.com/thorvg/thorvg/issues/1327
2023-03-14 23:52:07 +09:00
Hermet Park
9b3c34c3b1
updated copyright.
2023-01-14 13:48:11 +09:00
Mira Grudzinska
1980d9d0e3
all: Trailing spaces removed
2023-01-07 10:53:51 +09:00
projectitis
3dd65dfed0
common picture: support image mesh feature
...
Tvg Picture newly provides mesh() api to support texture mapping.
These apis allows to have a coarse triangle list which have polygon coordinates
and texture uvs those are used for traditional polygon texture mapping.
Note that these apis are beta version.
@API Additions:
Result mesh(const Polygon* triangles, const uint32_t triangleCount) noexcept
uint32_t mesh(const Polygon** triangles) const noexcept
@Examples:
//Mapping with two polygons
Polygon polygon[2];
//First polygon
polygon[0].vertex[0].pt = {0, 0};
polygon[0].vertex[1].pt = {100, 0};
polygon[0].vertex[2].pt = {0, 100};
polygon[0].vertex[0].uv = {0, 0};
polygon[0].vertex[1].uv = {1, 0};
polygon[0].vertex[2].uv = {0, 1};
//Second polygon
polygon[1].vertex[0].pt = {100, 0};
polygon[1].vertex[1].pt = {100, 100};
polygon[1].vertex[2].pt = {0, 100};
polygon[1].vertex[0].uv = {1, 0};
polygon[1].vertex[1].uv = {1, 1};
polygon[1].vertex[2].uv = {0, 1};
//Apply polygons to the picture
picture->mesh(polygon, 2);
@Issues: https://github.com/Samsung/thorvg/issues/1218
2022-08-20 11:58:55 +09:00
Rémi Verschelde
46c3fc1f94
Format code files with dos2unix, ensure newline at EOF
2022-07-10 23:21:05 +09:00
Hermet Park
f0141e63de
updated copyright date.
2022-01-12 14:08:48 +09:00
Hermet Park
77d33b2d9f
sw_engine texmap: fix trivial compiler warnings.
...
warning: suggest braces around initialization of subobject [-Wmissing-braces]
2021-12-23 10:40:09 +09:00
Hermet Park
e258a2a662
sw_engine texmap: implemented fast span-edge anti-aliasing
...
This Anti-Aliasing mechanism is originated from Hermet Park's idea.
To understand this AA logic, you can refer this page:
www.hermet.pe.kr/122 (hermetpark@gmail.com )
@Issue: https://github.com/Samsung/thorvg/issues/161
2021-12-16 15:56:20 +09:00
Hermet Park
45132a7051
sw_engine raster: improve the transformed rle image rasterizer.
...
replace the transformed rle rgba image with the texmap raster.
this patch removes the several scattered transformed image rasterizer,
reuse the unified one texmap method instead.
yay, it's much clean and optimal.
2021-12-14 19:04:16 +09:00
Hermet Park
19aa102749
sw_engine raster: fix the texmap regression bug.
...
Wrong inline function with C-preprocessing doesn't work at all...
Correct them with including the separate files instead.
2021-11-26 17:41:33 +09:00
Hermet Park
eddaf615c3
sw_engine: code refactoring
...
unified the two color interpolate methods.
2021-11-25 20:04:37 +09:00
Hermet Park
2ca6f76d91
sw_engine texmap: code refactoring.
...
Unrolled the blending stages by applying macro magics.
I know this is a bit bad for code readibility
but good for the performance and the optimal LOC.
2021-11-25 18:51:04 +09:00
Hermet Park
aff755aeb5
sw_engine texmap: introduced texture mapping polygon drawing.
...
Introduced the texture-mapping algorithm for the image-scaler.
With this approach, we can support any arbitrary forms of the transformed shapes
while appling the scale factors - x/y separately.
Also this is more efficient when the transformed image is far from the rectangular form
because our current normal image rasterizer based on the given drawing region whereas
our new approach is span-based.
Thus, we applied this mechanism only for the transformed images.
2021-11-25 17:07:24 +09:00