Commit graph

115 commits

Author SHA1 Message Date
Hermet Park
16d5907642 sw_engine image: apply rgba blending.
rgba requires the default blending.
2021-11-23 15:22:28 +09:00
Hermet Park
1b7f5d952e sw_engine image: code refactoring
Clarify image sequences by renaming & adding TODO comments.
2021-11-23 12:56:05 +09:00
Hermet Park
06cef2a710 sw_engine image: introduced scaled image raster logics.
These raster functions are accelerated only for the scaled images.
(no rotation, skrewed)
2021-11-23 11:41:53 +09:00
Hermet Park
e195ac8b30 sw_engine image: code refactoring
+++
2021-11-19 13:22:32 +09:00
Hermet Park
93da844d94 sw_engine raster: clarify the internal function name.
"Solid" in this raster context is "Opaque" actually.
So remove the solid from it.
2021-11-19 13:12:40 +09:00
Hermet Park
491ea0ac07 sw_engine raster: remove the condition which is out of the genearal case. 2021-11-19 13:08:02 +09:00
Hermet Park
fa17214633 sw_engine raster: updated tvglog messages 2021-11-18 20:50:03 +09:00
Hermet Park
4f73719fac sw_engine raster: optimize the image raster
these solid images shouldn't apply the alpha blending...
2021-11-17 23:35:33 +09:00
Hermet Park
92f57a149f sw_engine raster: code refactoring
changed internal function names, keep the neat & clean thorvg style code.
2021-11-17 19:40:38 +09:00
Hermet Park
f9bc684699 sw_engine raster: code refactoring
clarfy & regroup the internal functions which have been messed up by rendering options.

no logical changes
2021-11-16 20:27:11 +09:00
Mira Grudzinska
3f82522f60 sw_engine: ialpha function pointer used instead of 255 - alpha 2021-11-16 20:14:31 +09:00
Hermet Park
c9377708a9 sw_engine image: ++optimization
apply fast track to fast up the image rasterization.

only shifted image doesn't need to have the matrix-transform computation,
we can avoid it by just shifting offset xy by simple caculating.

@Issue: https://github.com/Samsung/thorvg/issues/206
2021-11-15 17:38:57 +09:00
Hermet Park
0fcdba8a4b common math: code refactoring
introduced mathZero(), mathEqual() for floating variables.
2021-11-15 17:10:54 +09:00
Mira Grudzinska
8362ddda74 sw_engine: avxRasterTranslucentRle implemented 2021-11-15 11:16:17 +09:00
Hermet Park
ae3dae8c55 sw_engine image: introduce the stride property for the image.
we are considering the larger space of the image buffer,
in this case stride info is necessary.
2021-11-12 10:49:36 +09:00
Hermet Park
91668143e1 sw_engine raster: code refactoring
remove duplicated logic.
2021-11-12 10:49:15 +09:00
Hermet Park
1527f70221 sw_engine raster: allow image interpolation by increasing tolerance.
current image interpolation method is a bit awkward,
because xy scale different scale factor is not allowed.

we must improve the algorithm,

but now considering floating point precision,
we allow the interpolation by less ratio floating fraction.
2021-11-12 10:47:30 +09:00
Hermet Park
6c4896b911 sw_engine raster: code refactoring.
keep the code clean & neat.
2021-11-11 14:39:02 +09:00
Mira Grudzinska
10e0d18d6e sw_engine: missing implementations added
Rastering functions for masked images that are not rectangular
(clipped) were implemented.
2021-11-11 12:25:13 +09:00
Hermet Park
d8262dd1f8 sw_engine raster: code refactoring
--remove parameter
2021-11-10 19:39:21 +09:00
Hermet Park
f9a7df7a10 sw_engine raster: code refactoring
unify several function paramters with one structure.
2021-11-10 19:29:09 +09:00
Hermet Park
205e463160 sw_engine raster: code refactoring
keep it neat & clean code with descriptions.
2021-11-10 18:26:31 +09:00
Hermet Park
d73ecc5524 sw_engine raster: code refactoring
renamed internal variables, no logical changes.
2021-11-10 17:34:27 +09:00
Hermet Park
cffc87e7b1 sw_engine raster: code refactoring.
keep the code thorvg convention.
2021-11-10 17:03:07 +09:00
Mira Grudzinska
8c4b679fb7 sw_engine: unification of mask and inv mask functions
The function pointers used to pass the proper blending method - mask
or inverse mask.
2021-11-10 13:07:57 +09:00
Hermet Park
b956b0a7e0 sw_engine raster: fix build break.
trivial mistake by cdf7019b19
2021-11-05 20:59:54 +09:00
Hermet Park
45f521618c sw_engine image: ++missing logs. 2021-11-05 17:43:08 +09:00
Hermet Park
cdf7019b19 sw_raster image: add error logs to notify issues. 2021-11-05 17:42:19 +09:00
Mira Grudzinska
7bc7ab83d0 sw_engine: functions supporting a masking of the clipped images are missing
To preserve the naming convention function '_rasterTranslucentImageRle'
is reanmed to '_translucentImageRle'. The '_rasterTranslucentImageRle'
function is though created - it checks the composition method and calls
the corresponding function. Missing functions are marked, but not implemented
(separate commit).
2021-11-05 17:36:25 +09:00
Hermet Park
c3a29bd648 common math: code refactoring
introduce common math functions to improve the reusability.
2021-11-04 17:11:27 +09:00
Mira Grudzinska
abc3b40a37 sw_engine: var/funct renaming
Changed names:
shape->rect -> shape->fastTrack
_factTrack -> _axisAlignedRect
2021-11-02 11:41:14 +09:00
Michal Maciola
479cea74cc common: Unmultiplicated colorspace
This patch introduces _STRAIGHT colorspaces (ABGR8888_STRAIGHT and
ARGB8888_STRAIGHT) whose colors are un-alpha-premultiplied. Unmultiplicated
colors are especially needed for wasm thorvg loader and svg2png / tvg2png.
Only C version now.

