mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
capi: picture load data
Added 'tvg_picture_load_data' capi.
This commit is contained in:
parent
15b56a66de
commit
9453273fc8
2 changed files with 27 additions and 0 deletions
|
@ -1661,11 +1661,31 @@ TVG_EXPORT Tvg_Result tvg_picture_load(Tvg_Paint* paint, const char* path);
|
|||
/*!
|
||||
* \brief Loads a picture data from a memory block of a given size. (BETA version)
|
||||
*
|
||||
* \return Tvg_Result return value
|
||||
* \retval TVG_RESULT_SUCCESS: if ok.
|
||||
* \retval TVG_RESULT_INVALID_PARAMETERS: if paint is invalid
|
||||
*
|
||||
* \warning Please do not use it, this API is not official one. It can be modified in the next version.
|
||||
*/
|
||||
TVG_EXPORT Tvg_Result tvg_picture_load_raw(Tvg_Paint* paint, uint32_t *data, uint32_t w, uint32_t h, bool copy);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief The function loads data into given paint object. (BETA version)
|
||||
*
|
||||
* \param[in] paint Tvg_Paint pointer
|
||||
* \param[in] data raw data pointer
|
||||
* \param[in] size of data
|
||||
*
|
||||
* \return Tvg_Result return value
|
||||
* \retval TVG_RESULT_SUCCESS: if ok.
|
||||
* \retval TVG_RESULT_INVALID_PARAMETERS: if paint is invalid
|
||||
*
|
||||
* \warning Please do not use it, this API is not official one. It can be modified in the next version.
|
||||
*/
|
||||
TVG_EXPORT Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Gets the position and the size of the loaded picture. (BETA version)
|
||||
*
|
||||
|
|
|
@ -462,6 +462,13 @@ TVG_EXPORT Tvg_Result tvg_picture_load_raw(Tvg_Paint* paint, uint32_t *data, uin
|
|||
}
|
||||
|
||||
|
||||
TVG_EXPORT Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size)
|
||||
{
|
||||
if (!paint) return TVG_RESULT_INVALID_ARGUMENT;
|
||||
return (Tvg_Result) reinterpret_cast<Picture*>(paint)->load(data, size);
|
||||
}
|
||||
|
||||
|
||||
TVG_EXPORT Tvg_Result tvg_picture_get_viewbox(const Tvg_Paint* paint, float* x, float* y, float* w, float* h)
|
||||
{
|
||||
if (!paint) return TVG_RESULT_INVALID_ARGUMENT;
|
||||
|
|
Loading…
Add table
Reference in a new issue