diff --git a/docs/Doxyfile b/docs/Doxyfile index 9f2892a5..2ff8f794 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -51,7 +51,7 @@ PROJECT_BRIEF = # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = /home/hermet/Projects/thorvg/docs/small_logo.svg +PROJECT_LOGO = small_logo.svg # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is diff --git a/docs/html/dir_bfccd401955b95cf8c75461437045ac0.html b/docs/html/dir_8af83c0dc83a45a35ca6968cdc29a7af.html similarity index 81% rename from docs/html/dir_bfccd401955b95cf8c75461437045ac0.html rename to docs/html/dir_8af83c0dc83a45a35ca6968cdc29a7af.html index a57ba2cc..5f5bfdc8 100644 --- a/docs/html/dir_bfccd401955b95cf8c75461437045ac0.html +++ b/docs/html/dir_8af83c0dc83a45a35ca6968cdc29a7af.html @@ -5,7 +5,7 @@ -ThorVG: /home/hermet/Projects/thorvg/inc Directory Reference +ThorVG: tmp Directory Reference @@ -64,12 +64,12 @@ $(function() {
-
inc Directory Reference
+
tmp Directory Reference
@@ -77,6 +77,9 @@ $(function() { Files + + +
file  thorvg.h [code]
 
file  thorvg_capi.h [code]
 The module provides C bindings for the ThorVG library. Please refer to src/examples/Capi.cpp to find the thorvg_capi usage examples.
 
diff --git a/docs/html/group__ThorVGCapi__Canvas.html b/docs/html/group__ThorVGCapi__Canvas.html new file mode 100644 index 00000000..fe22d394 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Canvas.html @@ -0,0 +1,592 @@ + + + + + + + +ThorVG: Canvas + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+Modules | +Functions
+
+
+
+
+ +

A module for managing and drawing graphical elements. +More...

+
+Collaboration diagram for Canvas:
+
+
+ + + + + +
+ + + + + +

+Modules

 SwCanvas
 A module for rendering the graphical elements using the software engine.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

TVG_EXPORT Tvg_Result tvg_canvas_destroy (Tvg_Canvas *canvas)
 Clears the canvas internal data, releases all paints stored by the canvas and destroys the canvas object itself. More...
 
TVG_EXPORT Tvg_Result tvg_canvas_push (Tvg_Canvas *canvas, Tvg_Paint *paint)
 Inserts a drawing element into the canvas using a Tvg_Paint object. More...
 
TVG_EXPORT Tvg_Result tvg_canvas_reserve (Tvg_Canvas *canvas, uint32_t n)
 Reserves a memory block where the objects pushed into a canvas are stored. More...
 
TVG_EXPORT Tvg_Result tvg_canvas_clear (Tvg_Canvas *canvas, bool free)
 Sets the total number of the paints pushed into the canvas to be zero. Tvg_Paint objects stored in the canvas are released if free is set to true, otherwise the memory is not deallocated and all paints should be released manually in order to avoid memory leaks. More...
 
TVG_EXPORT Tvg_Result tvg_canvas_update (Tvg_Canvas *canvas)
 Updates all paints in a canvas. More...
 
TVG_EXPORT Tvg_Result tvg_canvas_update_paint (Tvg_Canvas *canvas, Tvg_Paint *paint)
 Updates the given Tvg_Paint object from the canvas before the rendering. More...
 
TVG_EXPORT Tvg_Result tvg_canvas_draw (Tvg_Canvas *canvas)
 Requests the canvas to draw the Tvg_Paint objects. More...
 
TVG_EXPORT Tvg_Result tvg_canvas_sync (Tvg_Canvas *canvas)
 Guarantees that the drawing process is finished. More...
 
+

Detailed Description

+

A module for managing and drawing graphical elements.

+

A canvas is an entity responsible for drawing the target. It sets up the drawing engine and the buffer, which can be drawn on the screen. It also manages given Paint objects.

+
Note
A Canvas behavior depends on the raster engine though the final content of the buffer is expected to be identical.
+
Warning
The Paint objects belonging to one Canvas can't be shared among multiple Canvases.
+

Function Documentation

+ +

◆ tvg_canvas_clear()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_canvas_clear (Tvg_Canvascanvas,
bool free 
)
+
+ +

Sets the total number of the paints pushed into the canvas to be zero. Tvg_Paint objects stored in the canvas are released if free is set to true, otherwise the memory is not deallocated and all paints should be released manually in order to avoid memory leaks.

+
Parameters
+ + + +
[in]canvasThe Tvg_Canvas object to be cleared.
[in]freeIf true the memory occupied by paints is deallocated, otherwise it is not.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Canvas pointer.
TVG_RESULT_INSUFFICIENT_CONDITIONAn internal error.
+
+
+
Warning
Please use the free argument only when you know how it works, otherwise it's not recommended.
+
See also
tvg_canvas_destroy()
+ +
+
+ +

◆ tvg_canvas_destroy()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Result tvg_canvas_destroy (Tvg_Canvascanvas)
+
+ +

Clears the canvas internal data, releases all paints stored by the canvas and destroys the canvas object itself.

+
static Tvg_Canvas *canvas = NULL;
+
static uint32_t *buffer = NULL;
+
+
static void _init() {
+
canvas = tvg_swcanvas_create();
+
buffer = (uint32_t*) malloc(sizeof(uint32_t) * 100 * 100);
+
tvg_swcanvas_set_target(canvas, buffer, 100, 100, 100, TVG_COLORSPACE_ARGB8888);
+
}
+
+
//a task called from main function in a loop
+
static void _job(const int cmd) {
+
//define a valid rectangle shape
+
switch (cmd) {
+
case CMD_EXIT: return 0;
+
case CMD_ADD_RECT:
+
tvg_canvas_push(canvas, rect);
+
break;
+
case CMD_DEL_RECT:
+ +
//now to safely delete Tvg_Canvas, tvg_canvas_clear() API have to be used
+
break;
+
default:
+
break;
+
}
+
}
+
+
int main(int argc, char **argv) {
+
int cmd = 0;
+
int stop = 1;
+
+ +
+
while (stop) {
+
//wait for a command e.g. from a console
+
stop = _job(cmd);
+
}
+
tvg_canvas_clear(canvas, false);
+ + +
return 0;
+
}
+
+ + +
Parameters
+ + +
[in]canvasThe Tvg_Canvas object to be destroyed.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid pointer to the Tvg_Canvas object is passed.
+
+
+
Note
If the paints from the canvas should not be released, the tvg_canvas_clear() with a free argument value set to false should be called. Please be aware that in such a case TVG is not responsible for the paints release anymore and it has to be done manually in order to avoid memory leaks.
+
See also
tvg_paint_del(), tvg_canvas_clear()
+ +
+
+ +

◆ tvg_canvas_draw()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Result tvg_canvas_draw (Tvg_Canvascanvas)
+
+ +

Requests the canvas to draw the Tvg_Paint objects.

+

All paints from the given canvas will be rasterized to the buffer.

+
Parameters
+ + +
[in]canvasThe Tvg_Canvas object containing elements to be drawn.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Canvas pointer.
TVG_RESULT_INSUFFICIENT_CONDITIONAn internal error.
+
+
+
Note
Drawing can be asynchronous based on the assigned thread number. To guarantee the drawing is done, call tvg_canvas_sync() afterwards.
+
See also
tvg_canvas_sync()
+ +
+
+ +

◆ tvg_canvas_push()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_canvas_push (Tvg_Canvascanvas,
Tvg_Paintpaint 
)
+
+ +

Inserts a drawing element into the canvas using a Tvg_Paint object.

+
Parameters
+ + + +
[in]canvasThe Tvg_Canvas object managing the paint.
[in]paintThe Tvg_Paint object to be drawn.
+
+
+

Only the paints pushed into the canvas will be drawing targets. They are retained by the canvas until you call tvg_canvas_clear(). If you know the number of the pushed objects in advance, please call tvg_canvas_reserve().

+
Returns
Tvg_Result return values:
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTIn case a nullptr is passed as the argument.
TVG_RESULT_INSUFFICIENT_CONDITIONAn internal error.
+
+
+
Note
The rendering order of the paints is the same as the order as they were pushed. Consider sorting the paints before pushing them if you intend to use layering.
+
See also
tvg_canvas_reserve(), tvg_canvas_clear()
+ +
+
+ +

◆ tvg_canvas_reserve()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_canvas_reserve (Tvg_Canvascanvas,
uint32_t n 
)
+
+ +

Reserves a memory block where the objects pushed into a canvas are stored.

+

If the number of Tvg_Paints to be stored in a canvas is known in advance, calling this function reduces the multiple memory allocations thus improves the performance.

+
Tvg_Canvas *canvas = NULL;
+
+ + +
+
uint32_t *buffer = NULL;
+
buffer = (uint32_t*) malloc(sizeof(uint32_t) * 100 * 100);
+
if (!buffer) return;
+
+
tvg_swcanvas_set_target(canvas, buffer, 100, 100, 100, TVG_COLORSPACE_ARGB8888);
+
tvg_canvas_reserve(canvas, 100); //reserve array for 100 paints in canvas.
+
+ + +
Parameters
+ + + +
[in]canvasThe Tvg_Canvas object managing the reserved memory.
[in]nThe number of objects for which the memory is to be reserved.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Canvas pointer.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with memory allocation.
+
+
+ +
+
+ +

◆ tvg_canvas_sync()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Result tvg_canvas_sync (Tvg_Canvascanvas)
+
+ +

Guarantees that the drawing process is finished.

+

Since the canvas rendering can be performed asynchronously, it should be called after the tvg_canvas_draw().

+
Parameters
+ + +
[in]canvasThe Tvg_Canvas object containing elements which were drawn.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Canvas pointer.
TVG_RESULT_INSUFFICIENT_CONDITIONAn internal error.
+
+
+
See also
tvg_canvas_draw()
+ +
+
+ +

◆ tvg_canvas_update()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Result tvg_canvas_update (Tvg_Canvascanvas)
+
+ +

Updates all paints in a canvas.

+

Should be called before drawing in order to prepare paints for the rendering.

+
//A frame drawing example. Thread safety and events implementation is skipped to show only TVG code.
+
+
static Tvg_Canvas *canvas = NULL;
+
static Tvg_Paint *rect = NULL;
+
+
int _frame_render(void) {
+ +
tvg_canvas_draw(canvas);
+
tvg_canvas_sync(canvas);
+
}
+
+
//event handler from your code or third party library
+
void _event_handler(event *event_data) {
+
if (!event_data) return NULL;
+
switch(event_data.type) {
+
case EVENT_RECT_ADD:
+
if (!rect) {
+
tvg_shape_append_rect(rect, 10, 10, 50, 50, 0, 0);
+ +
tvg_shape_set_stroke_color(rect, 255, 0, 0, 255);
+
tvg_canvas_push(canvas, rect);
+
}
+
break;
+
case EVENT_RECT_MOVE:
+
if (rect) tvg_paint_translate(rect, 10.0, 10.0);
+
break;
+
default:
+
break;
+
}
+
}
+
+
int main(int argc, char **argv) {
+
//example handler from your code or third party lib
+
event_handler_add(handler, _event_handler);
+
+
//create frame rendering process which calls _frame_render() function.
+
app_loop_begin(_frame_render);
+
app_loop_finish();
+
cleanup();
+
}
+
Parameters
+ + +
[in]canvasThe Tvg_Canvas object to be updated.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Canvas pointer.
TVG_RESULT_INSUFFICIENT_CONDITIONAn internal error.
+
+
+
See also
tvg_canvas_update_paint()
+ +
+
+ +

◆ tvg_canvas_update_paint()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_canvas_update_paint (Tvg_Canvascanvas,
Tvg_Paintpaint 
)
+
+ +

Updates the given Tvg_Paint object from the canvas before the rendering.

+

If a client application using the TVG library does not update the entire canvas with tvg_canvas_update() in the frame rendering process, Tvg_Paint objects previously added to the canvas should be updated manually with this function.

+
Parameters
+ + + +
[in]canvasThe Tvg_Canvas object to which the paint belongs.
[in]paintThe Tvg_Paint object to be updated.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTIn case a nullptr is passed as the argument.
+
+
+
See also
tvg_canvas_update()
+ +
+
+
+
tvg_shape_append_rect
TVG_EXPORT Tvg_Result tvg_shape_append_rect(Tvg_Paint *paint, float x, float y, float w, float h, float rx, float ry)
Appends a rectangle to the path.
+
tvg_canvas_push
TVG_EXPORT Tvg_Result tvg_canvas_push(Tvg_Canvas *canvas, Tvg_Paint *paint)
Inserts a drawing element into the canvas using a Tvg_Paint object.
+
tvg_swcanvas_set_target
TVG_EXPORT Tvg_Result tvg_swcanvas_set_target(Tvg_Canvas *canvas, uint32_t *buffer, uint32_t stride, uint32_t w, uint32_t h, Tvg_Colorspace cs)
Sets the buffer used in the rasterization process and defines the used colorspace.
+
tvg_canvas_sync
TVG_EXPORT Tvg_Result tvg_canvas_sync(Tvg_Canvas *canvas)
Guarantees that the drawing process is finished.
+
tvg_canvas_clear
TVG_EXPORT Tvg_Result tvg_canvas_clear(Tvg_Canvas *canvas, bool free)
Sets the total number of the paints pushed into the canvas to be zero. Tvg_Paint objects stored in th...
+
TVG_ENGINE_SW
@ TVG_ENGINE_SW
CPU rasterizer.
Definition: thorvg_capi.h:84
+
tvg_paint_del
TVG_EXPORT Tvg_Result tvg_paint_del(Tvg_Paint *paint)
Releases the given Tvg_Paint object.
+
Tvg_Canvas
struct _Tvg_Canvas Tvg_Canvas
A structure responsible for managing and drawing graphical elements.
Definition: thorvg_capi.h:55
+
tvg_canvas_update
TVG_EXPORT Tvg_Result tvg_canvas_update(Tvg_Canvas *canvas)
Updates all paints in a canvas.
+
tvg_canvas_draw
TVG_EXPORT Tvg_Result tvg_canvas_draw(Tvg_Canvas *canvas)
Requests the canvas to draw the Tvg_Paint objects.
+
tvg_paint_translate
TVG_EXPORT Tvg_Result tvg_paint_translate(Tvg_Paint *paint, float x, float y)
Moves the given Tvg_Paint in a two-dimensional space.
+
tvg_swcanvas_create
TVG_EXPORT Tvg_Canvas * tvg_swcanvas_create()
Creates a Canvas object.
+
tvg_engine_init
TVG_EXPORT Tvg_Result tvg_engine_init(Tvg_Engine engine_method, unsigned threads)
Initializes TVG engines.
+
TVG_COLORSPACE_ARGB8888
@ TVG_COLORSPACE_ARGB8888
The 8-bit color channels are combined into 32-bit color in the order: alpha, red, green,...
Definition: thorvg_capi.h:332
+
Tvg_Paint
struct _Tvg_Paint Tvg_Paint
A structure representing a graphical element.
Definition: thorvg_capi.h:63
+
tvg_canvas_destroy
TVG_EXPORT Tvg_Result tvg_canvas_destroy(Tvg_Canvas *canvas)
Clears the canvas internal data, releases all paints stored by the canvas and destroys the canvas obj...
+
tvg_shape_set_stroke_width
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_width(Tvg_Paint *paint, float width)
Sets the stroke width for all of the figures from the paint.
+
tvg_shape_set_stroke_color
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_color(Tvg_Paint *paint, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Sets the shape's stroke color.
+
tvg_engine_term
TVG_EXPORT Tvg_Result tvg_engine_term(Tvg_Engine engine_method)
Terminates TVG engines.
+
tvg_canvas_reserve
TVG_EXPORT Tvg_Result tvg_canvas_reserve(Tvg_Canvas *canvas, uint32_t n)
Reserves a memory block where the objects pushed into a canvas are stored.
+ + + + diff --git a/docs/html/group__ThorVGCapi__Canvas.map b/docs/html/group__ThorVGCapi__Canvas.map new file mode 100644 index 00000000..4e8ee5d4 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Canvas.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/html/group__ThorVGCapi__Canvas.md5 b/docs/html/group__ThorVGCapi__Canvas.md5 new file mode 100644 index 00000000..571b4dd7 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Canvas.md5 @@ -0,0 +1 @@ +2e453c06c8f1182a1a0f31e1920ddb6b \ No newline at end of file diff --git a/docs/html/group__ThorVGCapi__Canvas.png b/docs/html/group__ThorVGCapi__Canvas.png new file mode 100644 index 00000000..3edb21a8 Binary files /dev/null and b/docs/html/group__ThorVGCapi__Canvas.png differ diff --git a/docs/html/group__ThorVGCapi__Gradient.html b/docs/html/group__ThorVGCapi__Gradient.html new file mode 100644 index 00000000..82d4a806 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Gradient.html @@ -0,0 +1,828 @@ + + + + + + + +ThorVG: Gradient + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+Classes | +Functions
+
+
Gradient
+
+
+ +

A module managing the gradient fill of objects. +More...

+
+Collaboration diagram for Gradient:
+
+
+ + + + +
+ + + + + +

+Classes

struct  Tvg_Color_Stop
 A data structure storing the information about the color and its relative position inside the gradient bounds. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

TVG_EXPORT Tvg_Gradienttvg_linear_gradient_new ()
 Creates a new linear gradient object. More...
 
TVG_EXPORT Tvg_Gradienttvg_radial_gradient_new ()
 Creates a new radial gradient object. More...
 
TVG_EXPORT Tvg_Result tvg_linear_gradient_set (Tvg_Gradient *grad, float x1, float y1, float x2, float y2)
 Sets the linear gradient bounds. More...
 
TVG_EXPORT Tvg_Result tvg_linear_gradient_get (Tvg_Gradient *grad, float *x1, float *y1, float *x2, float *y2)
 Gets the linear gradient bounds. More...
 
TVG_EXPORT Tvg_Result tvg_radial_gradient_set (Tvg_Gradient *grad, float cx, float cy, float radius)
 Sets the radial gradient bounds. More...
 
TVG_EXPORT Tvg_Result tvg_radial_gradient_get (Tvg_Gradient *grad, float *cx, float *cy, float *radius)
 The function gets radial gradient center point ant radius. More...
 
TVG_EXPORT Tvg_Result tvg_gradient_set_color_stops (Tvg_Gradient *grad, const Tvg_Color_Stop *color_stop, uint32_t cnt)
 Sets the parameters of the colors of the gradient and their position. More...
 
TVG_EXPORT Tvg_Result tvg_gradient_get_color_stops (const Tvg_Gradient *grad, const Tvg_Color_Stop **color_stop, uint32_t *cnt)
 Gets the parameters of the colors of the gradient, their position and number. More...
 
TVG_EXPORT Tvg_Result tvg_gradient_set_spread (Tvg_Gradient *grad, const Tvg_Stroke_Fill spread)
 Sets the Tvg_Stroke_Fill value, which specifies how to fill the area outside the gradient bounds. More...
 
TVG_EXPORT Tvg_Result tvg_gradient_get_spread (const Tvg_Gradient *grad, Tvg_Stroke_Fill *spread)
 Gets the FillSpread value of the gradient object. More...
 
TVG_EXPORT Tvg_Result tvg_gradient_set_transform (Tvg_Gradient *grad, const Tvg_Matrix *m)
 Sets the matrix of the affine transformation for the gradient object. (BETA_API) More...
 
TVG_EXPORT Tvg_Result tvg_gradient_get_transform (const Tvg_Gradient *grad, Tvg_Matrix *m)
 Gets the matrix of the affine transformation of the gradient object. (BETA_API) More...
 
TVG_EXPORT Tvg_Gradienttvg_gradient_duplicate (Tvg_Gradient *grad)
 Duplicates the given Tvg_Gradient object. More...
 
TVG_EXPORT Tvg_Result tvg_gradient_del (Tvg_Gradient *grad)
 Deletes the given gradient object. More...
 
+

Detailed Description

+

A module managing the gradient fill of objects.

+

The module enables to set and to get the gradient colors and their arrangement inside the gradient bounds, to specify the gradient bounds and the gradient behavior in case the area defined by the gradient bounds is smaller than the area to be filled.

+

Function Documentation

+ +

◆ tvg_gradient_del()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Result tvg_gradient_del (Tvg_Gradientgrad)
+
+ +

Deletes the given gradient object.

+
Parameters
+ + +
[in]gradThe gradient object to be deleted.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Gradient pointer.
+
+
+ +
+
+ +

◆ tvg_gradient_duplicate()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Gradient* tvg_gradient_duplicate (Tvg_Gradientgrad)
+
+ +

Duplicates the given Tvg_Gradient object.

+

Creates a new object and sets its all properties as in the original object.

+
Parameters
+ + +
[in]gradThe Tvg_Gradient object to be copied.
+
+
+
Returns
A copied Tvg_Gradient object if succeed, nullptr otherwise.
+ +
+
+ +

◆ tvg_gradient_get_color_stops()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_gradient_get_color_stops (const Tvg_Gradientgrad,
const Tvg_Color_Stop ** color_stop,
uint32_t * cnt 
)
+
+ +

Gets the parameters of the colors of the gradient, their position and number.

+

The function does not allocate any memory.

+
Parameters
+ + + + +
[in]gradThe Tvg_Gradient object of which to get the color information.
[out]color_stopAn array of Tvg_Color_Stop data structure.
[out]cntThe size of the color_stop array equal to the colors number used in the gradient.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr passed as the argument.
+
+
+ +
+
+ +

◆ tvg_gradient_get_spread()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_gradient_get_spread (const Tvg_Gradientgrad,
Tvg_Stroke_Fillspread 
)
+
+ +

Gets the FillSpread value of the gradient object.

+
Parameters
+ + + +
[in]gradThe Tvg_Gradient object.
[out]spreadThe FillSpread value.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr passed as the argument.
+
+
+ +
+
+ +

◆ tvg_gradient_get_transform()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_gradient_get_transform (const Tvg_Gradientgrad,
Tvg_Matrixm 
)
+
+ +

Gets the matrix of the affine transformation of the gradient object. (BETA_API)

+

In case no transformation was applied, the identity matrix is set.

+
Parameters
+ + + +
[in]gradThe Tvg_Gradient object of which to get the transformation matrix.
[out]mThe 3x3 augmented matrix.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr is passed as the argument.
+
+
+ +
+
+ +

◆ tvg_gradient_set_color_stops()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_gradient_set_color_stops (Tvg_Gradientgrad,
const Tvg_Color_Stopcolor_stop,
uint32_t cnt 
)
+
+ +

Sets the parameters of the colors of the gradient and their position.

+
Parameters
+ + + + +
[in]gradThe Tvg_Gradient object of which the color information is to be set.
[in]color_stopAn array of Tvg_Color_Stop data structure.
[in]cntThe size of the color_stop array equal to the colors number used in the gradient.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Gradient pointer.
+
+
+ +
+
+ +

◆ tvg_gradient_set_spread()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_gradient_set_spread (Tvg_Gradientgrad,
const Tvg_Stroke_Fill spread 
)
+
+ +

Sets the Tvg_Stroke_Fill value, which specifies how to fill the area outside the gradient bounds.

+
Parameters
+ + + +
[in]gradThe Tvg_Gradient object.
[in]spreadThe FillSpread value.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Gradient pointer.
+
+
+ +
+
+ +

◆ tvg_gradient_set_transform()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_gradient_set_transform (Tvg_Gradientgrad,
const Tvg_Matrixm 
)
+
+ +

Sets the matrix of the affine transformation for the gradient object. (BETA_API)

+

The augmented matrix of the transformation is expected to be given.

+
Parameters
+ + + +
[in]gradThe Tvg_Gradient object to be transformed.
[in]mThe 3x3 augmented matrix.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr is passed as the argument.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with a memory allocation.
+
+
+ +
+
+ +

◆ tvg_linear_gradient_get()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_linear_gradient_get (Tvg_Gradientgrad,
float * x1,
float * y1,
float * x2,
float * y2 
)
+
+ +

Gets the linear gradient bounds.

+

The bounds of the linear gradient are defined as a surface constrained by two parallel lines crossing the given points (x1, y1) and (x2, y2), respectively. Both lines are perpendicular to the line linking (x1, y1) and (x2, y2).

+
Parameters
+ + + + + + +
[in]gradThe Tvg_Gradient object of which to get the bounds.
[out]x1The horizontal coordinate of the first point used to determine the gradient bounds.
[out]y1The vertical coordinate of the first point used to determine the gradient bounds.
[out]x2The horizontal coordinate of the second point used to determine the gradient bounds.
[out]y2The vertical coordinate of the second point used to determine the gradient bounds.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Gradient pointer.
+
+
+ +
+
+ +

◆ tvg_linear_gradient_new()

+ +
+
+ + + + + + + +
TVG_EXPORT Tvg_Gradient* tvg_linear_gradient_new ()
+
+ +

Creates a new linear gradient object.

+
+
tvg_shape_append_rect(shape, 700, 700, 100, 100, 20, 20);
+ +
tvg_linear_gradient_set(grad, 700, 700, 800, 800);
+
Tvg_Color_Stop color_stops[2] =
+
{
+
{0.0, 0, 0, 0, 255},
+
{1.0, 0, 255, 0, 255},
+
};
+
tvg_gradient_set_color_stops(grad, color_stops, 2);
+ +
Returns
A new linear gradient object.
+ +
+
+ +

◆ tvg_linear_gradient_set()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_linear_gradient_set (Tvg_Gradientgrad,
float x1,
float y1,
float x2,
float y2 
)
+
+ +

Sets the linear gradient bounds.

+

The bounds of the linear gradient are defined as a surface constrained by two parallel lines crossing the given points (x1, y1) and (x2, y2), respectively. Both lines are perpendicular to the line linking (x1, y1) and (x2, y2).

+
Parameters
+ + + + + + +
[in]gradThe Tvg_Gradient object of which bounds are to be set.
[in]x1The horizontal coordinate of the first point used to determine the gradient bounds.
[in]y1The vertical coordinate of the first point used to determine the gradient bounds.
[in]x2The horizontal coordinate of the second point used to determine the gradient bounds.
[in]y2The vertical coordinate of the second point used to determine the gradient bounds.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Gradient pointer.
+
+
+
Note
In case the first and the second points are equal, an object filled with such a gradient fill is not rendered.
+ +
+
+ +

◆ tvg_radial_gradient_get()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_radial_gradient_get (Tvg_Gradientgrad,
float * cx,
float * cy,
float * radius 
)
+
+ +

The function gets radial gradient center point ant radius.

+
Parameters
+ + + + + +
[in]gradThe Tvg_Gradient object of which bounds are to be set.
[out]cxThe horizontal coordinate of the center of the bounding circle.
[out]cyThe vertical coordinate of the center of the bounding circle.
[out]radiusThe radius of the bounding circle.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Gradient pointer.
+
+
+ +
+
+ +

◆ tvg_radial_gradient_new()

+ +
+
+ + + + + + + +
TVG_EXPORT Tvg_Gradient* tvg_radial_gradient_new ()
+
+ +

Creates a new radial gradient object.

+
+
tvg_shape_append_rect(shape, 700, 700, 100, 100, 20, 20);
+ +
tvg_radial_gradient_set(grad, 550, 550, 50);
+
Tvg_Color_Stop color_stops[2] =
+
{
+
{0.0, 0, 0, 0, 255},
+
{1.0, 0, 255, 0, 255},
+
};
+
tvg_gradient_set_color_stops(grad, color_stops, 2);
+ +
Returns
A new radial gradient object.
+ +
+
+ +

◆ tvg_radial_gradient_set()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_radial_gradient_set (Tvg_Gradientgrad,
float cx,
float cy,
float radius 
)
+
+ +

Sets the radial gradient bounds.

+

The radial gradient bounds are defined as a circle centered in a given point (cx, cy) of a given radius.

+
Parameters
+ + + + + +
[in]gradThe Tvg_Gradient object of which bounds are to be set.
[in]cxThe horizontal coordinate of the center of the bounding circle.
[in]cyThe vertical coordinate of the center of the bounding circle.
[in]radiusThe radius of the bounding circle.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Gradient pointer or the radius value less than zero.
+
+
+ +
+
+
+
tvg_gradient_set_color_stops
TVG_EXPORT Tvg_Result tvg_gradient_set_color_stops(Tvg_Gradient *grad, const Tvg_Color_Stop *color_stop, uint32_t cnt)
Sets the parameters of the colors of the gradient and their position.
+
tvg_shape_append_rect
TVG_EXPORT Tvg_Result tvg_shape_append_rect(Tvg_Paint *paint, float x, float y, float w, float h, float rx, float ry)
Appends a rectangle to the path.
+
tvg_radial_gradient_new
TVG_EXPORT Tvg_Gradient * tvg_radial_gradient_new()
Creates a new radial gradient object.
+
tvg_shape_new
TVG_EXPORT Tvg_Paint * tvg_shape_new()
Creates a new shape object.
+
tvg_shape_set_linear_gradient
TVG_EXPORT Tvg_Result tvg_shape_set_linear_gradient(Tvg_Paint *paint, Tvg_Gradient *grad)
Sets the linear gradient fill for all of the figures from the path.
+
tvg_radial_gradient_set
TVG_EXPORT Tvg_Result tvg_radial_gradient_set(Tvg_Gradient *grad, float cx, float cy, float radius)
Sets the radial gradient bounds.
+
tvg_linear_gradient_set
TVG_EXPORT Tvg_Result tvg_linear_gradient_set(Tvg_Gradient *grad, float x1, float y1, float x2, float y2)
Sets the linear gradient bounds.
+
Tvg_Gradient
struct _Tvg_Gradient Tvg_Gradient
A structure representing a gradient fill of a Tvg_Paint object.
Definition: thorvg_capi.h:69
+
Tvg_Paint
struct _Tvg_Paint Tvg_Paint
A structure representing a graphical element.
Definition: thorvg_capi.h:63
+
tvg_linear_gradient_new
TVG_EXPORT Tvg_Gradient * tvg_linear_gradient_new()
Creates a new linear gradient object.
+
Tvg_Color_Stop
A data structure storing the information about the color and its relative position inside the gradien...
Definition: thorvg_capi.h:184
+
tvg_shape_set_radial_gradient
TVG_EXPORT Tvg_Result tvg_shape_set_radial_gradient(Tvg_Paint *paint, Tvg_Gradient *grad)
Sets the radial gradient fill for all of the figures from the path.
+ + + + diff --git a/docs/html/group__ThorVGCapi__Gradient.map b/docs/html/group__ThorVGCapi__Gradient.map new file mode 100644 index 00000000..0ed85924 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Gradient.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/html/group__ThorVGCapi__Gradient.md5 b/docs/html/group__ThorVGCapi__Gradient.md5 new file mode 100644 index 00000000..6121c04c --- /dev/null +++ b/docs/html/group__ThorVGCapi__Gradient.md5 @@ -0,0 +1 @@ +5ed575f53580b9f1f946616c4ddd91ad \ No newline at end of file diff --git a/docs/html/group__ThorVGCapi__Gradient.png b/docs/html/group__ThorVGCapi__Gradient.png new file mode 100644 index 00000000..bba14d3b Binary files /dev/null and b/docs/html/group__ThorVGCapi__Gradient.png differ diff --git a/docs/html/group__ThorVGCapi__Initializer.html b/docs/html/group__ThorVGCapi__Initializer.html new file mode 100644 index 00000000..b454f26b --- /dev/null +++ b/docs/html/group__ThorVGCapi__Initializer.html @@ -0,0 +1,247 @@ + + + + + + + +ThorVG: Initializer + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+Enumerations | +Functions
+
+
Initializer
+
+
+ +

A module enabling initialization and termination of the TVG engines. +More...

+
+Collaboration diagram for Initializer:
+
+
+ + + + +
+ + + + + +

+Enumerations

enum  Tvg_Engine { TVG_ENGINE_SW = (1 << 1), +TVG_ENGINE_GL = (1 << 2) + }
 Enumeration specifying the engine type used for the graphics backend. For multiple backends bitwise operation is allowed. More...
 
+ + + + + + + +

+Functions

TVG_EXPORT Tvg_Result tvg_engine_init (Tvg_Engine engine_method, unsigned threads)
 Initializes TVG engines. More...
 
TVG_EXPORT Tvg_Result tvg_engine_term (Tvg_Engine engine_method)
 Terminates TVG engines. More...
 
+

Detailed Description

+

A module enabling initialization and termination of the TVG engines.

+

Enumeration Type Documentation

+ +

◆ Tvg_Engine

+ +
+
+ + + + +
enum Tvg_Engine
+
+ +

Enumeration specifying the engine type used for the graphics backend. For multiple backends bitwise operation is allowed.

+ + + +
Enumerator
TVG_ENGINE_SW 

CPU rasterizer.

+
TVG_ENGINE_GL 

OpenGL rasterizer.

+
+ +
+
+

Function Documentation

+ +

◆ tvg_engine_init()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_engine_init (Tvg_Engine engine_method,
unsigned threads 
)
+
+ +

Initializes TVG engines.

+

TVG requires the running-engine environment. TVG runs its own task-scheduler for parallelizing rendering tasks efficiently. You can indicate the number of threads, the count of which is designated threads. In the initialization step, TVG will generate/spawn the threads as set by threads count.

+
tvg_engine_init(TVG_ENGINE_SW, 0); //Initialize software renderer and use the main thread only
+
Parameters
+ + + +
[in]engine_methodThe engine types to initialize. This is relative to the Canvas types, in which it will be used. For multiple backends bitwise operation is allowed.
    +
  • TVG_ENGINE_SW: CPU rasterizer
  • +
  • TVG_ENGINE_GL: OpenGL rasterizer (not supported yet)
  • +
+
[in]threadsThe number of additional threads used to perform rendering. Zero indicates only the main thread is to be used.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_FAILED_ALLOCATIONAn internal error possibly with memory allocation.
TVG_RESULT_INVALID_ARGUMENTUnknown engine type.
TVG_RESULT_NOT_SUPPORTEDUnsupported engine type.
TVG_RESULT_UNKNOWNOther error.
+
+
+
Note
The Initializer keeps track of the number of times it was called. Threads count is fixed at the first init() call.
+
See also
tvg_engine_term()
+
+Tvg_Engine
+ +
+
+ +

◆ tvg_engine_term()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Result tvg_engine_term (Tvg_Engine engine_method)
+
+ +

Terminates TVG engines.

+

It should be called in case of termination of the TVG client with the same engine types as were passed when tvg_engine_init() was called.

+
+
//define canvas and shapes, update shapes, general rendering calls
+ +
Parameters
+ + +
engine_methodThe engine types to terminate. This is relative to the Canvas types, in which it will be used. For multiple backends bitwise operation is allowed
    +
  • TVG_ENGINE_SW: CPU rasterizer
  • +
  • TVG_ENGINE_GL: OpenGL rasterizer (not supported yet)
  • +
+
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INSUFFICIENT_CONDITIONNothing to be terminated.
TVG_RESULT_INVALID_ARGUMENTUnknown engine type.
TVG_RESULT_NOT_SUPPORTEDUnsupported engine type.
TVG_RESULT_UNKNOWNAn internal error.
+
+
+
See also
tvg_engine_init()
+
+Tvg_Engine
+ +
+
+
+
TVG_ENGINE_SW
@ TVG_ENGINE_SW
CPU rasterizer.
Definition: thorvg_capi.h:84
+
tvg_engine_init
TVG_EXPORT Tvg_Result tvg_engine_init(Tvg_Engine engine_method, unsigned threads)
Initializes TVG engines.
+
tvg_engine_term
TVG_EXPORT Tvg_Result tvg_engine_term(Tvg_Engine engine_method)
Terminates TVG engines.
+ + + + diff --git a/docs/html/group__ThorVGCapi__Initializer.map b/docs/html/group__ThorVGCapi__Initializer.map new file mode 100644 index 00000000..b5252479 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Initializer.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/html/group__ThorVGCapi__Initializer.md5 b/docs/html/group__ThorVGCapi__Initializer.md5 new file mode 100644 index 00000000..99fb4900 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Initializer.md5 @@ -0,0 +1 @@ +a876f294b034ffcd3ac1c3151851ce1c \ No newline at end of file diff --git a/docs/html/group__ThorVGCapi__Initializer.png b/docs/html/group__ThorVGCapi__Initializer.png new file mode 100644 index 00000000..fbd96255 Binary files /dev/null and b/docs/html/group__ThorVGCapi__Initializer.png differ diff --git a/docs/html/group__ThorVGCapi__Paint.html b/docs/html/group__ThorVGCapi__Paint.html new file mode 100644 index 00000000..11294b35 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Paint.html @@ -0,0 +1,766 @@ + + + + + + + +ThorVG: Paint + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+Enumerations | +Functions
+
+
+
+
+ +

A module for managing graphical elements. It enables duplication, transformation and composition. +More...

+
+Collaboration diagram for Paint:
+
+
+ + + + +
+ + + + + +

+Enumerations

enum  Tvg_Composite_Method { TVG_COMPOSITE_METHOD_NONE = 0, +TVG_COMPOSITE_METHOD_CLIP_PATH, +TVG_COMPOSITE_METHOD_ALPHA_MASK, +TVG_COMPOSITE_METHOD_INVERSE_ALPHA_MASK + }
 Enumeration indicating the method used in the composition of two objects - the target and the source. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

TVG_EXPORT Tvg_Result tvg_paint_del (Tvg_Paint *paint)
 Releases the given Tvg_Paint object. More...
 
TVG_EXPORT Tvg_Result tvg_paint_scale (Tvg_Paint *paint, float factor)
 Scales the given Tvg_Paint object by the given factor. More...
 
TVG_EXPORT Tvg_Result tvg_paint_rotate (Tvg_Paint *paint, float degree)
 Rotates the given Tvg_Paint by the given angle. More...
 
TVG_EXPORT Tvg_Result tvg_paint_translate (Tvg_Paint *paint, float x, float y)
 Moves the given Tvg_Paint in a two-dimensional space. More...
 
TVG_EXPORT Tvg_Result tvg_paint_set_transform (Tvg_Paint *paint, const Tvg_Matrix *m)
 Transforms the given Tvg_Paint using the augmented transformation matrix. More...
 
TVG_EXPORT Tvg_Result tvg_paint_get_transform (Tvg_Paint *paint, Tvg_Matrix *m)
 Gets the matrix of the affine transformation of the given Tvg_Paint object. More...
 
TVG_EXPORT Tvg_Result tvg_paint_set_opacity (Tvg_Paint *paint, uint8_t opacity)
 Sets the opacity of the given Tvg_Paint. More...
 
TVG_EXPORT Tvg_Result tvg_paint_get_opacity (const Tvg_Paint *paint, uint8_t *opacity)
 Gets the opacity of the given Tvg_Paint. More...
 
TVG_EXPORT Tvg_Painttvg_paint_duplicate (Tvg_Paint *paint)
 Duplicates the given Tvg_Paint object. More...
 
TVG_EXPORT Tvg_Result tvg_paint_get_bounds (const Tvg_Paint *paint, float *x, float *y, float *w, float *h, bool transformed)
 Gets the axis-aligned bounding box of the Tvg_Paint object. (BETA_API) More...
 
TVG_EXPORT Tvg_Result tvg_paint_set_composite_method (Tvg_Paint *paint, Tvg_Paint *target, Tvg_Composite_Method method)
 Sets the composition target object and the composition method. More...
 
TVG_EXPORT Tvg_Result tvg_paint_get_composite_method (const Tvg_Paint *paint, const Tvg_Paint **target, Tvg_Composite_Method *method)
 Gets the composition target object and the composition method. More...
 
+

Detailed Description

+

A module for managing graphical elements. It enables duplication, transformation and composition.

+

Enumeration Type Documentation

+ +

◆ Tvg_Composite_Method

+ +
+
+ + + + +
enum Tvg_Composite_Method
+
+ +

Enumeration indicating the method used in the composition of two objects - the target and the source.

+ + + + + +
Enumerator
TVG_COMPOSITE_METHOD_NONE 

No composition is applied.

+
TVG_COMPOSITE_METHOD_CLIP_PATH 

The intersection of the source and the target is determined and only the resulting pixels from the source are rendered.

+
TVG_COMPOSITE_METHOD_ALPHA_MASK 

The pixels of the source and the target are alpha blended. As a result, only the part of the source, which intersects with the target is visible.

+
TVG_COMPOSITE_METHOD_INVERSE_ALPHA_MASK 

The pixels of the source and the complement to the target's pixels are alpha blended. As a result, only the part of the source which is not covered by the target is visible.

+
+ +
+
+

Function Documentation

+ +

◆ tvg_paint_del()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Result tvg_paint_del (Tvg_Paintpaint)
+
+ +

Releases the given Tvg_Paint object.

+
//example of cleanup function
+
Tvg_Paint *rect = NULL; //rectangle shape added in other function
+
+
//rectangle delete API
+
int rectangle_delete(void) {
+
if (rect) tvg_paint_del(rect);
+
rect = NULL;
+
}
+
+
int cleanup(void) {
+
tvg_canvas_clear(canvas, false);
+ +
canvas = NULL;
+
}
+
Parameters
+ + +
[in]paintThe Tvg_Paint object to be released.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+
Warning
If this function is used, tvg_canvas_clear() with the free argument value set to false should be used in order to avoid unexpected behaviours.
+
See also
tvg_canvas_clear(), tvg_canvas_destroy()
+ +
+
+ +

◆ tvg_paint_duplicate()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Paint* tvg_paint_duplicate (Tvg_Paintpaint)
+
+ +

Duplicates the given Tvg_Paint object.

+

Creates a new object and sets its all properties as in the original object.

+
Parameters
+ + +
[in]paintThe Tvg_Paint object to be copied.
+
+
+
Returns
A copied Tvg_Paint object if succeed, nullptr otherwise.
+ +
+
+ +

◆ tvg_paint_get_bounds()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_paint_get_bounds (const Tvg_Paintpaint,
float * x,
float * y,
float * w,
float * h,
bool transformed 
)
+
+ +

Gets the axis-aligned bounding box of the Tvg_Paint object. (BETA_API)

+
Parameters
+ + + + + + + +
[in]paintThe Tvg_Paint object of which to get the bounds.
[out]xThe x coordinate of the upper left corner of the object.
[out]yThe y coordinate of the upper left corner of the object.
[out]wThe width of the object.
[out]hThe height of the object.
[in]transformedIf true, the transformation of the paint is taken into account, otherwise it isn't.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_INSUFFICIENT_CONDITIONOther errors.
+
+
+
Note
The bounding box doesn't indicate the actual drawing region. It's the smallest rectangle that encloses the object.
+ +
+
+ +

◆ tvg_paint_get_composite_method()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_paint_get_composite_method (const Tvg_Paintpaint,
const Tvg_Paint ** target,
Tvg_Composite_Methodmethod 
)
+
+ +

Gets the composition target object and the composition method.

+
Parameters
+ + + + +
[in]paintThe source object of the composition.
[out]targetThe target object of the composition.
[out]methodThe method used to composite the source object with the target.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr is passed as the argument.
+
+
+ +
+
+ +

◆ tvg_paint_get_opacity()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_paint_get_opacity (const Tvg_Paintpaint,
uint8_t * opacity 
)
+
+ +

Gets the opacity of the given Tvg_Paint.

+
Parameters
+ + + +
[in]paintThe Tvg_Paint object of which to get the opacity value.
[out]opacityThe opacity value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTIn case a nullptr is passed as the argument.
+
+
+ +
+
+ +

◆ tvg_paint_get_transform()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_paint_get_transform (Tvg_Paintpaint,
Tvg_Matrixm 
)
+
+ +

Gets the matrix of the affine transformation of the given Tvg_Paint object.

+

In case no transformation was applied, the identity matrix is returned.

+
Parameters
+ + + +
[in]paintThe Tvg_Paint object of which to get the transformation matrix.
[out]mThe 3x3 augmented matrix.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr is passed as the argument.
+
+
+ +
+
+ +

◆ tvg_paint_rotate()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_paint_rotate (Tvg_Paintpaint,
float degree 
)
+
+ +

Rotates the given Tvg_Paint by the given angle.

+

The angle in measured clockwise from the horizontal axis. The rotational axis passes through the point on the object with zero coordinates.

+
Parameters
+ + + +
[in]paintThe Tvg_Paint object to be rotated.
[in]degreeThe value of the rotation angle in degrees.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with memory allocation.
+
+
+ +
+
+ +

◆ tvg_paint_scale()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_paint_scale (Tvg_Paintpaint,
float factor 
)
+
+ +

Scales the given Tvg_Paint object by the given factor.

+
Parameters
+ + + +
[in]paintThe Tvg_Paint object to be scaled.
[in]factorThe value of the scaling factor. The default value is 1.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with memory allocation.
+
+
+ +
+
+ +

◆ tvg_paint_set_composite_method()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_paint_set_composite_method (Tvg_Paintpaint,
Tvg_Painttarget,
Tvg_Composite_Method method 
)
+
+ +

Sets the composition target object and the composition method.

+
Parameters
+ + + + +
[in]paintThe source object of the composition.
[in]targetThe target object of the composition.
[in]methodThe method used to composite the source object with the target.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid paint or target object or the method equal to TVG_COMPOSITE_METHOD_NONE.
+
+
+ +
+
+ +

◆ tvg_paint_set_opacity()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_paint_set_opacity (Tvg_Paintpaint,
uint8_t opacity 
)
+
+ +

Sets the opacity of the given Tvg_Paint.

+
Parameters
+ + + +
[in]paintThe Tvg_Paint object of which the opacity value is to be set.
[in]opacityThe opacity value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+
Note
Setting the opacity with this API may require multiple renderings using a composition. It is recommended to avoid changing the opacity if possible.
+ +
+
+ +

◆ tvg_paint_set_transform()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_paint_set_transform (Tvg_Paintpaint,
const Tvg_Matrixm 
)
+
+ +

Transforms the given Tvg_Paint using the augmented transformation matrix.

+

The augmented matrix of the transformation is expected to be given.

+
Parameters
+ + + +
[in]paintThe Tvg_Paint object to be transformed.
[in]mThe 3x3 augmented matrix.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr is passed as the argument.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with memory allocation.
+
+
+ +
+
+ +

◆ tvg_paint_translate()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_paint_translate (Tvg_Paintpaint,
float x,
float y 
)
+
+ +

Moves the given Tvg_Paint in a two-dimensional space.

+

The origin of the coordinate system is in the upper left corner of the canvas. The horizontal and vertical axes point to the right and down, respectively.

+
Parameters
+ + + + +
[in]paintThe Tvg_Paint object to be shifted.
[in]xThe value of the horizontal shift.
[in]yThe value of the vertical shift.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with memory allocation.
+
+
+ +
+
+
+
tvg_canvas_clear
TVG_EXPORT Tvg_Result tvg_canvas_clear(Tvg_Canvas *canvas, bool free)
Sets the total number of the paints pushed into the canvas to be zero. Tvg_Paint objects stored in th...
+
tvg_paint_del
TVG_EXPORT Tvg_Result tvg_paint_del(Tvg_Paint *paint)
Releases the given Tvg_Paint object.
+
Tvg_Paint
struct _Tvg_Paint Tvg_Paint
A structure representing a graphical element.
Definition: thorvg_capi.h:63
+
tvg_canvas_destroy
TVG_EXPORT Tvg_Result tvg_canvas_destroy(Tvg_Canvas *canvas)
Clears the canvas internal data, releases all paints stored by the canvas and destroys the canvas obj...
+ + + + diff --git a/docs/html/group__ThorVGCapi__Paint.map b/docs/html/group__ThorVGCapi__Paint.map new file mode 100644 index 00000000..bc55c329 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Paint.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/html/group__ThorVGCapi__Paint.md5 b/docs/html/group__ThorVGCapi__Paint.md5 new file mode 100644 index 00000000..48058f6c --- /dev/null +++ b/docs/html/group__ThorVGCapi__Paint.md5 @@ -0,0 +1 @@ +d092f8ef507280d8786e14a192d9463a \ No newline at end of file diff --git a/docs/html/group__ThorVGCapi__Paint.png b/docs/html/group__ThorVGCapi__Paint.png new file mode 100644 index 00000000..6745289c Binary files /dev/null and b/docs/html/group__ThorVGCapi__Paint.png differ diff --git a/docs/html/group__ThorVGCapi__Picture.html b/docs/html/group__ThorVGCapi__Picture.html new file mode 100644 index 00000000..8799762b --- /dev/null +++ b/docs/html/group__ThorVGCapi__Picture.html @@ -0,0 +1,467 @@ + + + + + + + +ThorVG: Picture + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+Functions
+
+
+
+
+ +

A module enabling to create and to load an image in one of the supported formats: svg, png, jpg and raw. +More...

+
+Collaboration diagram for Picture:
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +

+Functions

TVG_EXPORT Tvg_Painttvg_picture_new ()
 Creates a new picture object. More...
 
TVG_EXPORT Tvg_Result tvg_picture_load (Tvg_Paint *paint, const char *path)
 Loads a picture data directly from a file. More...
 
TVG_EXPORT Tvg_Result tvg_picture_load_raw (Tvg_Paint *paint, uint32_t *data, uint32_t w, uint32_t h, bool copy)
 Loads a picture data from a memory block of a given size. (BETA_API) More...
 
TVG_EXPORT Tvg_Result tvg_picture_load_data (Tvg_Paint *paint, const char *data, uint32_t size, const char *mimetype, bool copy)
 Loads a picture data from a memory block of a given size. More...
 
TVG_EXPORT Tvg_Result tvg_picture_set_size (Tvg_Paint *paint, float w, float h)
 Resizes the picture content to the given width and height. More...
 
TVG_EXPORT Tvg_Result tvg_picture_get_size (const Tvg_Paint *paint, float *w, float *h)
 Gets the size of the loaded picture. More...
 
TVG_EXPORT Tvg_Result tvg_picture_get_viewbox (const Tvg_Paint *paint, float *x, float *y, float *w, float *h)
 Gets the position and the size of the loaded picture. (BETA_API) More...
 
+

Detailed Description

+

A module enabling to create and to load an image in one of the supported formats: svg, png, jpg and raw.

+

Function Documentation

+ +

◆ tvg_picture_get_size()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_picture_get_size (const Tvg_Paintpaint,
float * w,
float * h 
)
+
+ +

Gets the size of the loaded picture.

+
Parameters
+ + + +
[out]wA width of the image in pixels.
[out]hA height of the image in pixels.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+ +
+
+ +

◆ tvg_picture_get_viewbox()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_picture_get_viewbox (const Tvg_Paintpaint,
float * x,
float * y,
float * w,
float * h 
)
+
+ +

Gets the position and the size of the loaded picture. (BETA_API)

+
Warning
Please do not use it, this API is not official one. It can be modified in the next version.
+ +
+
+ +

◆ tvg_picture_load()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_picture_load (Tvg_Paintpaint,
const char * path 
)
+
+ +

Loads a picture data directly from a file.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the picture object.
[in]pathThe absolute path to the image file.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer or an empty path.
TVG_RESULT_NOT_SUPPORTEDA file with an unknown extension.
TVG_RESULT_UNKNOWNAn error at a later stage.
+
+
+ +
+
+ +

◆ tvg_picture_load_data()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_picture_load_data (Tvg_Paintpaint,
const char * data,
uint32_t size,
const char * mimetype,
bool copy 
)
+
+ +

Loads a picture data from a memory block of a given size.

+
Parameters
+ + + + + + +
[in]paintA Tvg_Paint pointer to the picture object.
[in]dataA pointer to a memory location where the content of the picture file is stored.
[in]sizeThe size in bytes of the memory occupied by the data.
[in]mimetypeMimetype or extension of data such as "jpg", "jpeg", "svg", "svg+xml", "png", etc. In case an empty string or an unknown type is provided, the loaders will be tried one by one.
[in]copyIf true the data are copied into the engine local buffer, otherwise they are not.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTIn case a nullptr is passed as the argument or the size is zero or less.
TVG_RESULT_NOT_SUPPORTEDA file with an unknown extension.
TVG_RESULT_UNKNOWNAn error at a later stage.
+
+
+
Warning
: It's the user responsibility to release the data memory if the copy is true.
+ +
+
+ +

◆ tvg_picture_load_raw()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_picture_load_raw (Tvg_Paintpaint,
uint32_t * data,
uint32_t w,
uint32_t h,
bool copy 
)
+
+ +

Loads a picture data from a memory block of a given size. (BETA_API)

+
Returns
Tvg_Result return value
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_PARAMETERSAn invalid Tvg_Paint.
+
+
+
Warning
Please do not use it, this API is not official one. It can be modified in the next version.
+ +
+
+ +

◆ tvg_picture_new()

+ +
+
+ + + + + + + +
TVG_EXPORT Tvg_Paint* tvg_picture_new ()
+
+ +

Creates a new picture object.

+
Returns
A new picture object.
+ +
+
+ +

◆ tvg_picture_set_size()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_picture_set_size (Tvg_Paintpaint,
float w,
float h 
)
+
+ +

Resizes the picture content to the given width and height.

+

The picture content is resized while keeping the default size aspect ratio. The scaling factor is established for each of dimensions and the smaller value is applied to both of them.

+
Parameters
+ + + +
[in]wA new width of the image in pixels.
[in]hA new height of the image in pixels.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_INSUFFICIENT_CONDITIONAn internal error.
+
+
+ +
+
+
+ + + + diff --git a/docs/html/group__ThorVGCapi__Picture.map b/docs/html/group__ThorVGCapi__Picture.map new file mode 100644 index 00000000..c299ca9c --- /dev/null +++ b/docs/html/group__ThorVGCapi__Picture.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/html/group__ThorVGCapi__Picture.md5 b/docs/html/group__ThorVGCapi__Picture.md5 new file mode 100644 index 00000000..8b852d1a --- /dev/null +++ b/docs/html/group__ThorVGCapi__Picture.md5 @@ -0,0 +1 @@ +f09123103b2bf98dfd86cfeed319f431 \ No newline at end of file diff --git a/docs/html/group__ThorVGCapi__Picture.png b/docs/html/group__ThorVGCapi__Picture.png new file mode 100644 index 00000000..d6eda2fe Binary files /dev/null and b/docs/html/group__ThorVGCapi__Picture.png differ diff --git a/docs/html/group__ThorVGCapi__Saver.html b/docs/html/group__ThorVGCapi__Saver.html new file mode 100644 index 00000000..8fa63bf5 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Saver.html @@ -0,0 +1,271 @@ + + + + + + + +ThorVG: Saver + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+Functions
+
+
+
+
+ +

A module for exporting a paint object into a specified file. +More...

+
+Collaboration diagram for Saver:
+
+
+ + + + +
+ + + + + + + + + + + + + + +

+Functions

TVG_EXPORT Tvg_Savertvg_saver_new ()
 Creates a new Tvg_Saver object. More...
 
TVG_EXPORT Tvg_Result tvg_saver_save (Tvg_Saver *saver, Tvg_Paint *paint, const char *path, bool compress)
 Exports the given paint data to the given path. More...
 
TVG_EXPORT Tvg_Result tvg_saver_sync (Tvg_Saver *saver)
 Guarantees that the saving task is finished. More...
 
TVG_EXPORT Tvg_Result tvg_saver_del (Tvg_Saver *saver)
 Deletes the given Tvg_Saver object. More...
 
+

Detailed Description

+

A module for exporting a paint object into a specified file.

+

The module enables to save the composed scene and/or image from a paint object. Once it's successfully exported to a file, it can be recreated using the Picture module.

+

Function Documentation

+ +

◆ tvg_saver_del()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Result tvg_saver_del (Tvg_Saversaver)
+
+ +

Deletes the given Tvg_Saver object.

+
Parameters
+ + +
[in]saverThe Tvg_Saver object to be deleted.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Saver pointer.
+
+
+ +
+
+ +

◆ tvg_saver_new()

+ +
+
+ + + + + + + +
TVG_EXPORT Tvg_Saver* tvg_saver_new ()
+
+ +

Creates a new Tvg_Saver object.

+
Returns
A new Tvg_Saver object.
+ +
+
+ +

◆ tvg_saver_save()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_saver_save (Tvg_Saversaver,
Tvg_Paintpaint,
const char * path,
bool compress 
)
+
+ +

Exports the given paint data to the given path.

+

If the saver module supports any compression mechanism, it will optimize the data size. This might affect the encoding/decoding time in some cases. You can turn off the compression if you wish to optimize for speed.

+
Parameters
+ + + + + +
[in]saverThe Tvg_Saver object connected with the saving task.
[in]paintThe paint to be saved with all its associated properties.
[in]pathA path to the file, in which the paint data is to be saved.
[in]compressIf true then compress data if possible.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr passed as the argument.
TVG_RESULT_INSUFFICIENT_CONDITIONCurrently saving other resources.
TVG_RESULT_NOT_SUPPORTEDTrying to save a file with an unknown extension or in an unsupported format.
TVG_RESULT_MEMORY_CORRUPTIONAn internal error.
TVG_RESULT_UNKNOWNAn empty paint is to be saved.
+
+
+
Note
Saving can be asynchronous if the assigned thread number is greater than zero. To guarantee the saving is done, call tvg_saver_sync() afterwards.
+
See also
tvg_saver_sync()
+ +
+
+ +

◆ tvg_saver_sync()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Result tvg_saver_sync (Tvg_Saversaver)
+
+ +

Guarantees that the saving task is finished.

+

The behavior of the Saver module works on a sync/async basis, depending on the threading setting of the Initializer. Thus, if you wish to have a benefit of it, you must call tvg_saver_sync() after the tvg_saver_save() in the proper delayed time. Otherwise, you can call tvg_saver_sync() immediately.

+
Parameters
+ + +
[in]saverThe Tvg_Saver object connected with the saving task.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr passed as the argument.
TVG_RESULT_INSUFFICIENT_CONDITIONNo saving task is running.
+
+
+
Note
The asynchronous tasking is dependent on the Saver module implementation.
+
See also
tvg_saver_save()
+ +
+
+
+ + + + diff --git a/docs/html/group__ThorVGCapi__Saver.map b/docs/html/group__ThorVGCapi__Saver.map new file mode 100644 index 00000000..19600407 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Saver.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/html/group__ThorVGCapi__Saver.md5 b/docs/html/group__ThorVGCapi__Saver.md5 new file mode 100644 index 00000000..0eaef24f --- /dev/null +++ b/docs/html/group__ThorVGCapi__Saver.md5 @@ -0,0 +1 @@ +30a05053b021da4601ed8cb15d65431f \ No newline at end of file diff --git a/docs/html/group__ThorVGCapi__Saver.png b/docs/html/group__ThorVGCapi__Saver.png new file mode 100644 index 00000000..772506a3 Binary files /dev/null and b/docs/html/group__ThorVGCapi__Saver.png differ diff --git a/docs/html/group__ThorVGCapi__Scene.html b/docs/html/group__ThorVGCapi__Scene.html new file mode 100644 index 00000000..7924ae5f --- /dev/null +++ b/docs/html/group__ThorVGCapi__Scene.html @@ -0,0 +1,277 @@ + + + + + + + +ThorVG: Scene + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+Functions
+
+
+
+
+ +

A module managing the multiple paints as one group paint. +More...

+
+Collaboration diagram for Scene:
+
+
+ + + + +
+ + + + + + + + + + + + + + +

+Functions

TVG_EXPORT Tvg_Painttvg_scene_new ()
 Creates a new scene object. More...
 
TVG_EXPORT Tvg_Result tvg_scene_reserve (Tvg_Paint *scene, uint32_t size)
 Sets the size of the container, where all the paints pushed into the scene are stored. More...
 
TVG_EXPORT Tvg_Result tvg_scene_push (Tvg_Paint *scene, Tvg_Paint *paint)
 Passes drawing elements to the scene using Tvg_Paint objects. More...
 
TVG_EXPORT Tvg_Result tvg_scene_clear (Tvg_Paint *scene, bool free)
 Clears a Tvg_Scene objects from pushed paints. More...
 
+

Detailed Description

+

A module managing the multiple paints as one group paint.

+

As a group, scene can be transformed, translucent, composited with other target paints, its children will be affected by the scene world.

+

Function Documentation

+ +

◆ tvg_scene_clear()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_scene_clear (Tvg_Paintscene,
bool free 
)
+
+ +

Clears a Tvg_Scene objects from pushed paints.

+

Tvg_Paint objects stored in the scene are released if free is set to true, otherwise the memory is not deallocated and all paints should be released manually in order to avoid memory leaks.

+
Parameters
+ + + +
[in]sceneThe Tvg_Scene object to be cleared.
[in]freeIf true the memory occupied by paints is deallocated, otherwise it is not.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Canvas pointer.
+
+
+
Warning
Please use the free argument only when you know how it works, otherwise it's not recommended.
+ +
+
+ +

◆ tvg_scene_new()

+ +
+
+ + + + + + + +
TVG_EXPORT Tvg_Paint* tvg_scene_new ()
+
+ +

Creates a new scene object.

+

A scene object is used to group many paints into one object, which can be manipulated using TVG APIs.

+
Returns
A new scene object.
+ +
+
+ +

◆ tvg_scene_push()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_scene_push (Tvg_Paintscene,
Tvg_Paintpaint 
)
+
+ +

Passes drawing elements to the scene using Tvg_Paint objects.

+

Only the paints pushed into the scene will be the drawn targets. The paints are retained by the scene until the tvg_scene_clear() is called. If you know the number of pushed objects in advance, please call tvg_scene_reserve().

+
Parameters
+ + + +
[in]sceneA Tvg_Paint pointer to the scene object.
[in]paintA graphical object to be drawn.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr passed as the argument.
TVG_RESULT_MEMORY_CORRUPTIONAn internal error.
+
+
+
Note
The rendering order of the paints is the same as the order as they were pushed. Consider sorting the paints before pushing them if you intend to use layering.
+
See also
tvg_scene_reserve()
+ +
+
+ +

◆ tvg_scene_reserve()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_scene_reserve (Tvg_Paintscene,
uint32_t size 
)
+
+ +

Sets the size of the container, where all the paints pushed into the scene are stored.

+

If the number of objects pushed into the scene is known in advance, calling the function prevents multiple memory reallocation, thus improving the performance.

+
Parameters
+ + + +
[in]sceneA Tvg_Paint pointer to the scene object.
[in]sizeThe number of objects for which the memory is to be reserved.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with a memory allocation.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+ +
+
+
+ + + + diff --git a/docs/html/group__ThorVGCapi__Scene.map b/docs/html/group__ThorVGCapi__Scene.map new file mode 100644 index 00000000..3457a84c --- /dev/null +++ b/docs/html/group__ThorVGCapi__Scene.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/html/group__ThorVGCapi__Scene.md5 b/docs/html/group__ThorVGCapi__Scene.md5 new file mode 100644 index 00000000..75534e70 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Scene.md5 @@ -0,0 +1 @@ +59bad3566a75a217d40bc307a3969b94 \ No newline at end of file diff --git a/docs/html/group__ThorVGCapi__Scene.png b/docs/html/group__ThorVGCapi__Scene.png new file mode 100644 index 00000000..1823cf2e Binary files /dev/null and b/docs/html/group__ThorVGCapi__Scene.png differ diff --git a/docs/html/group__ThorVGCapi__Shape.html b/docs/html/group__ThorVGCapi__Shape.html new file mode 100644 index 00000000..9157f171 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Shape.html @@ -0,0 +1,2126 @@ + + + + + + + +ThorVG: Shape + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+Enumerations | +Functions
+
+
+
+
+ +

A module for managing two-dimensional figures and their properties. +More...

+
+Collaboration diagram for Shape:
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + +

+Enumerations

enum  Tvg_Path_Command { TVG_PATH_COMMAND_CLOSE = 0, +TVG_PATH_COMMAND_MOVE_TO, +TVG_PATH_COMMAND_LINE_TO, +TVG_PATH_COMMAND_CUBIC_TO + }
 Enumeration specifying the values of the path commands accepted by TVG. More...
 
enum  Tvg_Stroke_Cap { TVG_STROKE_CAP_SQUARE = 0, +TVG_STROKE_CAP_ROUND, +TVG_STROKE_CAP_BUTT + }
 Enumeration determining the ending type of a stroke in the open sub-paths. More...
 
enum  Tvg_Stroke_Join { TVG_STROKE_JOIN_BEVEL = 0, +TVG_STROKE_JOIN_ROUND, +TVG_STROKE_JOIN_MITER + }
 Enumeration specifying how to fill the area outside the gradient bounds. More...
 
enum  Tvg_Stroke_Fill { TVG_STROKE_FILL_PAD = 0, +TVG_STROKE_FILL_REFLECT, +TVG_STROKE_FILL_REPEAT + }
 Enumeration specifying how to fill the area outside the gradient bounds. More...
 
enum  Tvg_Fill_Rule { TVG_FILL_RULE_WINDING = 0, +TVG_FILL_RULE_EVEN_ODD + }
 Enumeration specifying the algorithm used to establish which parts of the shape are treated as the inside of the shape. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

TVG_EXPORT Tvg_Painttvg_shape_new ()
 Creates a new shape object. More...
 
TVG_EXPORT Tvg_Result tvg_shape_reset (Tvg_Paint *paint)
 Resets the shape path properties. More...
 
TVG_EXPORT Tvg_Result tvg_shape_move_to (Tvg_Paint *paint, float x, float y)
 Sets the initial point of the sub-path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_line_to (Tvg_Paint *paint, float x, float y)
 Adds a new point to the sub-path, which results in drawing a line from the current point to the given end-point. More...
 
TVG_EXPORT Tvg_Result tvg_shape_cubic_to (Tvg_Paint *paint, float cx1, float cy1, float cx2, float cy2, float x, float y)
 Adds new points to the sub-path, which results in drawing a cubic Bezier curve. More...
 
TVG_EXPORT Tvg_Result tvg_shape_close (Tvg_Paint *paint)
 Closes the current sub-path by drawing a line from the current point to the initial point of the sub-path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_append_rect (Tvg_Paint *paint, float x, float y, float w, float h, float rx, float ry)
 Appends a rectangle to the path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_append_circle (Tvg_Paint *paint, float cx, float cy, float rx, float ry)
 Appends an ellipse to the path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_append_arc (Tvg_Paint *paint, float cx, float cy, float radius, float startAngle, float sweep, uint8_t pie)
 Appends a circular arc to the path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_append_path (Tvg_Paint *paint, const Tvg_Path_Command *cmds, uint32_t cmdCnt, const Tvg_Point *pts, uint32_t ptsCnt)
 Appends a given sub-path to the path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_get_path_coords (const Tvg_Paint *paint, const Tvg_Point **pts, uint32_t *cnt)
 Gets the points values of the path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_get_path_commands (const Tvg_Paint *paint, const Tvg_Path_Command **cmds, uint32_t *cnt)
 Gets the commands data of the path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_width (Tvg_Paint *paint, float width)
 Sets the stroke width for all of the figures from the paint. More...
 
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_width (const Tvg_Paint *paint, float *width)
 Gets the shape's stroke width. More...
 
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_color (Tvg_Paint *paint, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
 Sets the shape's stroke color. More...
 
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_color (const Tvg_Paint *paint, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *a)
 Gets the shape's stroke color. More...
 
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_linear_gradient (Tvg_Paint *paint, Tvg_Gradient *grad)
 Sets the linear gradient fill of the stroke for all of the figures from the path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_radial_gradient (Tvg_Paint *paint, Tvg_Gradient *grad)
 Sets the radial gradient fill of the stroke for all of the figures from the path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_gradient (const Tvg_Paint *paint, Tvg_Gradient **grad)
 Gets the gradient fill of the shape's stroke. More...
 
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_dash (Tvg_Paint *paint, const float *dashPattern, uint32_t cnt)
 Sets the shape's stroke dash pattern. More...
 
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_dash (const Tvg_Paint *paint, const float **dashPattern, uint32_t *cnt)
 Gets the dash pattern of the stroke. More...
 
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_cap (Tvg_Paint *paint, Tvg_Stroke_Cap cap)
 Sets the cap style used for stroking the path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_cap (const Tvg_Paint *paint, Tvg_Stroke_Cap *cap)
 Gets the stroke cap style used for stroking the path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_join (Tvg_Paint *paint, Tvg_Stroke_Join join)
 Sets the join style for stroked path segments. More...
 
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_join (const Tvg_Paint *paint, Tvg_Stroke_Join *join)
 The function gets the stroke join method. More...
 
TVG_EXPORT Tvg_Result tvg_shape_set_fill_color (Tvg_Paint *paint, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
 Sets the shape's solid color. More...
 
TVG_EXPORT Tvg_Result tvg_shape_get_fill_color (const Tvg_Paint *paint, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *a)
 Gets the shape's solid color. More...
 
TVG_EXPORT Tvg_Result tvg_shape_set_fill_rule (Tvg_Paint *paint, Tvg_Fill_Rule rule)
 Sets the shape's fill rule. More...
 
TVG_EXPORT Tvg_Result tvg_shape_get_fill_rule (const Tvg_Paint *paint, Tvg_Fill_Rule *rule)
 Gets the shape's fill rule. More...
 
TVG_EXPORT Tvg_Result tvg_shape_set_linear_gradient (Tvg_Paint *paint, Tvg_Gradient *grad)
 Sets the linear gradient fill for all of the figures from the path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_set_radial_gradient (Tvg_Paint *paint, Tvg_Gradient *grad)
 Sets the radial gradient fill for all of the figures from the path. More...
 
TVG_EXPORT Tvg_Result tvg_shape_get_gradient (const Tvg_Paint *paint, Tvg_Gradient **grad)
 Gets the gradient fill of the shape. More...
 
+

Detailed Description

+

A module for managing two-dimensional figures and their properties.

+

A shape has three major properties: shape outline, stroking, filling. The outline in the shape is retained as the path. Path can be composed by accumulating primitive commands such as tvg_shape_move_to(), tvg_shape_line_to(), tvg_shape_cubic_to() or complete shape interfaces such as tvg_shape_append_rect(), tvg_shape_append_circle(), etc. Path can consists of sub-paths. One sub-path is determined by a close command.

+

The stroke of a shape is an optional property in case the shape needs to be represented with/without the outline borders. It's efficient since the shape path and the stroking path can be shared with each other. It's also convenient when controlling both in one context.

+

Enumeration Type Documentation

+ +

◆ Tvg_Fill_Rule

+ +
+
+ + + + +
enum Tvg_Fill_Rule
+
+ +

Enumeration specifying the algorithm used to establish which parts of the shape are treated as the inside of the shape.

+ + + +
Enumerator
TVG_FILL_RULE_WINDING 

A line from the point to a location outside the shape is drawn. The intersections of the line with the path segment of the shape are counted. Starting from zero, if the path segment of the shape crosses the line clockwise, one is added, otherwise one is subtracted. If the resulting sum is non zero, the point is inside the shape.

+
TVG_FILL_RULE_EVEN_ODD 

A line from the point to a location outside the shape is drawn and its intersections with the path segments of the shape are counted. If the number of intersections is an odd number, the point is inside the shape.

+
+ +
+
+ +

◆ Tvg_Path_Command

+ +
+
+ + + + +
enum Tvg_Path_Command
+
+ +

Enumeration specifying the values of the path commands accepted by TVG.

+

Not to be confused with the path commands from the svg path element (like M, L, Q, H and many others). TVG interprets all of them and translates to the ones from the PathCommand values.

+ + + + + +
Enumerator
TVG_PATH_COMMAND_CLOSE 

Ends the current sub-path and connects it with its initial point - corresponds to Z command in the svg path commands.

+
TVG_PATH_COMMAND_MOVE_TO 

Sets a new initial point of the sub-path and a new current point - corresponds to M command in the svg path commands.

+
TVG_PATH_COMMAND_LINE_TO 

Draws a line from the current point to the given point and sets a new value of the current point - corresponds to L command in the svg path commands.

+
TVG_PATH_COMMAND_CUBIC_TO 

Draws a cubic Bezier curve from the current point to the given point using two given control points and sets a new value of the current point - corresponds to C command in the svg path commands.

+
+ +
+
+ +

◆ Tvg_Stroke_Cap

+ +
+
+ + + + +
enum Tvg_Stroke_Cap
+
+ +

Enumeration determining the ending type of a stroke in the open sub-paths.

+ + + + +
Enumerator
TVG_STROKE_CAP_SQUARE 

The stroke is extended in both endpoints of a sub-path by a rectangle, with the width equal to the stroke width and the length equal to the half of the stroke width. For zero length sub-paths the square is rendered with the size of the stroke width.

+
TVG_STROKE_CAP_ROUND 

The stroke is extended in both endpoints of a sub-path by a half circle, with a radius equal to the half of a stroke width. For zero length sub-paths a full circle is rendered.

+
TVG_STROKE_CAP_BUTT 

The stroke ends exactly at each of the two endpoints of a sub-path. For zero length sub-paths no stroke is rendered.

+
+ +
+
+ +

◆ Tvg_Stroke_Fill

+ +
+
+ + + + +
enum Tvg_Stroke_Fill
+
+ +

Enumeration specifying how to fill the area outside the gradient bounds.

+ + + + +
Enumerator
TVG_STROKE_FILL_PAD 

The remaining area is filled with the closest stop color.

+
TVG_STROKE_FILL_REFLECT 

The gradient pattern is reflected outside the gradient area until the expected region is filled.

+
TVG_STROKE_FILL_REPEAT 

The gradient pattern is repeated continuously beyond the gradient area until the expected region is filled.

+
+ +
+
+ +

◆ Tvg_Stroke_Join

+ +
+
+ + + + +
enum Tvg_Stroke_Join
+
+ +

Enumeration specifying how to fill the area outside the gradient bounds.

+ + + + +
Enumerator
TVG_STROKE_JOIN_BEVEL 

The outer corner of the joined path segments is bevelled at the join point. The triangular region of the corner is enclosed by a straight line between the outer corners of each stroke.

+
TVG_STROKE_JOIN_ROUND 

The outer corner of the joined path segments is rounded. The circular region is centered at the join point.

+
TVG_STROKE_JOIN_MITER 

The outer corner of the joined path segments is spiked. The spike is created by extension beyond the join point of the outer edges of the stroke until they intersect. In case the extension goes beyond the limit, the join style is converted to the Bevel style.

+
+ +
+
+

Function Documentation

+ +

◆ tvg_shape_append_arc()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_append_arc (Tvg_Paintpaint,
float cx,
float cy,
float radius,
float startAngle,
float sweep,
uint8_t pie 
)
+
+ +

Appends a circular arc to the path.

+

The arc is treated as a new sub-path - it is not connected with the previous sub-path. The current point value is set to the end-point of the arc in case pie is false, and to the center of the arc otherwise.

+
Parameters
+ + + + + + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]cxThe horizontal coordinate of the center of the arc.
[in]cyThe vertical coordinate of the center of the arc.
[in]radiusThe radius of the arc.
[in]startAngleThe start angle of the arc given in degrees, measured counter-clockwise from the horizontal line.
[in]sweepThe central angle of the arc given in degrees, measured counter-clockwise from startAngle.
[in]pieSpecifies whether to draw radii from the arc's center to both of its end-point - drawn if true.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+
Note
Setting sweep value greater than 360 degrees, is equivalent to calling tvg_shape_append_circle(paint, cx, cy, radius, radius).
+ +
+
+ +

◆ tvg_shape_append_circle()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_append_circle (Tvg_Paintpaint,
float cx,
float cy,
float rx,
float ry 
)
+
+ +

Appends an ellipse to the path.

+

The position of the ellipse is specified by the coordinates of its center - cx and cy arguments.

+

The ellipse is treated as a new sub-path - it is not connected with the previous sub-path.

+

The value of the current point is set to (cx, cy - ry).

+
Parameters
+ + + + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]cxThe horizontal coordinate of the center of the ellipse.
[in]cyThe vertical coordinate of the center of the ellipse.
[in]rxThe x-axis radius of the ellipse.
[in]ryThe y-axis radius of the ellipse.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+ +
+
+ +

◆ tvg_shape_append_path()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_append_path (Tvg_Paintpaint,
const Tvg_Path_Commandcmds,
uint32_t cmdCnt,
const Tvg_Pointpts,
uint32_t ptsCnt 
)
+
+ +

Appends a given sub-path to the path.

+

The current point value is set to the last point from the sub-path. For each command from the cmds array, an appropriate number of points in pts array should be specified. If the number of points in the pts array is different than the number required by the cmds array, the shape with this sub-path will not be displayed on the screen.

+
Parameters
+ + + + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]cmdsThe array of the commands in the sub-path.
[in]cmdCntThe length of the cmds array.
[in]ptsThe array of the two-dimensional points.
[in]ptsCntThe length of the pts array.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr passed as the argument or cmdCnt or ptsCnt equal to zero.
+
+
+ +
+
+ +

◆ tvg_shape_append_rect()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_append_rect (Tvg_Paintpaint,
float x,
float y,
float w,
float h,
float rx,
float ry 
)
+
+ +

Appends a rectangle to the path.

+

The rectangle with rounded corners can be achieved by setting non-zero values to rx and ry arguments. The rx and ry values specify the radii of the ellipse defining the rounding of the corners.

+

The position of the rectangle is specified by the coordinates of its upper left corner - x and y arguments.

+

The rectangle is treated as a new sub-path - it is not connected with the previous sub-path.

+

The value of the current point is set to (x + rx, y) - in case rx is greater than w/2 the current point is set to (x + w/2, y)

+
Parameters
+ + + + + + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]xThe horizontal coordinate of the upper left corner of the rectangle.
[in]yThe vertical coordinate of the upper left corner of the rectangle.
[in]wThe width of the rectangle.
[in]hThe height of the rectangle.
[in]rxThe x-axis radius of the ellipse defining the rounded corners of the rectangle.
[in]ryThe y-axis radius of the ellipse defining the rounded corners of the rectangle.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+

&

Note
For rx and ry greater than or equal to the half of w and the half of h, respectively, the shape become an ellipse.
+ +
+
+ +

◆ tvg_shape_close()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_close (Tvg_Paintpaint)
+
+ +

Closes the current sub-path by drawing a line from the current point to the initial point of the sub-path.

+

The value of the current point is set to the initial point of the closed sub-path.

+
Parameters
+ + +
[in]paintA Tvg_Paint pointer to the shape object.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+
Note
In case the sub-path does not contain any points, this function has no effect.
+ +
+
+ +

◆ tvg_shape_cubic_to()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_cubic_to (Tvg_Paintpaint,
float cx1,
float cy1,
float cx2,
float cy2,
float x,
float y 
)
+
+ +

Adds new points to the sub-path, which results in drawing a cubic Bezier curve.

+

The Bezier curve starts at the current point and ends at the given end-point (x, y). Two control points (cx1, cy1) and (cx2, cy2) are used to determine the shape of the curve. The value of the current point is set to the given end-point.

+
Parameters
+ + + + + + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]cx1The horizontal coordinate of the 1st control point.
[in]cy1The vertical coordinate of the 1st control point.
[in]cx2The horizontal coordinate of the 2nd control point.
[in]cy2The vertical coordinate of the 2nd control point.
[in]xThe horizontal coordinate of the endpoint of the curve.
[in]yThe vertical coordinate of the endpoint of the curve.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+
Note
In case this is the first command in the path, no data from the path are rendered.
+ +
+
+ +