@issue: #791
2021-11-01 15:57:13 +09:00
Mira Grudzinska
8cfe4ef708 sw_engine: including gradient transformation into gradient preparation
The gradient transformation has to be taken into account as the last
step of the gradient preparation.
2021-10-25 19:31:38 +09:00
Mira Grudzinska
7b778cd878 sw_engine: proper linear gradient transformation
In the case of any shape transformation, the gradient fill
was not correct.
2021-10-25 19:31:38 +09:00
Mira Grudzinska
a16e91b441 all: fix compiler warnings
pow->powf and sqrt->sqrtf
2021-10-07 14:49:00 +09:00
JunsuChoi
56d31775ff
sw_engine Raster: Improving image quality in image scale down
An average value sampled based on adjacent pixels of the target pixel is used.
2021-09-23 14:39:58 +09:00
Mira Grudzinska
3a54c5e219 sw_engine: calling avxRasterTranslucentRect instead of its c version
For avx vector support the avxRasterTranslucentRect should be called
instead of cRasterTranslucentRect (mischanged in 01e1fec367).
2021-08-31 15:17:28 +02:00
Hermet Park
01e1fec367
sw_engine: code refactoring.
simplify neon code and fix the wrong range access.
2021-08-30 16:54:43 +09:00
Mira Grudzinska
54b328b1a9 sw_engine avx: addad ALPHA_BLEND and avxRasterTranslucentRect functions
Both functions implemented using 128-bit registers.
avxRasterTranslucentRect is around 5 times faster than cRasterTranslucentRect (i7-8700 CPU - Coffe Lake)
2021-08-28 15:55:50 +09:00
Michal Szczecinski
94a3e92fdd sw common: Added neon translucent rect API implementation.
Changes:
Added neonRasterTranslucentRect implementation. Rendering was tested on
32 lottie fiels. Without neon ~ 18.1 FPS was measured. With neon ~ 20.1
FPS was measured.
2021-08-24 18:44:08 +09:00
Hermet Park
0e98809f15 sw_engine raster: code refactoring.
Separate simd implementation by files to maintain them easier.

Now we have avx, c, neon version implementation base,
we can add implementations to them.
2021-08-05 10:58:48 +09:00
Michal Szczecinski
3ce0722ffd sw_engine common: Added neon alpha blending.
Changes:
- Prepare neon verison of ALPHA_BLEND API.
- Use ALPHA_BLEND_NEON in _translucentRle

Notes:
- _translucentRle with neon support reduces execution time of this
function ~ 300 % (measured on uint32_t 400 x 400 buffer).
- API was tested on ARMv7l device with GCC 9.2 based toolchain. Results
  on other devices could be different.
2021-08-04 18:49:55 +09:00
JunsuChoi
37453a2dfd
sw_engine Raster: Apply bilinear interpolation to images
* Apply bilinear interpolation to images

Apply bilinear interpolation when drawing images with transformation
If the mapped coordinate value is a floating point value,
bilinear interpolation is performed using adjacent pixel values.
Interpolation is not performed in cases when the color values to beinterpolated
are the same or scale down case.
2021-07-30 10:31:59 +09:00
Hermet Park
750d170978 sw_engine raster: remove inlining.
Reduce the binary size,

Leave it to the best choice by the complier.
2021-07-28 19:56:37 +09:00
Hermet Park
7e5311fb86 sw_engine: -- unused header 2021-07-27 23:36:54 +09:00
Hermet Park
e949883049 common log: use the log macro to replace the print method easier.
We can replace the system logger method by changing single line print source in common,
This also helps to remove the THORVG_LOG_ENABLED macro from each use-cases.

TVGLOG(): To print the hint & tip messages for users.
TVGERR(): To print the error message for debugging.

@Issues: https://github.com/Samsung/thorvg/issues/36
2021-07-23 21:17:01 +09:00
Michal Maciola
934a95777c
common: style fixes (#644) 2021-07-22 13:35:26 +02:00
Hermet Park
b13dec31cd common: code refactoring
unify tvg class identifiers
2021-07-19 20:12:14 +09:00
Mira Grudzinska
aeb10fafec sw_engine: refactoring of the radial gradient rle rastering function
The translucent rastering function is split into 3 other (instead of if/else statement).
An additional function is introduced to decide which one of the 3 should be called.
This refactoring is done to preserve the convention used for all other rastering functs.
2021-05-26 12:47:47 +09:00
Mira Grudzinska
c2d6fc4fdd sw_engine: refactoring of the radial gradient rect rastering function
The translucent rastering function is split into 3 other (instead of if/else statement).
An additional function is introduced to decide which one of the 3 should be called.
This refactoring is done to preserve the convention used for all other rastering functs.
2021-05-26 12:47:47 +09:00