thorvg/src/examples
Hermet Park 52a7a257b2 tvg_format: newly introduced for tvg data compression.
By choosing compress option, tvg tries to compress the data to reduce the binary size.
Since the compression has the double-edges sword, we provides an option to users
to select it by their demand. Basically, compression is better than non-compression.

After profiling, we decided to use the encoder/decoder of Guilherme R. Lampert's.

Here is the profiling result:

test.tvg: 296037 -> 243411 (-17%)
tiger.tvg: 54568 -> 50622 (-7%)
image-embedded.tvg: 2282 -> 1231 (-46%)

@Issue: https://github.com/Samsung/thorvg/issues/639

About compression method:

Lempel–Ziv–Welch (LZW) encoder/decoder by Guilherme R. Lampert

This is the compression scheme used by the GIF image format and the Unix 'compress' tool.
Main differences from this implementation is that End Of Input (EOI) and Clear Codes (CC)
are not stored in the output and the max code length in bits is 12, vs 16 in compress.

EOI is simply detected by the end of the data stream, while CC happens if the
dictionary gets filled. Data is written/read from bit streams, which handle
byte-alignment for us in a transparent way.

The decoder relies on the hardcoded data layout produced by the encoder, since
no additional reconstruction data is added to the output, so they must match.
The nice thing about LZW is that we can reconstruct the dictionary directly from
the stream of codes generated by the encoder, so this avoids storing additional
headers in the bit stream.

The output code length is variable. It starts with the minimum number of bits
required to store the base byte-sized dictionary and automatically increases
as the dictionary gets larger (it starts at 9-bits and grows to 10-bits when
code 512 is added, then 11-bits when 1024 is added, and so on). If the dictionary
is filled (4096 items for a 12-bits dictionary), the whole thing is cleared and
the process starts over. This is the main reason why the encoder and the decoder
must match perfectly, since the lengths of the codes will not be specified with
the data itself.
2021-08-24 14:24:17 +09:00
..
images tvg_format: newly introduced for tvg data compression. 2021-08-24 14:24:17 +09:00
AnimateMasking.cpp examples: updated samples. 2021-06-10 20:00:55 +09:00
Arc.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
Async.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
Blending.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
Boundary.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
Capi.cpp updated copyright 2021-03-23 14:31:58 +09:00
ClipPath.cpp common sw_engine: optimize single rectangle ClipPath. 2021-03-26 17:10:35 +09:00
Common.h updated copyright 2021-03-23 14:31:58 +09:00
CustomTransform.cpp examples: revise examples 2021-06-10 16:08:00 +09:00
DirectUpdate.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
Duplicate.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
FillRule.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
GradientMasking.cpp gradients: paint linerar gradients properly with mask composition method 2021-03-31 20:38:16 +09:00
GradientStroke.cpp examples: revise examples 2021-06-10 16:08:00 +09:00
GradientTransform.cpp examples: revise examples 2021-06-10 16:08:00 +09:00
InvMasking.cpp examples: fix wrong data size conversion. 2021-05-01 12:49:23 +09:00
LinearGradient.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
Masking.cpp examples: fix wrong data size conversion. 2021-05-01 12:56:49 +09:00
meson.build example: add a sample for checking rendering performance. 2021-07-27 13:30:06 +09:00
MultiCanvas.cpp examples: replace sprintf() with snprintf() 2021-07-22 16:32:12 +09:00
MultiShapes.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
Opacity.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
Path.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
PathCopy.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
Performance.cpp example performance: improve to print average... 2021-07-27 23:32:49 +09:00
PictureJpg.cpp loaders: Pass mimetype to picture::load 2021-08-05 11:02:26 +09:00
PicturePng.cpp loaders: Pass mimetype to picture::load 2021-08-05 11:02:26 +09:00
PictureRaw.cpp examples: fix wrong data size conversion. 2021-05-01 12:56:49 +09:00
PictureTvg.cpp tvg_format: save/restore default view size in the data. 2021-07-29 15:51:00 +09:00
RadialGradient.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
Scene.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
SceneTransform.cpp examples: revise examples 2021-06-10 16:08:00 +09:00
Shape.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
Stacking.cpp examples: revise examples 2021-06-10 16:08:00 +09:00
Stress.cpp examples: replace sprintf() with snprintf() 2021-07-22 16:32:12 +09:00
Stroke.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
StrokeLine.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00
Svg.cpp examples: replace sprintf() with snprintf() 2021-07-22 16:32:12 +09:00
Svg2.cpp loaders: Pass mimetype to picture::load 2021-08-05 11:02:26 +09:00
Transform.cpp examples: revise examples 2021-06-10 16:08:00 +09:00
TvgSaver.cpp tvg_saver: introduce a new module tvg saver 2021-07-21 19:30:15 +09:00
Update.cpp examples: allow a desianted main thread capacity. 2021-03-24 14:19:01 +09:00