◆ tvg_shape_get_fill_color()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_get_fill_color (const Tvg_Paintpaint,
uint8_t * r,
uint8_t * g,
uint8_t * b,
uint8_t * a 
)
+
+ +

Gets the shape's solid color.

+
Parameters
+ + + + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[out]rThe red color channel value in the range [0 ~ 255]. The default value is 0.
[out]gThe green color channel value in the range [0 ~ 255]. The default value is 0.
[out]bThe blue color channel value in the range [0 ~ 255]. The default value is 0.
[out]aThe alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. The default value is 0.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+ +
+
+ +

◆ tvg_shape_get_fill_rule()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_get_fill_rule (const Tvg_Paintpaint,
Tvg_Fill_Rulerule 
)
+
+ +

Gets the shape's fill rule.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[out]ruleshape's fill rule
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid pointer passed as an argument.
+
+
+ +
+
+ +

◆ tvg_shape_get_gradient()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_get_gradient (const Tvg_Paintpaint,
Tvg_Gradient ** grad 
)
+
+ +

Gets the gradient fill of the shape.

+

The function does not allocate any data.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[out]gradThe gradient fill.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid pointer passed as an argument.
+
+
+ +
+
+ +

◆ tvg_shape_get_path_commands()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_get_path_commands (const Tvg_Paintpaint,
const Tvg_Path_Command ** cmds,
uint32_t * cnt 
)
+
+ +

