A module for rendering the graphical elements using the software engine.
More...
A module for rendering the graphical elements using the software engine.
◆ tvg_swcanvas_create()
Creates a Canvas object.
uint32_t *buffer = NULL;
buffer = (uint32_t*) malloc(sizeof(uint32_t) * 100 * 100);
if (!buffer) return;
- Returns
- A new Tvg_Canvas 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, |
|
|
uint32_t |
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] | canvas | The Tvg_Canvas object managing the buffer . |
[in] | buffer | A pointer to the allocated memory block of the size stride x h . |
[in] | stride | The stride of the raster image - in most cases same value as w . |
[in] | w | The width of the raster image. |
[in] | h | The height of the raster image. |
[in] | cs | The 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_SUCCESS | Succeed. |
TVG_RESULT_MEMORY_CORRUPTION | Casting in the internal function implementation failed. |
TVG_RESULT_INVALID_ARGUMENTS | An invalid buffer pointer passed or one of the stride , w or h being zero. |
TVG_RESULT_NOT_SUPPORTED | The software engine is not supported. |
- See also
- TVG_COLORSPACE_ARGB8888, TVG_COLORSPACE_ABGR8888