| ThorVG v0.1

Functions
Picture
ThorVG_CAPI (BETA version)

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

Collaboration diagram for Picture:

## Functions
TVG_EXPORT Tvg_Paint * | tvg_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 version) 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 version) More...

## Detailed Description

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

## Function Documentation

## ◆ 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 version)

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_Paint * | paint,
|  | const char * | path
| ) |  |

Loads a picture data directly from a file.

Parameters

  [in] | paint | A Tvg_Paint pointer to the picture object.
  [in] | path | The absolute path to the image file.

Returns
  Tvg_Result enumeration.

Return values

  TVG_RESULT_SUCCESS | Succeed.
  TVG_RESULT_INVALID_ARGUMENT | An invalid Tvg_Paint pointer or an empty `path`.
  TVG_RESULT_NOT_SUPPORTED | A file with an unknown extension.
  TVG_RESULT_UNKNOWN | An error at a later stage.

## ◆ 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 version)

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.