Gets the commands data of the path.

+

The function does not allocate any data. There is no need to free the cmds array.

+
Tvg_Shape *shape = tvg_shape_new();
+
Tvg_Path_Command *cmds = NULL;
+
uint32_t len = 0;
+
+
tvg_shape_append_circle(shape, 10, 10, 50, 50);
+
tvg_shape_get_path_commands(shape, (const Tvg_Path_Command**)&cmds, &len);
+
//TVG approximates a circle by four Bezier curves. In the example above the cmds array stores the commands of the path data.
+
Parameters
+ + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[out]cmdsThe pointer to the array of the commands from the path.
[out]cntThe length of the cmds array.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr passed as the argument.
+
+
+ +
+
+ +

◆ tvg_shape_get_path_coords()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_get_path_coords (const Tvg_Paintpaint,
const Tvg_Point ** pts,
uint32_t * cnt 
)
+
+ +

Gets the points values of the path.

+

The function does not allocate any data, it operates on internal memory. There is no need to free the pts array.

+
Tvg_Shape *shape = tvg_shape_new();
+
Tvg_Point *coords = NULL;
+
uint32_t len = 0;
+
+
tvg_shape_append_circle(shape, 10, 10, 50, 50);
+
tvg_shape_get_path_coords(shape, (const Tvg_Point**)&coords, &len);
+
//TVG approximates a circle by four Bezier curves. In the example above the coords array stores their coordinates.
+
Parameters
+ + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[out]ptsThe pointer to the array of the two-dimensional points from the path.
[out]cntThe length of the pts array.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTA nullptr passed as the argument.
+
+
+ +
+
+ +

