ThorVG  v0.1
ThorVG is a platform-independent portable library for drawing vector-based scene and animation. It's an open-source software that is freely used by a variety of software platforms and applications. ThorVG provides neat and easy APIs, its library has no dependencies and keeps cheap and super compact size. It serves as the vector graphics engine for Tizen OS that powers many products.

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

Collaboration diagram for Initializer:

Macros

#define TVG_ENGINE_SW   (1 << 1)
 
#define TVG_ENGINE_GL   (1 << 2)
 

Functions

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

Detailed Description

A module enabling initialization and termination of the TVG engines.

Macro Definition Documentation

◆ TVG_ENGINE_GL

#define TVG_ENGINE_GL   (1 << 2)

OpenGL raster engine type.

◆ TVG_ENGINE_SW

#define TVG_ENGINE_SW   (1 << 1)

CPU raster engine type.

Function Documentation

◆ tvg_engine_init()

TVG_EXPORT Tvg_Result tvg_engine_init ( unsigned  engine_method,
unsigned  threads 
)

Initializes TVG engines.

It must be called before any other function, at the beginning of the TVG client.

tvg_engine_init(TVG_ENGINE_SW, 0); //Initialize software renderer and use the main thread only
Parameters
[in]engine_methodThe engine types
  • 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_INSUFFICIENT_CONDITIONAn internal error possibly with memory allocation.
TVG_RESULT_INVALID_ARGUMENTUnknown engine type.
TVG_RESULT_NOT_SUPPORTEDUnsupported engine type.
TVG_RESULT_UNKNOWNOther error.
Note
For multiple backeneds bitwise operation on the engine types is allowed.
See also
tvg_engine_term()
TVG_ENGINE_SW, TVG_ENGINE_GL

◆ tvg_engine_term()

TVG_EXPORT Tvg_Result tvg_engine_term ( unsigned  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_methodrenderer type
  • 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_CONDITIONMultiple function calls.
TVG_RESULT_INVALID_ARGUMENTUnknown engine type.
TVG_RESULT_NOT_SUPPORTEDUnsupported engine type.
TVG_RESULT_UNKNOWNAn internal error.
See also
tvg_engine_init()
TVG_ENGINE_SW, TVG_ENGINE_GL