◆ tvg_shape_get_stroke_cap()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_cap (const Tvg_Paintpaint,
Tvg_Stroke_Capcap 
)
+
+ +

Gets the stroke cap style used for stroking the path.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[out]capThe cap style value.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid pointer passed as an argument.
+
+
+ +
+
+ +

◆ tvg_shape_get_stroke_color()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_color (const Tvg_Paintpaint,
uint8_t * r,
uint8_t * g,
uint8_t * b,
uint8_t * a 
)
+
+ +

Gets the shape's stroke color.

+
Parameters
+ + + + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[out]rThe red color channel value in the range [0 ~ 255]. The default value is 0.
[out]gThe green color channel value in the range [0 ~ 255]. The default value is 0.
[out]bThe blue color channel value in the range [0 ~ 255]. The default value is 0.
[out]aThe alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_INSUFFICIENT_CONDITIONNo stroke was set.
+
+
+ +
+
+ +

◆ tvg_shape_get_stroke_dash()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_dash (const Tvg_Paintpaint,
const float ** dashPattern,
uint32_t * cnt 
)
+
+ +

Gets the dash pattern of the stroke.

+

The function does not allocate any memory.

+
Parameters
+ + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[out]dashPatternThe array of consecutive pair values of the dash length and the gap length.
[out]cntThe size of the dashPattern array.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid pointer passed as an argument.
+
+
+ +
+
+ +

◆ tvg_shape_get_stroke_gradient()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_gradient (const Tvg_Paintpaint,
Tvg_Gradient ** grad 
)
+
+ +

Gets the gradient fill of the shape's stroke.

+

The function does not allocate any memory.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[out]gradThe gradient fill.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid pointer passed as an argument.
+
+
+ +
+
+ +

◆ tvg_shape_get_stroke_join()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_join (const Tvg_Paintpaint,
Tvg_Stroke_Joinjoin 
)
+
+ +

The function gets the stroke join method.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[out]joinThe join style value.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid pointer passed as an argument.
+
+
+ +
+
+ +

◆ tvg_shape_get_stroke_width()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_width (const Tvg_Paintpaint,
float * width 
)
+
+ +

Gets the shape's stroke width.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[out]widthThe stroke width.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid pointer passed as an argument.
+
+
+ +
+
+ +

◆ tvg_shape_line_to()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_line_to (Tvg_Paintpaint,
float x,
float y 
)
+
+ +

Adds a new point to the sub-path, which results in drawing a line from the current point to the given end-point.

+

The value of the current point is set to the given end-point.

+
Parameters
+ + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]xThe horizontal coordinate of the end-point of the line.
[in]yThe vertical coordinate of the end-point of the line.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+
Note
In case this is the first command in the path, it corresponds to the tvg_shape_move_to() call.
+ +
+
+ +

◆ tvg_shape_move_to()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_move_to (Tvg_Paintpaint,
float x,
float y 
)
+
+ +

Sets the initial point of the sub-path.

+

The value of the current point is set to the given point.

+
Parameters
+ + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]xThe horizontal coordinate of the initial point of the sub-path.
[in]yThe vertical coordinate of the initial point of the sub-path.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+ +
+
+ +

◆ tvg_shape_new()

+ +
+
+ + + + + + + +
TVG_EXPORT Tvg_Paint* tvg_shape_new ()
+
+ +

Creates a new shape object.

+
Returns
A new shape object.
+ +
+
+ +

◆ tvg_shape_reset()

+ +
+
+ + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_reset (Tvg_Paintpaint)
+
+ +

Resets the shape path properties.

+

The color, the fill and the stroke properties are retained.

+
Parameters
+ + +
[in]paintA Tvg_Paint pointer to the shape object.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+
Note
The memory, where the path data is stored, is not deallocated at this stage for caching effect.
+ +
+
+ +

◆ tvg_shape_set_fill_color()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_set_fill_color (Tvg_Paintpaint,
uint8_t r,
uint8_t g,
uint8_t b,
uint8_t a 
)
+
+ +

Sets the shape's solid color.

+

The parts of the shape defined as inner are colored.

+
Parameters
+ + + + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]rThe red color channel value in the range [0 ~ 255]. The default value is 0.
[in]gThe green color channel value in the range [0 ~ 255]. The default value is 0.
[in]bThe blue color channel value in the range [0 ~ 255]. The default value is 0.
[in]aThe alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. The default value is 0.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+
Note
Either a solid color or a gradient fill is applied, depending on what was set as last.
+
See also
tvg_shape_set_fill_rule()
+ +
+
+ +

◆ tvg_shape_set_fill_rule()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_set_fill_rule (Tvg_Paintpaint,
Tvg_Fill_Rule rule 
)
+
+ +

Sets the shape's fill rule.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]ruleThe fill rule value. The default value is TVG_FILL_RULE_WINDING.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
+
+
+ +
+
+ +

◆ tvg_shape_set_linear_gradient()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_set_linear_gradient (Tvg_Paintpaint,
Tvg_Gradientgrad 
)
+
+ +

Sets the linear gradient fill for all of the figures from the path.

+

The parts of the shape defined as inner are filled.

+
+
tvg_linear_gradient_set(grad, 700, 700, 800, 800);
+
Tvg_Color_Stop color_stops[4] =
+
{
+
{0.0 , 0, 0, 0, 255},
+
{0.25, 255, 0, 0, 255},
+
{0.5 , 0, 255, 0, 255},
+
{1.0 , 0, 0, 255, 255}
+
};
+
tvg_gradient_set_color_stops(grad, color_stops, 4);
+ +
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]gradThe linear gradient fill.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_MEMORY_CORRUPTIONAn invalid Tvg_Gradient pointer.
+
+
+
Note
Either a solid color or a gradient fill is applied, depending on what was set as last.
+
See also
tvg_shape_set_fill_rule()
+ +
+
+ +

◆ tvg_shape_set_radial_gradient()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_set_radial_gradient (Tvg_Paintpaint,
Tvg_Gradientgrad 
)
+
+ +

Sets the radial gradient fill for all of the figures from the path.

+

The parts of the shape defined as inner are filled.

+
+
tvg_radial_gradient_set(grad, 550, 550, 50);
+
Tvg_Color_Stop color_stops[4] =
+
{
+
{0.0 , 0, 0, 0, 255},
+
{0.25, 255, 0, 0, 255},
+
{0.5 , 0, 255, 0, 255},
+
{1.0 , 0, 0, 255, 255}
+
};
+
tvg_gradient_set_color_stops(grad, color_stops, 4);
+ +
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]gradThe radial gradient fill.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_MEMORY_CORRUPTIONAn invalid Tvg_Gradient pointer.
+
+
+
Note
Either a solid color or a gradient fill is applied, depending on what was set as last.
+
See also
tvg_shape_set_fill_rule()
+ +
+
+ +

◆ tvg_shape_set_stroke_cap()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_cap (Tvg_Paintpaint,
Tvg_Stroke_Cap cap 
)
+
+ +

Sets the cap style used for stroking the path.

+

The cap style specifies the shape to be used at the end of the open stroked sub-paths.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]capThe cap style value. The default value is TVG_STROKE_CAP_SQUARE.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with a memory allocation.
+
+
+ +
+
+ +

◆ tvg_shape_set_stroke_color()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_color (Tvg_Paintpaint,
uint8_t r,
uint8_t g,
uint8_t b,
uint8_t a 
)
+
+ +

Sets the shape's stroke color.

+
Parameters
+ + + + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]rThe red color channel value in the range [0 ~ 255]. The default value is 0.
[in]gThe green color channel value in the range [0 ~ 255]. The default value is 0.
[in]bThe blue color channel value in the range [0 ~ 255]. The default value is 0.
[in]aThe alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with a memory allocation.
+
+
+
Note
Either a solid color or a gradient fill is applied, depending on what was set as last.
+ +
+
+ +

◆ tvg_shape_set_stroke_dash()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_dash (Tvg_Paintpaint,
const float * dashPattern,
uint32_t cnt 
)
+
+ +

Sets the shape's stroke dash pattern.

+
//dash pattern examples
+
float dashPattern[2] = {20, 10}; // -- -- --
+
float dashPattern[2] = {40, 20}; // ---- ---- ----
+
float dashPattern[4] = {10, 20, 30, 40} // - --- - ---
+
Parameters
+ + + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]dashPatternThe array of consecutive pair values of the dash length and the gap length.
[in]cntThe size of the dashPattern array.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid pointer passed as an argument and cnt > 0, the given length of the array is less than two or any of the dashPattern values is zero or less.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with a memory allocation.
+
+
+
Note
To reset the stroke dash pattern, pass nullptr to dashPattern and zero to cnt.
+ +
+
+ +

◆ tvg_shape_set_stroke_join()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_join (Tvg_Paintpaint,
Tvg_Stroke_Join join 
)
+
+ +

Sets the join style for stroked path segments.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]joinThe join style value. The default value is TVG_STROKE_JOIN_BEVEL.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with a memory allocation.
+
+
+ +
+
+ +

◆ tvg_shape_set_stroke_linear_gradient()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_linear_gradient (Tvg_Paintpaint,
Tvg_Gradientgrad 
)
+
+ +

Sets the linear gradient fill of the stroke for all of the figures from the path.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]gradThe linear gradient fill.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with a memory allocation.
TVG_RESULT_MEMORY_CORRUPTIONAn invalid Tvg_Gradient pointer.
+
+
+
Note
Either a solid color or a gradient fill is applied, depending on what was set as last.
+ +
+
+ +

◆ tvg_shape_set_stroke_radial_gradient()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_radial_gradient (Tvg_Paintpaint,
Tvg_Gradientgrad 
)
+
+ +

Sets the radial gradient fill of the stroke for all of the figures from the path.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]gradThe radial gradient fill.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with a memory allocation.
TVG_RESULT_MEMORY_CORRUPTIONAn invalid Tvg_Gradient pointer.
+
+
+
Note
Either a solid color or a gradient fill is applied, depending on what was set as last.
+ +
+
+ +

◆ tvg_shape_set_stroke_width()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_width (Tvg_Paintpaint,
float width 
)
+
+ +

Sets the stroke width for all of the figures from the paint.

+
Parameters
+ + + +
[in]paintA Tvg_Paint pointer to the shape object.
[in]widthThe width of the stroke. The default value is 0.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTAn invalid Tvg_Paint pointer.
TVG_RESULT_FAILED_ALLOCATIONAn internal error with a memory allocation.
+
+
+ +
+
+
+
tvg_gradient_set_color_stops
TVG_EXPORT Tvg_Result tvg_gradient_set_color_stops(Tvg_Gradient *grad, const Tvg_Color_Stop *color_stop, uint32_t cnt)
Sets the parameters of the colors of the gradient and their position.
+
tvg_shape_get_path_coords
TVG_EXPORT Tvg_Result tvg_shape_get_path_coords(const Tvg_Paint *paint, const Tvg_Point **pts, uint32_t *cnt)
Gets the points values of the path.
+
tvg_radial_gradient_new
TVG_EXPORT Tvg_Gradient * tvg_radial_gradient_new()
Creates a new radial gradient object.
+
tvg_shape_get_path_commands
TVG_EXPORT Tvg_Result tvg_shape_get_path_commands(const Tvg_Paint *paint, const Tvg_Path_Command **cmds, uint32_t *cnt)
Gets the commands data of the path.
+
Tvg_Point
A data structure representing a point in two-dimensional space.
Definition: thorvg_capi.h:199
+
tvg_shape_new
TVG_EXPORT Tvg_Paint * tvg_shape_new()
Creates a new shape object.
+
tvg_shape_set_linear_gradient
TVG_EXPORT Tvg_Result tvg_shape_set_linear_gradient(Tvg_Paint *paint, Tvg_Gradient *grad)
Sets the linear gradient fill for all of the figures from the path.
+
tvg_shape_append_circle
TVG_EXPORT Tvg_Result tvg_shape_append_circle(Tvg_Paint *paint, float cx, float cy, float rx, float ry)
Appends an ellipse to the path.
+
tvg_radial_gradient_set
TVG_EXPORT Tvg_Result tvg_radial_gradient_set(Tvg_Gradient *grad, float cx, float cy, float radius)
Sets the radial gradient bounds.
+
tvg_linear_gradient_set
TVG_EXPORT Tvg_Result tvg_linear_gradient_set(Tvg_Gradient *grad, float x1, float y1, float x2, float y2)
Sets the linear gradient bounds.
+
Tvg_Gradient
struct _Tvg_Gradient Tvg_Gradient
A structure representing a gradient fill of a Tvg_Paint object.
Definition: thorvg_capi.h:69
+
tvg_linear_gradient_new
TVG_EXPORT Tvg_Gradient * tvg_linear_gradient_new()
Creates a new linear gradient object.
+
Tvg_Color_Stop
A data structure storing the information about the color and its relative position inside the gradien...
Definition: thorvg_capi.h:184
+
Tvg_Path_Command
Tvg_Path_Command
Enumeration specifying the values of the path commands accepted by TVG.
Definition: thorvg_capi.h:127
+
tvg_shape_set_radial_gradient
TVG_EXPORT Tvg_Result tvg_shape_set_radial_gradient(Tvg_Paint *paint, Tvg_Gradient *grad)
Sets the radial gradient fill for all of the figures from the path.
+ + + + diff --git a/docs/html/group__ThorVGCapi__Shape.map b/docs/html/group__ThorVGCapi__Shape.map new file mode 100644 index 00000000..38550750 --- /dev/null +++ b/docs/html/group__ThorVGCapi__Shape.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/html/group__ThorVGCapi__Shape.md5 b/docs/html/group__ThorVGCapi__Shape.md5 new file mode 100644 index 00000000..f88e902a --- /dev/null +++ b/docs/html/group__ThorVGCapi__Shape.md5 @@ -0,0 +1 @@ +93fb9188797dd82cf9eef43f77c609e2 \ No newline at end of file diff --git a/docs/html/group__ThorVGCapi__Shape.png b/docs/html/group__ThorVGCapi__Shape.png new file mode 100644 index 00000000..b5e5c9f6 Binary files /dev/null and b/docs/html/group__ThorVGCapi__Shape.png differ diff --git a/docs/html/group__ThorVGCapi__SwCanvas.html b/docs/html/group__ThorVGCapi__SwCanvas.html new file mode 100644 index 00000000..d23b8151 --- /dev/null +++ b/docs/html/group__ThorVGCapi__SwCanvas.html @@ -0,0 +1,348 @@ + + + + + + + +ThorVG: SwCanvas + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+Enumerations | +Functions
+
+
SwCanvas
+
+
+ +

A module for rendering the graphical elements using the software engine. +More...

+
+Collaboration diagram for SwCanvas:
+
+
+ + + + +
+ + + + + + + + +

+Enumerations

enum  Tvg_Mempool_Policy { TVG_MEMPOOL_POLICY_DEFAULT = 0, +TVG_MEMPOOL_POLICY_SHAREABLE, +TVG_MEMPOOL_POLICY_INDIVIDUAL + }
 Enumeration specifying the methods of Memory Pool behavior policy. More...
 
enum  Tvg_Colorspace { TVG_COLORSPACE_ABGR8888 = 0, +TVG_COLORSPACE_ARGB8888 + }
 Enumeration specifying the methods of combining the 8-bit color channels into 32-bit color. More...
 
+ + + + + + + + + + +

+Functions

TVG_EXPORT Tvg_Canvastvg_swcanvas_create ()
 Creates a Canvas object. More...
 
TVG_EXPORT Tvg_Result tvg_swcanvas_set_target (Tvg_Canvas *canvas, uint32_t *buffer, uint32_t stride, uint32_t w, uint32_t h, Tvg_Colorspace cs)
 Sets the buffer used in the rasterization process and defines the used colorspace. More...
 
TVG_EXPORT Tvg_Result tvg_swcanvas_set_mempool (Tvg_Canvas *canvas, Tvg_Mempool_Policy policy)
 Sets the software engine memory pool behavior policy. More...
 
+

Detailed Description

+

A module for rendering the graphical elements using the software engine.

+

Enumeration Type Documentation

+ +

◆ Tvg_Colorspace

+ +
+
+ + + + +
enum Tvg_Colorspace
+
+ +

Enumeration specifying the methods of combining the 8-bit color channels into 32-bit color.

+ + + +
Enumerator
TVG_COLORSPACE_ABGR8888 

The 8-bit color channels are combined into 32-bit color in the order: alpha, blue, green, red.

+
TVG_COLORSPACE_ARGB8888 

The 8-bit color channels are combined into 32-bit color in the order: alpha, red, green, blue.

+
+ +
+
+ +

◆ Tvg_Mempool_Policy

+ +
+
+ + + + +
enum Tvg_Mempool_Policy
+
+ +

Enumeration specifying the methods of Memory Pool behavior policy.

+ + + + +
Enumerator
TVG_MEMPOOL_POLICY_DEFAULT 

Default behavior that ThorVG is designed to.

+
TVG_MEMPOOL_POLICY_SHAREABLE 

Memory Pool is shared among canvases.

+
TVG_MEMPOOL_POLICY_INDIVIDUAL 

Allocate designated memory pool that is used only by the current canvas instance.

+
+ +
+
+

Function Documentation

+ +

◆ tvg_swcanvas_create()

+ +
+
+ + + + + + + +
TVG_EXPORT Tvg_Canvas* tvg_swcanvas_create ()
+
+ +

Creates a Canvas object.

+
Tvg_Canvas *canvas = NULL;
+
+ + +
+
//set up the canvas buffer
+
uint32_t *buffer = NULL;
+
buffer = (uint32_t*) malloc(sizeof(uint32_t) * 100 * 100);
+
if (!buffer) return;
+
+
tvg_swcanvas_set_target(canvas, buffer, 100, 100, 100, TVG_COLORSPACE_ARGB8888);
+
+
//set up paints and add them into the canvas before drawing it
+
+ + +
Returns
A new Tvg_Canvas object.
+ +
+
+ +

◆ tvg_swcanvas_set_mempool()

+ +
+
+ + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_swcanvas_set_mempool (Tvg_Canvascanvas,
Tvg_Mempool_Policy policy 
)
+
+ +

Sets the software engine memory pool behavior policy.

+

ThorVG draws a lot of shapes, it allocates/deallocates a few chunk of memory while processing rendering. It internally uses one shared memory pool which can be reused among the canvases in order to avoid memory overhead.

+

Thus ThorVG suggests using a memory pool policy to satisfy user demands, if it needs to guarantee the thread-safety of the internal data access.

+
Parameters
+ + + +
[in]canvasThe Tvg_Canvas object of which the Memory Pool behavior is to be specified.
[in]policyThe method specifying the Memory Pool behavior. The default value is TVG_MEMPOOL_POLICY_DEFAULT.
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_INVALID_ARGUMENTSAn invalid canvas pointer passed.
TVG_RESULT_INSUFFICIENT_CONDITIONThe canvas contains some paints already.
TVG_RESULT_NOT_SUPPORTEDThe software engine is not supported.
+
+
+
Note
When policy is set as TVG_MEMPOOL_POLICY_INDIVIDUAL, the current instance of canvas uses its own individual memory data, which is not shared with others. This is necessary when the canvas is accessed on a worker-thread.
+
Warning
It's not allowed after pushing any paints.
+ +
+
+ +

◆ tvg_swcanvas_set_target()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TVG_EXPORT Tvg_Result tvg_swcanvas_set_target (Tvg_Canvascanvas,
uint32_t * buffer,
uint32_t stride,
uint32_t w,
uint32_t h,
Tvg_Colorspace cs 
)
+
+ +

Sets the buffer used in the rasterization process and defines the used colorspace.

+

For optimisation reasons TVG does not allocate memory for the output buffer on its own. The buffer of a desirable size should be allocated and owned by the caller.

+
Parameters
+ + + + + + + +
[in]canvasThe Tvg_Canvas object managing the buffer.
[in]bufferA pointer to the allocated memory block of the size stride x h.
[in]strideThe stride of the raster image - in most cases same value as w.
[in]wThe width of the raster image.
[in]hThe height of the raster image.
[in]csThe colorspace value defining the way the 32-bits colors should be read/written.
    +
  • TVG_COLORSPACE_ABGR8888
  • +
  • TVG_COLORSPACE_ARGB8888
  • +
+
+
+
+
Returns
Tvg_Result enumeration.
+
Return values
+ + + + + +
TVG_RESULT_SUCCESSSucceed.
TVG_RESULT_MEMORY_CORRUPTIONCasting in the internal function implementation failed.
TVG_RESULT_INVALID_ARGUMENTSAn invalid canvas or buffer pointer passed or one of the stride, w or h being zero.
TVG_RESULT_NOT_SUPPORTEDThe software engine is not supported.
+
+
+
Warning
Do not access buffer during tvg_canvas_draw() - tvg_canvas_sync(). It should not be accessed while TVG is writing on it.
+
See also
Tvg_Colorspace
+ +
+
+
+
tvg_swcanvas_set_target
TVG_EXPORT Tvg_Result tvg_swcanvas_set_target(Tvg_Canvas *canvas, uint32_t *buffer, uint32_t stride, uint32_t w, uint32_t h, Tvg_Colorspace cs)
Sets the buffer used in the rasterization process and defines the used colorspace.
+
TVG_ENGINE_SW
@ TVG_ENGINE_SW
CPU rasterizer.
Definition: thorvg_capi.h:84
+
Tvg_Canvas
struct _Tvg_Canvas Tvg_Canvas
A structure responsible for managing and drawing graphical elements.
Definition: thorvg_capi.h:55
+
tvg_swcanvas_create
TVG_EXPORT Tvg_Canvas * tvg_swcanvas_create()
Creates a Canvas object.
+
tvg_engine_init
TVG_EXPORT Tvg_Result tvg_engine_init(Tvg_Engine engine_method, unsigned threads)
Initializes TVG engines.
+
TVG_COLORSPACE_ARGB8888
@ TVG_COLORSPACE_ARGB8888
The 8-bit color channels are combined into 32-bit color in the order: alpha, red, green,...
Definition: thorvg_capi.h:332
+
tvg_canvas_destroy
TVG_EXPORT Tvg_Result tvg_canvas_destroy(Tvg_Canvas *canvas)
Clears the canvas internal data, releases all paints stored by the canvas and destroys the canvas obj...
+
tvg_engine_term
TVG_EXPORT Tvg_Result tvg_engine_term(Tvg_Engine engine_method)
Terminates TVG engines.
+ + + + diff --git a/docs/html/group__ThorVGCapi__SwCanvas.map b/docs/html/group__ThorVGCapi__SwCanvas.map new file mode 100644 index 00000000..44abe203 --- /dev/null +++ b/docs/html/group__ThorVGCapi__SwCanvas.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/html/group__ThorVGCapi__SwCanvas.md5 b/docs/html/group__ThorVGCapi__SwCanvas.md5 new file mode 100644 index 00000000..9fe95739 --- /dev/null +++ b/docs/html/group__ThorVGCapi__SwCanvas.md5 @@ -0,0 +1 @@ +e70d73e8d9dd6b80d0ad936d7886cbf0 \ No newline at end of file diff --git a/docs/html/group__ThorVGCapi__SwCanvas.png b/docs/html/group__ThorVGCapi__SwCanvas.png new file mode 100644 index 00000000..162d5d82 Binary files /dev/null and b/docs/html/group__ThorVGCapi__SwCanvas.png differ diff --git a/docs/html/group__ThorVG__CAPI.html b/docs/html/group__ThorVG__CAPI.html new file mode 100644 index 00000000..19316efd --- /dev/null +++ b/docs/html/group__ThorVG__CAPI.html @@ -0,0 +1,243 @@ + + + + + + + +ThorVG: ThorVG_CAPI + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+Modules | +Classes | +Typedefs | +Enumerations
+
+
ThorVG_CAPI
+
+
+ +

ThorVG C language binding APIs. +More...

+
+Collaboration diagram for ThorVG_CAPI:
+
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Modules

 Initializer
 A module enabling initialization and termination of the TVG engines.
 
 Canvas
 A module for managing and drawing graphical elements.
 
 Paint
 A module for managing graphical elements. It enables duplication, transformation and composition.
 
 Shape
 A module for managing two-dimensional figures and their properties.
 
 Gradient
 A module managing the gradient fill of objects.
 
 Picture
 A module enabling to create and to load an image in one of the supported formats: svg, png, jpg and raw.
 
 Scene
 A module managing the multiple paints as one group paint.
 
 Saver
 A module for exporting a paint object into a specified file.
 
+ + + + + + + +

+Classes

struct  Tvg_Point
 A data structure representing a point in two-dimensional space. More...
 
struct  Tvg_Matrix
 A data structure representing a three-dimensional matrix. More...
 
+ + + + + + + + + + + + + +

+Typedefs

typedef struct _Tvg_Canvas Tvg_Canvas
 A structure responsible for managing and drawing graphical elements. More...
 
typedef struct _Tvg_Paint Tvg_Paint
 A structure representing a graphical element. More...
 
+typedef struct _Tvg_Gradient Tvg_Gradient
 A structure representing a gradient fill of a Tvg_Paint object.
 
+typedef struct _Tvg_Saver Tvg_Saver
 A structure representing an object that enables to save a Tvg_Paint object into a file.
 
+ + + + +

+Enumerations

enum  Tvg_Result {
+  TVG_RESULT_SUCCESS = 0, +TVG_RESULT_INVALID_ARGUMENT, +TVG_RESULT_INSUFFICIENT_CONDITION, +TVG_RESULT_FAILED_ALLOCATION, +
+  TVG_RESULT_MEMORY_CORRUPTION, +TVG_RESULT_NOT_SUPPORTED, +TVG_RESULT_UNKNOWN +
+ }
 Enumeration specifying the result from the APIs. More...
 
+

Detailed Description

+

ThorVG C language binding APIs.

+

Typedef Documentation

+ +

◆ Tvg_Canvas

+ +
+
+ + + + +
typedef struct _Tvg_Canvas Tvg_Canvas
+
+ +

A structure responsible for managing and drawing graphical elements.

+

It sets up the target buffer, which can be drawn on the screen. It stores the Tvg_Paint objects (Shape, Scene, Picture).

+ +
+
+ +

◆ Tvg_Paint

+ +
+
+ + + + +
typedef struct _Tvg_Paint Tvg_Paint
+
+ +

A structure representing a graphical element.

+
Warning
The TvgPaint objects can not be shared between Canvases.
+ +
+
+

Enumeration Type Documentation

+ +

◆ Tvg_Result

+ +
+
+ + + + +
enum Tvg_Result
+
+ +

Enumeration specifying the result from the APIs.

+ + + + + + + + +
Enumerator
TVG_RESULT_SUCCESS 

The value returned in case of a correct request execution.

+
TVG_RESULT_INVALID_ARGUMENT 

The value returned in the event of a problem with the arguments given to the API - e.g. empty paths or null pointers.

+
TVG_RESULT_INSUFFICIENT_CONDITION 

The value returned in case the request cannot be processed - e.g. asking for properties of an object, which does not exist.

+
TVG_RESULT_FAILED_ALLOCATION 

The value returned in case of unsuccessful memory allocation.

+
TVG_RESULT_MEMORY_CORRUPTION 

The value returned in the event of bad memory handling - e.g. failing in pointer releasing or casting.

+
TVG_RESULT_NOT_SUPPORTED 

The value returned in case of choosing unsupported options.

+
TVG_RESULT_UNKNOWN 

The value returned in all other cases.

+
+ +
+
+
+ + + + diff --git a/docs/html/group__ThorVG__CAPI.map b/docs/html/group__ThorVG__CAPI.map new file mode 100644 index 00000000..b6ce4eb0 --- /dev/null +++ b/docs/html/group__ThorVG__CAPI.map @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/docs/html/group__ThorVG__CAPI.md5 b/docs/html/group__ThorVG__CAPI.md5 new file mode 100644 index 00000000..15217e6e --- /dev/null +++ b/docs/html/group__ThorVG__CAPI.md5 @@ -0,0 +1 @@ +a966acf3060b11ff6d68f2ee487724f0 \ No newline at end of file diff --git a/docs/html/group__ThorVG__CAPI.png b/docs/html/group__ThorVG__CAPI.png new file mode 100644 index 00000000..9e62c796 Binary files /dev/null and b/docs/html/group__ThorVG__CAPI.png differ diff --git a/docs/html/inherit_graph_10.map b/docs/html/inherit_graph_10.map new file mode 100644 index 00000000..6c71ea54 --- /dev/null +++ b/docs/html/inherit_graph_10.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/html/inherit_graph_10.md5 b/docs/html/inherit_graph_10.md5 new file mode 100644 index 00000000..38079774 --- /dev/null +++ b/docs/html/inherit_graph_10.md5 @@ -0,0 +1 @@ +bfab543bc61da2a3de0b6ef6ee6848d8 \ No newline at end of file diff --git a/docs/html/inherit_graph_10.png b/docs/html/inherit_graph_10.png new file mode 100644 index 00000000..eccff56a Binary files /dev/null and b/docs/html/inherit_graph_10.png differ diff --git a/docs/html/inherit_graph_8.map b/docs/html/inherit_graph_8.map new file mode 100644 index 00000000..a228fc32 --- /dev/null +++ b/docs/html/inherit_graph_8.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/html/inherit_graph_8.md5 b/docs/html/inherit_graph_8.md5 new file mode 100644 index 00000000..27689264 --- /dev/null +++ b/docs/html/inherit_graph_8.md5 @@ -0,0 +1 @@ +f9729067204027e69c2f946a024377ad \ No newline at end of file diff --git a/docs/html/inherit_graph_8.png b/docs/html/inherit_graph_8.png new file mode 100644 index 00000000..9e085909 Binary files /dev/null and b/docs/html/inherit_graph_8.png differ diff --git a/docs/html/inherit_graph_9.map b/docs/html/inherit_graph_9.map new file mode 100644 index 00000000..e52f6b8a --- /dev/null +++ b/docs/html/inherit_graph_9.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/html/inherit_graph_9.md5 b/docs/html/inherit_graph_9.md5 new file mode 100644 index 00000000..bd1d7d34 --- /dev/null +++ b/docs/html/inherit_graph_9.md5 @@ -0,0 +1 @@ +918e300129ef2b935b62e663b88c1a8f \ No newline at end of file diff --git a/docs/html/inherit_graph_9.png b/docs/html/inherit_graph_9.png new file mode 100644 index 00000000..dc60df90 Binary files /dev/null and b/docs/html/inherit_graph_9.png differ diff --git a/docs/html/search/classes_9.html b/docs/html/search/classes_9.html new file mode 100644 index 00000000..86cad046 --- /dev/null +++ b/docs/html/search/classes_9.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/html/search/classes_9.js b/docs/html/search/classes_9.js new file mode 100644 index 00000000..f29400d3 --- /dev/null +++ b/docs/html/search/classes_9.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['tvg_5fcolor_5fstop_269',['Tvg_Color_Stop',['../structTvg__Color__Stop.html',1,'']]], + ['tvg_5fmatrix_270',['Tvg_Matrix',['../structTvg__Matrix.html',1,'']]], + ['tvg_5fpoint_271',['Tvg_Point',['../structTvg__Point.html',1,'']]] +]; diff --git a/docs/html/search/enums_6.html b/docs/html/search/enums_6.html new file mode 100644 index 00000000..7dd141e9 --- /dev/null +++ b/docs/html/search/enums_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/html/search/enums_6.js b/docs/html/search/enums_6.js new file mode 100644 index 00000000..854bc9ed --- /dev/null +++ b/docs/html/search/enums_6.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['tvg_5fcolorspace_427',['Tvg_Colorspace',['../group__ThorVGCapi__SwCanvas.html#gae038f89e569d85c0896711a0a31b4a78',1,'thorvg_capi.h']]], + ['tvg_5fcomposite_5fmethod_428',['Tvg_Composite_Method',['../group__ThorVGCapi__Paint.html#ga1ec9193ca6959f9d91a80cc61cd0df3a',1,'thorvg_capi.h']]], + ['tvg_5fengine_429',['Tvg_Engine',['../group__ThorVGCapi__Initializer.html#gaa61c2088915fc211ac91ffafaf45f695',1,'thorvg_capi.h']]], + ['tvg_5ffill_5frule_430',['Tvg_Fill_Rule',['../group__ThorVGCapi__Shape.html#gaffafa3cd9dc4bc90a7ef3c763add2695',1,'thorvg_capi.h']]], + ['tvg_5fmempool_5fpolicy_431',['Tvg_Mempool_Policy',['../group__ThorVGCapi__SwCanvas.html#gae63c2c2eee33be6410d3c8a013067b47',1,'thorvg_capi.h']]], + ['tvg_5fpath_5fcommand_432',['Tvg_Path_Command',['../group__ThorVGCapi__Shape.html#ga08e05d64247332603a624cea6597be77',1,'thorvg_capi.h']]], + ['tvg_5fresult_433',['Tvg_Result',['../group__ThorVG__CAPI.html#gad980f552658dcbbe42a0168f35c27781',1,'thorvg_capi.h']]], + ['tvg_5fstroke_5fcap_434',['Tvg_Stroke_Cap',['../group__ThorVGCapi__Shape.html#ga3bcc39b01d899a7e82a6c939740208d3',1,'thorvg_capi.h']]], + ['tvg_5fstroke_5ffill_435',['Tvg_Stroke_Fill',['../group__ThorVGCapi__Shape.html#ga9ac44e712782a9b2a5a36a49b2ae52c7',1,'thorvg_capi.h']]], + ['tvg_5fstroke_5fjoin_436',['Tvg_Stroke_Join',['../group__ThorVGCapi__Shape.html#gaf2cbac2c9164a782b96a8cd94f32e1ed',1,'thorvg_capi.h']]] +]; diff --git a/docs/html/search/enumvalues_10.html b/docs/html/search/enumvalues_10.html new file mode 100644 index 00000000..7107c3d7 --- /dev/null +++ b/docs/html/search/enumvalues_10.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/html/search/enumvalues_10.js b/docs/html/search/enumvalues_10.js new file mode 100644 index 00000000..e43b037a --- /dev/null +++ b/docs/html/search/enumvalues_10.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['winding_503',['Winding',['../group__ThorVG.html#gga9a534b0377c9ca41983d53b0dae0d5a4a268b61c62382fc1f9ca5cf52a4fece32',1,'tvg']]] +]; diff --git a/docs/html/search/groups_1.html b/docs/html/search/groups_1.html new file mode 100644 index 00000000..aa06d658 --- /dev/null +++ b/docs/html/search/groups_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/html/search/groups_1.js b/docs/html/search/groups_1.js new file mode 100644 index 00000000..ffd03767 --- /dev/null +++ b/docs/html/search/groups_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['gradient_505',['Gradient',['../group__ThorVGCapi__Gradient.html',1,'']]] +]; diff --git a/docs/html/search/groups_2.html b/docs/html/search/groups_2.html new file mode 100644 index 00000000..a205d30d --- /dev/null +++ b/docs/html/search/groups_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/html/search/groups_2.js b/docs/html/search/groups_2.js new file mode 100644 index 00000000..ee2398b9 --- /dev/null +++ b/docs/html/search/groups_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['initializer_506',['Initializer',['../group__ThorVGCapi__Initializer.html',1,'']]] +]; diff --git a/docs/html/search/groups_3.html b/docs/html/search/groups_3.html new file mode 100644 index 00000000..4255bed4 --- /dev/null +++ b/docs/html/search/groups_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/html/search/groups_3.js b/docs/html/search/groups_3.js new file mode 100644 index 00000000..f71d5168 --- /dev/null +++ b/docs/html/search/groups_3.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['paint_507',['Paint',['../group__ThorVGCapi__Paint.html',1,'']]], + ['picture_508',['Picture',['../group__ThorVGCapi__Picture.html',1,'']]] +]; diff --git a/docs/html/search/groups_4.html b/docs/html/search/groups_4.html new file mode 100644 index 00000000..8644fbe7 --- /dev/null +++ b/docs/html/search/groups_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/html/search/groups_4.js b/docs/html/search/groups_4.js new file mode 100644 index 00000000..e3d9a1b4 --- /dev/null +++ b/docs/html/search/groups_4.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['saver_509',['Saver',['../group__ThorVGCapi__Saver.html',1,'']]], + ['scene_510',['Scene',['../group__ThorVGCapi__Scene.html',1,'']]], + ['shape_511',['Shape',['../group__ThorVGCapi__Shape.html',1,'']]], + ['swcanvas_512',['SwCanvas',['../group__ThorVGCapi__SwCanvas.html',1,'']]] +]; diff --git a/docs/html/search/groups_5.html b/docs/html/search/groups_5.html new file mode 100644 index 00000000..1e9ba853 --- /dev/null +++ b/docs/html/search/groups_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/html/search/groups_5.js b/docs/html/search/groups_5.js new file mode 100644 index 00000000..1409cef0 --- /dev/null +++ b/docs/html/search/groups_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['thorvg_513',['ThorVG',['../group__ThorVG.html',1,'']]], + ['thorvg_5fcapi_514',['ThorVG_CAPI',['../group__ThorVG__CAPI.html',1,'']]] +]; diff --git a/docs/html/search/typedefs_0.html b/docs/html/search/typedefs_0.html new file mode 100644 index 00000000..376db479 --- /dev/null +++ b/docs/html/search/typedefs_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/html/search/typedefs_0.js b/docs/html/search/typedefs_0.js new file mode 100644 index 00000000..373a51e6 --- /dev/null +++ b/docs/html/search/typedefs_0.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['tvg_5fcanvas_413',['Tvg_Canvas',['../group__ThorVG__CAPI.html#ga5f10c1f3dabdc9287166611c7fe5fd8a',1,'thorvg_capi.h']]], + ['tvg_5fgradient_414',['Tvg_Gradient',['../group__ThorVG__CAPI.html#gafc8e0d01812127260d0753eceb056181',1,'thorvg_capi.h']]], + ['tvg_5fpaint_415',['Tvg_Paint',['../group__ThorVG__CAPI.html#ga98af7c3fe18afa8ad65ea6a6e097a292',1,'thorvg_capi.h']]], + ['tvg_5fsaver_416',['Tvg_Saver',['../group__ThorVG__CAPI.html#gac16750954e423565f6d143a66aa03b31',1,'thorvg_capi.h']]] +]; diff --git a/docs/html/structTvg__Color__Stop-members.html b/docs/html/structTvg__Color__Stop-members.html new file mode 100644 index 00000000..54ebffd0 --- /dev/null +++ b/docs/html/structTvg__Color__Stop-members.html @@ -0,0 +1,87 @@ + + + + + + + +ThorVG: Member List + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
Tvg_Color_Stop Member List
+
+
+ +

This is the complete list of members for Tvg_Color_Stop, including all inherited members.

+ + + + + + +
aTvg_Color_Stop
bTvg_Color_Stop
gTvg_Color_Stop
offsetTvg_Color_Stop
rTvg_Color_Stop
+ + + + diff --git a/docs/html/structTvg__Color__Stop.html b/docs/html/structTvg__Color__Stop.html new file mode 100644 index 00000000..dcd41a36 --- /dev/null +++ b/docs/html/structTvg__Color__Stop.html @@ -0,0 +1,177 @@ + + + + + + + +ThorVG: Tvg_Color_Stop + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+Public Attributes | +List of all members
+
+
Tvg_Color_Stop
+
+
+ +

A data structure storing the information about the color and its relative position inside the gradient bounds. + More...

+ + + + + + + + + + + + +

+Public Attributes

float offset
 
uint8_t r
 
uint8_t g
 
uint8_t b
 
uint8_t a
 
+

Detailed Description

+

A data structure storing the information about the color and its relative position inside the gradient bounds.

+

Member Data Documentation

+ +

◆ a

+ +
+
+ + + + +
uint8_t a
+
+

The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque.

+ +
+
+ +

◆ b

+ +
+
+ + + + +
uint8_t b
+
+

The blue color channel value in the range [0 ~ 255].

+ +
+
+ +

◆ g

+ +
+
+ + + + +
uint8_t g
+
+

The green color channel value in the range [0 ~ 255].

+ +
+
+ +

◆ offset

+ +
+
+ + + + +
float offset
+
+

The relative position of the color.

+ +
+
+ +

◆ r

+ +
+
+ + + + +
uint8_t r
+
+

The red color channel value in the range [0 ~ 255].

+ +
+
+
+ + + + diff --git a/docs/html/structTvg__Matrix-members.html b/docs/html/structTvg__Matrix-members.html new file mode 100644 index 00000000..8de3ed79 --- /dev/null +++ b/docs/html/structTvg__Matrix-members.html @@ -0,0 +1,81 @@ + + + + + + + +ThorVG: Member List + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
Tvg_Matrix Member List
+
+
+ +

This is the complete list of members for Tvg_Matrix, including all inherited members.

+
+ + + + diff --git a/docs/html/structTvg__Matrix.html b/docs/html/structTvg__Matrix.html new file mode 100644 index 00000000..9edc62b8 --- /dev/null +++ b/docs/html/structTvg__Matrix.html @@ -0,0 +1,87 @@ + + + + + + + +ThorVG: Tvg_Matrix + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+List of all members
+
+
Tvg_Matrix
+
+
+ +

A data structure representing a three-dimensional matrix. + More...

+

Detailed Description

+

A data structure representing a three-dimensional matrix.

+

The elements e11, e12, e21 and e22 represent the rotation matrix, including the scaling factor. The elements e13 and e23 determine the translation of the object along the x and y-axis, respectively. The elements e31 and e32 are set to 0, e33 is set to 1.

+
+ + + + diff --git a/docs/html/structTvg__Point-members.html b/docs/html/structTvg__Point-members.html new file mode 100644 index 00000000..f971c87e --- /dev/null +++ b/docs/html/structTvg__Point-members.html @@ -0,0 +1,81 @@ + + + + + + + +ThorVG: Member List + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
Tvg_Point Member List
+
+
+ +

This is the complete list of members for Tvg_Point, including all inherited members.

+
+ + + + diff --git a/docs/html/structTvg__Point.html b/docs/html/structTvg__Point.html new file mode 100644 index 00000000..73450752 --- /dev/null +++ b/docs/html/structTvg__Point.html @@ -0,0 +1,86 @@ + + + + + + + +ThorVG: Tvg_Point + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+List of all members
+
+
Tvg_Point
+
+
+ +

A data structure representing a point in two-dimensional space. + More...

+

Detailed Description

+

A data structure representing a point in two-dimensional space.

+
+ + + + diff --git a/docs/html/thorvg__capi_8h_source.html b/docs/html/thorvg__capi_8h_source.html new file mode 100644 index 00000000..431db4be --- /dev/null +++ b/docs/html/thorvg__capi_8h_source.html @@ -0,0 +1,668 @@ + + + + + + + +ThorVG: tmp/thorvg_capi.h Source File + + + + + + + + + + +
+
+ + + + + + + +
+
ThorVG +  v0.6 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
thorvg_capi.h
+
+
+
1 
+
18 #ifndef __THORVG_CAPI_H__
+
19 #define __THORVG_CAPI_H__
+
20 
+
21 #include <stdint.h>
+
22 #include <stdbool.h>
+
23 
+
24 #ifdef TVG_EXPORT
+
25  #undef TVG_EXPORT
+
26 #endif
+
27 
+
28 #ifdef TVG_BUILD
+
29  #ifdef _WIN32
+
30  #define TVG_EXPORT __declspec(dllexport)
+
31  #else
+
32  #define TVG_EXPORT __attribute__ ((visibility ("default")))
+
33  #endif
+
34 #else
+
35  #define TVG_EXPORT
+
36 #endif
+
37 
+
38 #ifdef __cplusplus
+
39 extern "C" {
+
40 #endif
+
41 
+
55 typedef struct _Tvg_Canvas Tvg_Canvas;
+
56 
+
57 
+
63 typedef struct _Tvg_Paint Tvg_Paint;
+
64 
+
65 
+
69 typedef struct _Tvg_Gradient Tvg_Gradient;
+
70 
+
71 
+
75 typedef struct _Tvg_Saver Tvg_Saver;
+
76 
+
77 
+
83 typedef enum {
+
84  TVG_ENGINE_SW = (1 << 1),
+
85  TVG_ENGINE_GL = (1 << 2)
+
86 } Tvg_Engine;
+
87 
+
88 
+
92 typedef enum {
+ + + + + + + +
100 } Tvg_Result;
+
101 
+
102 
+
108 typedef enum {
+ + + + + +
114 
+
115 
+
127 typedef enum {
+ + + + + +
133 
+
134 
+
138 typedef enum {
+ + + + +
143 
+
144 
+
148 typedef enum {
+ + + + +
153 
+
154 
+
158 typedef enum {
+ + + + +
163 
+
164 
+
168 typedef enum {
+ + +
171 } Tvg_Fill_Rule;
+
172  // end addtogroup ThorVGCapi_Shape
+
174 
+
175 
+
184 typedef struct
+
185 {
+
186  float offset;
+
187  uint8_t r;
+
188  uint8_t g;
+
189  uint8_t b;
+
190  uint8_t a;
+ +
192  // end addtogroup ThorVGCapi_Gradient
+
194 
+
195 
+
199 typedef struct
+
200 {
+
201  float x, y;
+
202 } Tvg_Point;
+
203 
+
204 
+
212 typedef struct
+
213 {
+
214  float e11, e12, e13;
+
215  float e21, e22, e23;
+
216  float e31, e32, e33;
+
217 } Tvg_Matrix;
+
218 
+
219 
+
227 /************************************************************************/
+
228 /* Engine API */
+
229 /************************************************************************/
+
258 TVG_EXPORT Tvg_Result tvg_engine_init(Tvg_Engine engine_method, unsigned threads);
+
259 
+
260 
+
286 TVG_EXPORT Tvg_Result tvg_engine_term(Tvg_Engine engine_method);
+
287 
+
288  // end defgroup ThorVGCapi_Initializer
+
290 
+
291 
+
313 /************************************************************************/
+
314 /* SwCanvas API */
+
315 /************************************************************************/
+
316 
+
320 typedef enum {
+ + + + +
325 
+
326 
+
330 typedef enum {
+ + + +
334 
+
335 
+
360 TVG_EXPORT Tvg_Canvas* tvg_swcanvas_create();
+
361 
+
362 
+
388 TVG_EXPORT Tvg_Result tvg_swcanvas_set_target(Tvg_Canvas* canvas, uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, Tvg_Colorspace cs);
+
389 
+
390 
+ +
416  // end defgroup ThorVGCapi_SwCanvas
+
418 
+
419 
+
420 /************************************************************************/
+
421 /* Common Canvas API */
+
422 /************************************************************************/
+
484 TVG_EXPORT Tvg_Result tvg_canvas_destroy(Tvg_Canvas* canvas);
+
485 
+
486 
+
505 TVG_EXPORT Tvg_Result tvg_canvas_push(Tvg_Canvas* canvas, Tvg_Paint* paint);
+
506 
+
507 
+
539 TVG_EXPORT Tvg_Result tvg_canvas_reserve(Tvg_Canvas* canvas, uint32_t n);
+
540 
+
541 
+
559 TVG_EXPORT Tvg_Result tvg_canvas_clear(Tvg_Canvas* canvas, bool free);
+
560 
+
561 
+
619 TVG_EXPORT Tvg_Result tvg_canvas_update(Tvg_Canvas* canvas);
+
620 
+
621 
+
637 TVG_EXPORT Tvg_Result tvg_canvas_update_paint(Tvg_Canvas* canvas, Tvg_Paint* paint);
+
638 
+
639 
+
655 TVG_EXPORT Tvg_Result tvg_canvas_draw(Tvg_Canvas* canvas);
+
656 
+
657 
+
672 TVG_EXPORT Tvg_Result tvg_canvas_sync(Tvg_Canvas* canvas);
+
673 
+
674  // end defgroup ThorVGCapi_Canvas
+
676 
+
677 
+
685 /************************************************************************/
+
686 /* Paint API */
+
687 /************************************************************************/
+
718 TVG_EXPORT Tvg_Result tvg_paint_del(Tvg_Paint* paint);
+
719 
+
720 
+
732 TVG_EXPORT Tvg_Result tvg_paint_scale(Tvg_Paint* paint, float factor);
+
733 
+
734 
+
749 TVG_EXPORT Tvg_Result tvg_paint_rotate(Tvg_Paint* paint, float degree);
+
750 
+
751 
+
767 TVG_EXPORT Tvg_Result tvg_paint_translate(Tvg_Paint* paint, float x, float y);
+
768 
+
769 
+
783 TVG_EXPORT Tvg_Result tvg_paint_set_transform(Tvg_Paint* paint, const Tvg_Matrix* m);
+
784 
+
785 
+ +
799 
+
800 
+
813 TVG_EXPORT Tvg_Result tvg_paint_set_opacity(Tvg_Paint* paint, uint8_t opacity);
+
814 
+
815 
+
826 TVG_EXPORT Tvg_Result tvg_paint_get_opacity(const Tvg_Paint* paint, uint8_t* opacity);
+
827 
+
828 
+
838 TVG_EXPORT Tvg_Paint* tvg_paint_duplicate(Tvg_Paint* paint);
+
839 
+
840 
+
858 TVG_EXPORT Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h, bool transformed);
+
859 
+
860 
+ +
873 
+
874 
+
886 TVG_EXPORT Tvg_Result tvg_paint_get_composite_method(const Tvg_Paint* paint, const Tvg_Paint** target, Tvg_Composite_Method* method);
+
887  // end defgroup ThorVGCapi_Paint
+
889 
+
890 
+
906 /************************************************************************/
+
907 /* Shape API */
+
908 /************************************************************************/
+
914 TVG_EXPORT Tvg_Paint* tvg_shape_new();
+
915 
+
916 
+
930 TVG_EXPORT Tvg_Result tvg_shape_reset(Tvg_Paint* paint);
+
931 
+
932 
+
946 TVG_EXPORT Tvg_Result tvg_shape_move_to(Tvg_Paint* paint, float x, float y);
+
947 
+
948 
+
964 TVG_EXPORT Tvg_Result tvg_shape_line_to(Tvg_Paint* paint, float x, float y);
+
965 
+
966 
+
987 TVG_EXPORT Tvg_Result tvg_shape_cubic_to(Tvg_Paint* paint, float cx1, float cy1, float cx2, float cy2, float x, float y);
+
988 
+
989 
+
1003 TVG_EXPORT Tvg_Result tvg_shape_close(Tvg_Paint* paint);
+
1004 
+
1005 
+
1033 TVG_EXPORT Tvg_Result tvg_shape_append_rect(Tvg_Paint* paint, float x, float y, float w, float h, float rx, float ry);
+
1034 
+
1035 
+
1055 TVG_EXPORT Tvg_Result tvg_shape_append_circle(Tvg_Paint* paint, float cx, float cy, float rx, float ry);
+
1056 
+
1057 
+
1078 TVG_EXPORT Tvg_Result tvg_shape_append_arc(Tvg_Paint* paint, float cx, float cy, float radius, float startAngle, float sweep, uint8_t pie);
+
1079 
+
1080 
+
1098 TVG_EXPORT Tvg_Result tvg_shape_append_path(Tvg_Paint* paint, const Tvg_Path_Command* cmds, uint32_t cmdCnt, const Tvg_Point* pts, uint32_t ptsCnt);
+
1099 
+
1100 
+
1124 TVG_EXPORT Tvg_Result tvg_shape_get_path_coords(const Tvg_Paint* paint, const Tvg_Point** pts, uint32_t* cnt);
+
1125 
+
1126 
+
1150 TVG_EXPORT Tvg_Result tvg_shape_get_path_commands(const Tvg_Paint* paint, const Tvg_Path_Command** cmds, uint32_t* cnt);
+
1151 
+
1152 
+
1164 TVG_EXPORT Tvg_Result tvg_shape_set_stroke_width(Tvg_Paint* paint, float width);
+
1165 
+
1166 
+
1177 TVG_EXPORT Tvg_Result tvg_shape_get_stroke_width(const Tvg_Paint* paint, float* width);
+
1178 
+
1179 
+
1196 TVG_EXPORT Tvg_Result tvg_shape_set_stroke_color(Tvg_Paint* paint, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
+
1197 
+
1198 
+
1213 TVG_EXPORT Tvg_Result tvg_shape_get_stroke_color(const Tvg_Paint* paint, uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a);
+
1214 
+
1215 
+ +
1231 
+
1232 
+ +
1248 
+
1249 
+
1262 TVG_EXPORT Tvg_Result tvg_shape_get_stroke_gradient(const Tvg_Paint* paint, Tvg_Gradient** grad);
+
1263 
+
1264 
+
1286 TVG_EXPORT Tvg_Result tvg_shape_set_stroke_dash(Tvg_Paint* paint, const float* dashPattern, uint32_t cnt);
+
1287 
+
1288 
+
1302 TVG_EXPORT Tvg_Result tvg_shape_get_stroke_dash(const Tvg_Paint* paint, const float** dashPattern, uint32_t* cnt);
+
1303 
+
1304 
+ +
1319 
+
1320 
+
1331 TVG_EXPORT Tvg_Result tvg_shape_get_stroke_cap(const Tvg_Paint* paint, Tvg_Stroke_Cap* cap);
+
1332 
+
1333 
+ +
1346 
+
1347 
+
1358 TVG_EXPORT Tvg_Result tvg_shape_get_stroke_join(const Tvg_Paint* paint, Tvg_Stroke_Join* join);
+
1359 
+
1360 
+
1379 TVG_EXPORT Tvg_Result tvg_shape_set_fill_color(Tvg_Paint* paint, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
+
1380 
+
1381 
+
1395 TVG_EXPORT Tvg_Result tvg_shape_get_fill_color(const Tvg_Paint* paint, uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a);
+
1396 
+
1397 
+ +
1409 
+
1410 
+
1421 TVG_EXPORT Tvg_Result tvg_shape_get_fill_rule(const Tvg_Paint* paint, Tvg_Fill_Rule* rule);
+
1422 
+
1423 
+ +
1455 
+
1456 
+ +
1488 
+
1489 
+
1502 TVG_EXPORT Tvg_Result tvg_shape_get_gradient(const Tvg_Paint* paint, Tvg_Gradient** grad);
+
1503 
+
1504  // end defgroup ThorVGCapi_Shape
+
1506 
+
1507 
+
1519 /************************************************************************/
+
1520 /* Gradient API */
+
1521 /************************************************************************/
+ +
1542 
+
1543 
+ +
1564 
+
1565 
+
1585 TVG_EXPORT Tvg_Result tvg_linear_gradient_set(Tvg_Gradient* grad, float x1, float y1, float x2, float y2);
+
1586 
+
1587 
+
1605 TVG_EXPORT Tvg_Result tvg_linear_gradient_get(Tvg_Gradient* grad, float* x1, float* y1, float* x2, float* y2);
+
1606 
+
1607 
+
1622 TVG_EXPORT Tvg_Result tvg_radial_gradient_set(Tvg_Gradient* grad, float cx, float cy, float radius);
+
1623 
+
1624 
+
1637 TVG_EXPORT Tvg_Result tvg_radial_gradient_get(Tvg_Gradient* grad, float* cx, float* cy, float* radius);
+
1638 
+
1639 
+
1651 TVG_EXPORT Tvg_Result tvg_gradient_set_color_stops(Tvg_Gradient* grad, const Tvg_Color_Stop* color_stop, uint32_t cnt);
+
1652 
+
1653 
+
1667 TVG_EXPORT Tvg_Result tvg_gradient_get_color_stops(const Tvg_Gradient* grad, const Tvg_Color_Stop** color_stop, uint32_t* cnt);
+
1668 
+
1669 
+
1680 TVG_EXPORT Tvg_Result tvg_gradient_set_spread(Tvg_Gradient* grad, const Tvg_Stroke_Fill spread);
+
1681 
+
1682 
+
1693 TVG_EXPORT Tvg_Result tvg_gradient_get_spread(const Tvg_Gradient* grad, Tvg_Stroke_Fill* spread);
+
1694 
+
1695 
+
1709 TVG_EXPORT Tvg_Result tvg_gradient_set_transform(Tvg_Gradient* grad, const Tvg_Matrix* m);
+
1710 
+
1711 
+
1724 TVG_EXPORT Tvg_Result tvg_gradient_get_transform(const Tvg_Gradient* grad, Tvg_Matrix* m);
+
1725 
+
1726 
+ +
1737 
+
1738 
+
1748 TVG_EXPORT Tvg_Result tvg_gradient_del(Tvg_Gradient* grad);
+
1749 
+
1750  // end defgroup ThorVGCapi_Gradient
+
1752 
+
1753 
+
1763 /************************************************************************/
+
1764 /* Picture API */
+
1765 /************************************************************************/
+
1771 TVG_EXPORT Tvg_Paint* tvg_picture_new();
+
1772 
+
1773 
+
1786 TVG_EXPORT Tvg_Result tvg_picture_load(Tvg_Paint* paint, const char* path);
+
1787 
+
1788 
+
1798 TVG_EXPORT Tvg_Result tvg_picture_load_raw(Tvg_Paint* paint, uint32_t *data, uint32_t w, uint32_t h, bool copy);
+
1799 
+
1800 
+
1818 TVG_EXPORT Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size, const char *mimetype, bool copy);
+
1819 
+
1820 
+
1835 TVG_EXPORT Tvg_Result tvg_picture_set_size(Tvg_Paint* paint, float w, float h);
+
1836 
+
1837 
+
1848 TVG_EXPORT Tvg_Result tvg_picture_get_size(const Tvg_Paint* paint, float* w, float* h);
+
1849 
+
1850 
+
1856 TVG_EXPORT Tvg_Result tvg_picture_get_viewbox(const Tvg_Paint* paint, float* x, float* y, float* w, float* h);
+
1857 
+
1858  // end defgroup ThorVGCapi_Picture
+
1860 
+
1861 
+
1872 /************************************************************************/
+
1873 /* Scene API */
+
1874 /************************************************************************/
+
1882 TVG_EXPORT Tvg_Paint* tvg_scene_new();
+
1883 
+
1884 
+
1899 TVG_EXPORT Tvg_Result tvg_scene_reserve(Tvg_Paint* scene, uint32_t size);
+
1900 
+
1901 
+
1920 TVG_EXPORT Tvg_Result tvg_scene_push(Tvg_Paint* scene, Tvg_Paint* paint);
+
1921 
+
1922 
+
1938 TVG_EXPORT Tvg_Result tvg_scene_clear(Tvg_Paint* scene, bool free);
+
1939  // end defgroup ThorVGCapi_Scene
+
1941 
+
1942 
+
1953 /************************************************************************/
+
1954 /* Saver API */
+
1955 /************************************************************************/
+
1961 TVG_EXPORT Tvg_Saver* tvg_saver_new();
+
1962 
+
1963 
+
1987 TVG_EXPORT Tvg_Result tvg_saver_save(Tvg_Saver* saver, Tvg_Paint* paint, const char* path, bool compress);
+
1988 
+
1989 
+
2007 TVG_EXPORT Tvg_Result tvg_saver_sync(Tvg_Saver* saver);
+
2008 
+
2009 
+
2019 TVG_EXPORT Tvg_Result tvg_saver_del(Tvg_Saver* saver);
+
2020 
+
2021  // end defgroup ThorVGCapi_Saver
+
2023 
+
2024  // end defgroup ThorVG_CAPI
+
2026 
+
2027 
+
2028 #ifdef __cplusplus
+
2029 }
+
2030 #endif
+
2031 
+
2032 #endif //_THORVG_CAPI_H_
+
+
tvg_paint_set_opacity
TVG_EXPORT Tvg_Result tvg_paint_set_opacity(Tvg_Paint *paint, uint8_t opacity)
Sets the opacity of the given Tvg_Paint.
+
tvg_paint_get_transform
TVG_EXPORT Tvg_Result tvg_paint_get_transform(Tvg_Paint *paint, Tvg_Matrix *m)
Gets the matrix of the affine transformation of the given Tvg_Paint object.
+
tvg_shape_get_fill_rule
TVG_EXPORT Tvg_Result tvg_shape_get_fill_rule(const Tvg_Paint *paint, Tvg_Fill_Rule *rule)
Gets the shape's fill rule.
+
tvg_gradient_set_color_stops
TVG_EXPORT Tvg_Result tvg_gradient_set_color_stops(Tvg_Gradient *grad, const Tvg_Color_Stop *color_stop, uint32_t cnt)
Sets the parameters of the colors of the gradient and their position.
+
Tvg_Matrix
A data structure representing a three-dimensional matrix.
Definition: thorvg_capi.h:212
+
tvg_scene_clear
TVG_EXPORT Tvg_Result tvg_scene_clear(Tvg_Paint *scene, bool free)
Clears a Tvg_Scene objects from pushed paints.
+
tvg_shape_set_fill_color
TVG_EXPORT Tvg_Result tvg_shape_set_fill_color(Tvg_Paint *paint, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Sets the shape's solid color.
+
tvg_gradient_get_spread
TVG_EXPORT Tvg_Result tvg_gradient_get_spread(const Tvg_Gradient *grad, Tvg_Stroke_Fill *spread)
Gets the FillSpread value of the gradient object.
+
tvg_scene_reserve
TVG_EXPORT Tvg_Result tvg_scene_reserve(Tvg_Paint *scene, uint32_t size)
Sets the size of the container, where all the paints pushed into the scene are stored.
+
tvg_paint_get_composite_method
TVG_EXPORT Tvg_Result tvg_paint_get_composite_method(const Tvg_Paint *paint, const Tvg_Paint **target, Tvg_Composite_Method *method)
Gets the composition target object and the composition method.
+
TVG_FILL_RULE_WINDING
@ TVG_FILL_RULE_WINDING
A line from the point to a location outside the shape is drawn. The intersections of the line with th...
Definition: thorvg_capi.h:169
+
TVG_RESULT_FAILED_ALLOCATION
@ TVG_RESULT_FAILED_ALLOCATION
The value returned in case of unsuccessful memory allocation.
Definition: thorvg_capi.h:96
+
tvg_shape_append_rect
TVG_EXPORT Tvg_Result tvg_shape_append_rect(Tvg_Paint *paint, float x, float y, float w, float h, float rx, float ry)
Appends a rectangle to the path.
+
tvg_radial_gradient_get
TVG_EXPORT Tvg_Result tvg_radial_gradient_get(Tvg_Gradient *grad, float *cx, float *cy, float *radius)
The function gets radial gradient center point ant radius.
+
tvg_shape_get_path_coords
TVG_EXPORT Tvg_Result tvg_shape_get_path_coords(const Tvg_Paint *paint, const Tvg_Point **pts, uint32_t *cnt)
Gets the points values of the path.
+
tvg_canvas_push
TVG_EXPORT Tvg_Result tvg_canvas_push(Tvg_Canvas *canvas, Tvg_Paint *paint)
Inserts a drawing element into the canvas using a Tvg_Paint object.
+
tvg_swcanvas_set_target
TVG_EXPORT Tvg_Result tvg_swcanvas_set_target(Tvg_Canvas *canvas, uint32_t *buffer, uint32_t stride, uint32_t w, uint32_t h, Tvg_Colorspace cs)
Sets the buffer used in the rasterization process and defines the used colorspace.
+
tvg_radial_gradient_new
TVG_EXPORT Tvg_Gradient * tvg_radial_gradient_new()
Creates a new radial gradient object.
+
Tvg_Saver
struct _Tvg_Saver Tvg_Saver
A structure representing an object that enables to save a Tvg_Paint object into a file.
Definition: thorvg_capi.h:75
+
tvg_paint_duplicate
TVG_EXPORT Tvg_Paint * tvg_paint_duplicate(Tvg_Paint *paint)
Duplicates the given Tvg_Paint object.
+
tvg_saver_new
TVG_EXPORT Tvg_Saver * tvg_saver_new()
Creates a new Tvg_Saver object.
+
tvg_saver_sync
TVG_EXPORT Tvg_Result tvg_saver_sync(Tvg_Saver *saver)
Guarantees that the saving task is finished.
+
tvg_shape_get_path_commands
TVG_EXPORT Tvg_Result tvg_shape_get_path_commands(const Tvg_Paint *paint, const Tvg_Path_Command **cmds, uint32_t *cnt)
Gets the commands data of the path.
+
tvg_canvas_sync
TVG_EXPORT Tvg_Result tvg_canvas_sync(Tvg_Canvas *canvas)
Guarantees that the drawing process is finished.
+
tvg_shape_reset
TVG_EXPORT Tvg_Result tvg_shape_reset(Tvg_Paint *paint)
Resets the shape path properties.
+
tvg_shape_set_stroke_radial_gradient
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_radial_gradient(Tvg_Paint *paint, Tvg_Gradient *grad)
Sets the radial gradient fill of the stroke for all of the figures from the path.
+
tvg_swcanvas_set_mempool
TVG_EXPORT Tvg_Result tvg_swcanvas_set_mempool(Tvg_Canvas *canvas, Tvg_Mempool_Policy policy)
Sets the software engine memory pool behavior policy.
+
tvg_canvas_clear
TVG_EXPORT Tvg_Result tvg_canvas_clear(Tvg_Canvas *canvas, bool free)
Sets the total number of the paints pushed into the canvas to be zero. Tvg_Paint objects stored in th...
+
TVG_COMPOSITE_METHOD_ALPHA_MASK
@ TVG_COMPOSITE_METHOD_ALPHA_MASK
The pixels of the source and the target are alpha blended. As a result, only the part of the source,...
Definition: thorvg_capi.h:111
+
TVG_ENGINE_SW
@ TVG_ENGINE_SW
CPU rasterizer.
Definition: thorvg_capi.h:84
+
tvg_paint_del
TVG_EXPORT Tvg_Result tvg_paint_del(Tvg_Paint *paint)
Releases the given Tvg_Paint object.
+
Tvg_Color_Stop::a
uint8_t a
Definition: thorvg_capi.h:190
+
tvg_paint_get_opacity
TVG_EXPORT Tvg_Result tvg_paint_get_opacity(const Tvg_Paint *paint, uint8_t *opacity)
Gets the opacity of the given Tvg_Paint.
+
Tvg_Composite_Method
Tvg_Composite_Method
Enumeration indicating the method used in the composition of two objects - the target and the source.
Definition: thorvg_capi.h:108
+
tvg_shape_set_stroke_cap
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_cap(Tvg_Paint *paint, Tvg_Stroke_Cap cap)
Sets the cap style used for stroking the path.
+
Tvg_Canvas
struct _Tvg_Canvas Tvg_Canvas
A structure responsible for managing and drawing graphical elements.
Definition: thorvg_capi.h:55
+
tvg_canvas_update
TVG_EXPORT Tvg_Result tvg_canvas_update(Tvg_Canvas *canvas)
Updates all paints in a canvas.
+
tvg_gradient_set_spread
TVG_EXPORT Tvg_Result tvg_gradient_set_spread(Tvg_Gradient *grad, const Tvg_Stroke_Fill spread)
Sets the Tvg_Stroke_Fill value, which specifies how to fill the area outside the gradient bounds.
+
tvg_shape_set_stroke_join
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_join(Tvg_Paint *paint, Tvg_Stroke_Join join)
Sets the join style for stroked path segments.
+
Tvg_Engine
Tvg_Engine
Enumeration specifying the engine type used for the graphics backend. For multiple backends bitwise o...
Definition: thorvg_capi.h:83
+
Tvg_Color_Stop::r
uint8_t r
Definition: thorvg_capi.h:187
+
tvg_gradient_del
TVG_EXPORT Tvg_Result tvg_gradient_del(Tvg_Gradient *grad)
Deletes the given gradient object.
+
tvg_canvas_draw
TVG_EXPORT Tvg_Result tvg_canvas_draw(Tvg_Canvas *canvas)
Requests the canvas to draw the Tvg_Paint objects.
+
Tvg_Mempool_Policy
Tvg_Mempool_Policy
Enumeration specifying the methods of Memory Pool behavior policy.
Definition: thorvg_capi.h:320
+
TVG_STROKE_CAP_BUTT
@ TVG_STROKE_CAP_BUTT
The stroke ends exactly at each of the two endpoints of a sub-path. For zero length sub-paths no stro...
Definition: thorvg_capi.h:141
+
tvg_picture_get_viewbox
TVG_EXPORT Tvg_Result tvg_picture_get_viewbox(const Tvg_Paint *paint, float *x, float *y, float *w, float *h)
Gets the position and the size of the loaded picture. (BETA_API)
+
Tvg_Fill_Rule
Tvg_Fill_Rule
Enumeration specifying the algorithm used to establish which parts of the shape are treated as the in...
Definition: thorvg_capi.h:168
+
tvg_paint_translate
TVG_EXPORT Tvg_Result tvg_paint_translate(Tvg_Paint *paint, float x, float y)
Moves the given Tvg_Paint in a two-dimensional space.
+
tvg_shape_get_stroke_color
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_color(const Tvg_Paint *paint, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *a)
Gets the shape's stroke color.
+
tvg_shape_set_fill_rule
TVG_EXPORT Tvg_Result tvg_shape_set_fill_rule(Tvg_Paint *paint, Tvg_Fill_Rule rule)
Sets the shape's fill rule.
+
tvg_scene_new
TVG_EXPORT Tvg_Paint * tvg_scene_new()
Creates a new scene object.
+
TVG_MEMPOOL_POLICY_SHAREABLE
@ TVG_MEMPOOL_POLICY_SHAREABLE
Memory Pool is shared among canvases.
Definition: thorvg_capi.h:322
+
Tvg_Point
A data structure representing a point in two-dimensional space.
Definition: thorvg_capi.h:199
+
TVG_RESULT_UNKNOWN
@ TVG_RESULT_UNKNOWN
The value returned in all other cases.
Definition: thorvg_capi.h:99
+
TVG_PATH_COMMAND_LINE_TO
@ TVG_PATH_COMMAND_LINE_TO
Draws a line from the current point to the given point and sets a new value of the current point - co...
Definition: thorvg_capi.h:130
+
TVG_FILL_RULE_EVEN_ODD
@ TVG_FILL_RULE_EVEN_ODD
A line from the point to a location outside the shape is drawn and its intersections with the path se...
Definition: thorvg_capi.h:170
+
tvg_swcanvas_create
TVG_EXPORT Tvg_Canvas * tvg_swcanvas_create()
Creates a Canvas object.
+
Tvg_Colorspace
Tvg_Colorspace
Enumeration specifying the methods of combining the 8-bit color channels into 32-bit color.
Definition: thorvg_capi.h:330
+
Tvg_Color_Stop::g
uint8_t g
Definition: thorvg_capi.h:188
+
tvg_shape_new
TVG_EXPORT Tvg_Paint * tvg_shape_new()
Creates a new shape object.
+
tvg_engine_init
TVG_EXPORT Tvg_Result tvg_engine_init(Tvg_Engine engine_method, unsigned threads)
Initializes TVG engines.
+
tvg_shape_set_linear_gradient
TVG_EXPORT Tvg_Result tvg_shape_set_linear_gradient(Tvg_Paint *paint, Tvg_Gradient *grad)
Sets the linear gradient fill for all of the figures from the path.
+
TVG_MEMPOOL_POLICY_DEFAULT
@ TVG_MEMPOOL_POLICY_DEFAULT
Default behavior that ThorVG is designed to.
Definition: thorvg_capi.h:321
+
tvg_shape_get_stroke_cap
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_cap(const Tvg_Paint *paint, Tvg_Stroke_Cap *cap)
Gets the stroke cap style used for stroking the path.
+
tvg_shape_append_circle
TVG_EXPORT Tvg_Result tvg_shape_append_circle(Tvg_Paint *paint, float cx, float cy, float rx, float ry)
Appends an ellipse to the path.
+
TVG_STROKE_JOIN_BEVEL
@ TVG_STROKE_JOIN_BEVEL
The outer corner of the joined path segments is bevelled at the join point. The triangular region of ...
Definition: thorvg_capi.h:149
+
tvg_paint_scale
TVG_EXPORT Tvg_Result tvg_paint_scale(Tvg_Paint *paint, float factor)
Scales the given Tvg_Paint object by the given factor.
+
tvg_picture_load
TVG_EXPORT Tvg_Result tvg_picture_load(Tvg_Paint *paint, const char *path)
Loads a picture data directly from a file.
+
tvg_scene_push
TVG_EXPORT Tvg_Result tvg_scene_push(Tvg_Paint *scene, Tvg_Paint *paint)
Passes drawing elements to the scene using Tvg_Paint objects.
+
tvg_radial_gradient_set
TVG_EXPORT Tvg_Result tvg_radial_gradient_set(Tvg_Gradient *grad, float cx, float cy, float radius)
Sets the radial gradient bounds.
+
TVG_ENGINE_GL
@ TVG_ENGINE_GL
OpenGL rasterizer.
Definition: thorvg_capi.h:85
+
TVG_MEMPOOL_POLICY_INDIVIDUAL
@ TVG_MEMPOOL_POLICY_INDIVIDUAL
Allocate designated memory pool that is used only by the current canvas instance.
Definition: thorvg_capi.h:323
+
tvg_linear_gradient_get
TVG_EXPORT Tvg_Result tvg_linear_gradient_get(Tvg_Gradient *grad, float *x1, float *y1, float *x2, float *y2)
Gets the linear gradient bounds.
+
Tvg_Result
Tvg_Result
Enumeration specifying the result from the APIs.
Definition: thorvg_capi.h:92
+
TVG_STROKE_CAP_SQUARE
@ TVG_STROKE_CAP_SQUARE
The stroke is extended in both endpoints of a sub-path by a rectangle, with the width equal to the st...
Definition: thorvg_capi.h:139
+
tvg_shape_append_path
TVG_EXPORT Tvg_Result tvg_shape_append_path(Tvg_Paint *paint, const Tvg_Path_Command *cmds, uint32_t cmdCnt, const Tvg_Point *pts, uint32_t ptsCnt)
Appends a given sub-path to the path.
+
TVG_COMPOSITE_METHOD_NONE
@ TVG_COMPOSITE_METHOD_NONE
No composition is applied.
Definition: thorvg_capi.h:109
+
tvg_gradient_get_transform
TVG_EXPORT Tvg_Result tvg_gradient_get_transform(const Tvg_Gradient *grad, Tvg_Matrix *m)
Gets the matrix of the affine transformation of the gradient object. (BETA_API)
+
tvg_shape_get_stroke_width
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_width(const Tvg_Paint *paint, float *width)
Gets the shape's stroke width.
+
tvg_picture_load_raw
TVG_EXPORT Tvg_Result tvg_picture_load_raw(Tvg_Paint *paint, uint32_t *data, uint32_t w, uint32_t h, bool copy)
Loads a picture data from a memory block of a given size. (BETA_API)
+
TVG_COLORSPACE_ARGB8888
@ TVG_COLORSPACE_ARGB8888
The 8-bit color channels are combined into 32-bit color in the order: alpha, red, green,...
Definition: thorvg_capi.h:332
+
tvg_shape_get_stroke_dash
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_dash(const Tvg_Paint *paint, const float **dashPattern, uint32_t *cnt)
Gets the dash pattern of the stroke.
+
TVG_STROKE_FILL_REFLECT
@ TVG_STROKE_FILL_REFLECT
The gradient pattern is reflected outside the gradient area until the expected region is filled.
Definition: thorvg_capi.h:160
+
tvg_paint_set_transform
TVG_EXPORT Tvg_Result tvg_paint_set_transform(Tvg_Paint *paint, const Tvg_Matrix *m)
Transforms the given Tvg_Paint using the augmented transformation matrix.
+
tvg_shape_set_stroke_linear_gradient
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_linear_gradient(Tvg_Paint *paint, Tvg_Gradient *grad)
Sets the linear gradient fill of the stroke for all of the figures from the path.
+
tvg_paint_set_composite_method
TVG_EXPORT Tvg_Result tvg_paint_set_composite_method(Tvg_Paint *paint, Tvg_Paint *target, Tvg_Composite_Method method)
Sets the composition target object and the composition method.
+
tvg_shape_get_fill_color
TVG_EXPORT Tvg_Result tvg_shape_get_fill_color(const Tvg_Paint *paint, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *a)
Gets the shape's solid color.
+
TVG_RESULT_NOT_SUPPORTED
@ TVG_RESULT_NOT_SUPPORTED
The value returned in case of choosing unsupported options.
Definition: thorvg_capi.h:98
+
tvg_shape_line_to
TVG_EXPORT Tvg_Result tvg_shape_line_to(Tvg_Paint *paint, float x, float y)
Adds a new point to the sub-path, which results in drawing a line from the current point to the given...
+
TVG_COMPOSITE_METHOD_CLIP_PATH
@ TVG_COMPOSITE_METHOD_CLIP_PATH
The intersection of the source and the target is determined and only the resulting pixels from the so...
Definition: thorvg_capi.h:110
+
tvg_shape_set_stroke_dash
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_dash(Tvg_Paint *paint, const float *dashPattern, uint32_t cnt)
Sets the shape's stroke dash pattern.
+
tvg_gradient_duplicate
TVG_EXPORT Tvg_Gradient * tvg_gradient_duplicate(Tvg_Gradient *grad)
Duplicates the given Tvg_Gradient object.
+
tvg_shape_get_stroke_join
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_join(const Tvg_Paint *paint, Tvg_Stroke_Join *join)
The function gets the stroke join method.
+
Tvg_Stroke_Cap
Tvg_Stroke_Cap
Enumeration determining the ending type of a stroke in the open sub-paths.
Definition: thorvg_capi.h:138
+
TVG_PATH_COMMAND_CLOSE
@ TVG_PATH_COMMAND_CLOSE
Ends the current sub-path and connects it with its initial point - corresponds to Z command in the sv...
Definition: thorvg_capi.h:128
+
TVG_COLORSPACE_ABGR8888
@ TVG_COLORSPACE_ABGR8888
The 8-bit color channels are combined into 32-bit color in the order: alpha, blue,...
Definition: thorvg_capi.h:331
+
Tvg_Stroke_Fill
Tvg_Stroke_Fill
Enumeration specifying how to fill the area outside the gradient bounds.
Definition: thorvg_capi.h:158
+
tvg_paint_rotate
TVG_EXPORT Tvg_Result tvg_paint_rotate(Tvg_Paint *paint, float degree)
Rotates the given Tvg_Paint by the given angle.
+
tvg_linear_gradient_set
TVG_EXPORT Tvg_Result tvg_linear_gradient_set(Tvg_Gradient *grad, float x1, float y1, float x2, float y2)
Sets the linear gradient bounds.
+
Tvg_Color_Stop::offset
float offset
Definition: thorvg_capi.h:186
+
tvg_picture_get_size
TVG_EXPORT Tvg_Result tvg_picture_get_size(const Tvg_Paint *paint, float *w, float *h)
Gets the size of the loaded picture.
+
Tvg_Gradient
struct _Tvg_Gradient Tvg_Gradient
A structure representing a gradient fill of a Tvg_Paint object.
Definition: thorvg_capi.h:69
+
TVG_STROKE_FILL_REPEAT
@ TVG_STROKE_FILL_REPEAT
The gradient pattern is repeated continuously beyond the gradient area until the expected region is f...
Definition: thorvg_capi.h:161
+
TVG_RESULT_SUCCESS
@ TVG_RESULT_SUCCESS
The value returned in case of a correct request execution.
Definition: thorvg_capi.h:93
+
Tvg_Paint
struct _Tvg_Paint Tvg_Paint
A structure representing a graphical element.
Definition: thorvg_capi.h:63
+
tvg_linear_gradient_new
TVG_EXPORT Tvg_Gradient * tvg_linear_gradient_new()
Creates a new linear gradient object.
+
tvg_canvas_destroy
TVG_EXPORT Tvg_Result tvg_canvas_destroy(Tvg_Canvas *canvas)
Clears the canvas internal data, releases all paints stored by the canvas and destroys the canvas obj...
+
TVG_RESULT_INSUFFICIENT_CONDITION
@ TVG_RESULT_INSUFFICIENT_CONDITION
The value returned in case the request cannot be processed - e.g. asking for properties of an object,...
Definition: thorvg_capi.h:95
+
tvg_shape_cubic_to
TVG_EXPORT Tvg_Result tvg_shape_cubic_to(Tvg_Paint *paint, float cx1, float cy1, float cx2, float cy2, float x, float y)
Adds new points to the sub-path, which results in drawing a cubic Bezier curve.
+
tvg_saver_del
TVG_EXPORT Tvg_Result tvg_saver_del(Tvg_Saver *saver)
Deletes the given Tvg_Saver object.
+
TVG_STROKE_FILL_PAD
@ TVG_STROKE_FILL_PAD
The remaining area is filled with the closest stop color.
Definition: thorvg_capi.h:159
+
tvg_gradient_set_transform
TVG_EXPORT Tvg_Result tvg_gradient_set_transform(Tvg_Gradient *grad, const Tvg_Matrix *m)
Sets the matrix of the affine transformation for the gradient object. (BETA_API)
+
Tvg_Color_Stop
A data structure storing the information about the color and its relative position inside the gradien...
Definition: thorvg_capi.h:184
+
tvg_shape_close
TVG_EXPORT Tvg_Result tvg_shape_close(Tvg_Paint *paint)
Closes the current sub-path by drawing a line from the current point to the initial point of the sub-...
+
Tvg_Stroke_Join
Tvg_Stroke_Join
Enumeration specifying how to fill the area outside the gradient bounds.
Definition: thorvg_capi.h:148
+
tvg_shape_set_stroke_width
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_width(Tvg_Paint *paint, float width)
Sets the stroke width for all of the figures from the paint.
+
tvg_gradient_get_color_stops
TVG_EXPORT Tvg_Result tvg_gradient_get_color_stops(const Tvg_Gradient *grad, const Tvg_Color_Stop **color_stop, uint32_t *cnt)
Gets the parameters of the colors of the gradient, their position and number.
+
Tvg_Color_Stop::b
uint8_t b
Definition: thorvg_capi.h:189
+
TVG_PATH_COMMAND_MOVE_TO
@ TVG_PATH_COMMAND_MOVE_TO
Sets a new initial point of the sub-path and a new current point - corresponds to M command in the sv...
Definition: thorvg_capi.h:129
+
tvg_shape_move_to
TVG_EXPORT Tvg_Result tvg_shape_move_to(Tvg_Paint *paint, float x, float y)
Sets the initial point of the sub-path.
+
TVG_PATH_COMMAND_CUBIC_TO
@ TVG_PATH_COMMAND_CUBIC_TO
Draws a cubic Bezier curve from the current point to the given point using two given control points a...
Definition: thorvg_capi.h:131
+
TVG_STROKE_CAP_ROUND
@ TVG_STROKE_CAP_ROUND
The stroke is extended in both endpoints of a sub-path by a half circle, with a radius equal to the h...
Definition: thorvg_capi.h:140
+
tvg_shape_set_stroke_color
TVG_EXPORT Tvg_Result tvg_shape_set_stroke_color(Tvg_Paint *paint, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Sets the shape's stroke color.
+
tvg_picture_new
TVG_EXPORT Tvg_Paint * tvg_picture_new()
Creates a new picture object.
+
tvg_engine_term
TVG_EXPORT Tvg_Result tvg_engine_term(Tvg_Engine engine_method)
Terminates TVG engines.
+
tvg_shape_get_stroke_gradient
TVG_EXPORT Tvg_Result tvg_shape_get_stroke_gradient(const Tvg_Paint *paint, Tvg_Gradient **grad)
Gets the gradient fill of the shape's stroke.
+
TVG_STROKE_JOIN_MITER
@ TVG_STROKE_JOIN_MITER
The outer corner of the joined path segments is spiked. The spike is created by extension beyond the ...
Definition: thorvg_capi.h:151
+
tvg_picture_set_size
TVG_EXPORT Tvg_Result tvg_picture_set_size(Tvg_Paint *paint, float w, float h)
Resizes the picture content to the given width and height.
+
Tvg_Path_Command
Tvg_Path_Command
Enumeration specifying the values of the path commands accepted by TVG.
Definition: thorvg_capi.h:127
+
TVG_STROKE_JOIN_ROUND
@ TVG_STROKE_JOIN_ROUND
The outer corner of the joined path segments is rounded. The circular region is centered at the join ...
Definition: thorvg_capi.h:150
+
tvg_picture_load_data
TVG_EXPORT Tvg_Result tvg_picture_load_data(Tvg_Paint *paint, const char *data, uint32_t size, const char *mimetype, bool copy)
Loads a picture data from a memory block of a given size.
+
tvg_shape_append_arc
TVG_EXPORT Tvg_Result tvg_shape_append_arc(Tvg_Paint *paint, float cx, float cy, float radius, float startAngle, float sweep, uint8_t pie)
Appends a circular arc to the path.
+
tvg_shape_set_radial_gradient
TVG_EXPORT Tvg_Result tvg_shape_set_radial_gradient(Tvg_Paint *paint, Tvg_Gradient *grad)
Sets the radial gradient fill for all of the figures from the path.
+
tvg_canvas_update_paint
TVG_EXPORT Tvg_Result tvg_canvas_update_paint(Tvg_Canvas *canvas, Tvg_Paint *paint)
Updates the given Tvg_Paint object from the canvas before the rendering.
+
tvg_saver_save
TVG_EXPORT Tvg_Result tvg_saver_save(Tvg_Saver *saver, Tvg_Paint *paint, const char *path, bool compress)
Exports the given paint data to the given path.
+
TVG_RESULT_INVALID_ARGUMENT
@ TVG_RESULT_INVALID_ARGUMENT
The value returned in the event of a problem with the arguments given to the API - e....
Definition: thorvg_capi.h:94
+
tvg_canvas_reserve
TVG_EXPORT Tvg_Result tvg_canvas_reserve(Tvg_Canvas *canvas, uint32_t n)
Reserves a memory block where the objects pushed into a canvas are stored.
+
tvg_paint_get_bounds
TVG_EXPORT Tvg_Result tvg_paint_get_bounds(const Tvg_Paint *paint, float *x, float *y, float *w, float *h, bool transformed)
Gets the axis-aligned bounding box of the Tvg_Paint object. (BETA_API)
+
TVG_COMPOSITE_METHOD_INVERSE_ALPHA_MASK
@ TVG_COMPOSITE_METHOD_INVERSE_ALPHA_MASK
The pixels of the source and the complement to the target's pixels are alpha blended....
Definition: thorvg_capi.h:112
+
tvg_shape_get_gradient
TVG_EXPORT Tvg_Result tvg_shape_get_gradient(const Tvg_Paint *paint, Tvg_Gradient **grad)
Gets the gradient fill of the shape.
+
TVG_RESULT_MEMORY_CORRUPTION
@ TVG_RESULT_MEMORY_CORRUPTION
The value returned in the event of bad memory handling - e.g. failing in pointer releasing or casting...
Definition: thorvg_capi.h:97
+ + + +