docs: ++ docs of the load apis

This commit is contained in:
Mira Grudzinska 2021-10-04 15:07:44 +02:00 committed by Mira Grudzinska
parent ff20974632
commit fc29d888f1
2 changed files with 16 additions and 14 deletions

View file

@ -1050,15 +1050,15 @@ public:
* *
* @param[in] data A pointer to a memory location where the content of the picture file is stored. * @param[in] data A pointer to a memory location where the content of the picture file is stored.
* @param[in] size The size in bytes of the memory occupied by the @p data. * @param[in] size The size in bytes of the memory occupied by the @p data.
* @param[in] mimeType Mimetype or extension of data such as "jpg", "jpeg", "svg", "svg+xml", "png", etc. If empty string or unknown, loaders will be tried one by one. * @param[in] mimeType Mimetype 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.
* @param[in] copy Decides whether the data should be copied into the engine local buffer. * @param[in] copy If @c true the data are copied into the engine local buffer, otherwise they are not.
* *
* @retval Result::Success When succeed. * @retval Result::Success When succeed.
* @retval Result::InvalidArguments In case no data are provided or the @p size is zero or less. * @retval Result::InvalidArguments In case no data are provided or the @p size is zero or less.
* @retval Result::NonSupport When trying to load a file with an unknown extension. * @retval Result::NonSupport When trying to load a file with an unknown extension.
* @retval Result::Unknown If an error occurs at a later stage. * @retval Result::Unknown If an error occurs at a later stage.
* *
* @warning: you have responsibility to release the @p data memory if the @p copy is true * @warning: It's the user responsibility to release the @p data memory if the @p copy is @c true.
* *
* @since 0.5 * @since 0.5
*/ */

View file

@ -1707,7 +1707,7 @@ 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) * \brief Loads a picture data from a memory block of a given size. (BETA_API)
* *
* \return Tvg_Result return value * \return Tvg_Result return value
* \retval TVG_RESULT_SUCCESS: if ok. * \retval TVG_RESULT_SUCCESS: if ok.
@ -1719,19 +1719,21 @@ TVG_EXPORT Tvg_Result tvg_picture_load_raw(Tvg_Paint* paint, uint32_t *data, uin
/*! /*!
* \brief The function loads data into the given paint object. * \brief Loads a picture data from a memory block of a given size.
* *
* \param[in] paint Tvg_Paint pointer * \param[in] paint A Tvg_Paint pointer to the picture object.
* \param[in] data raw data pointer * \param[in] data A pointer to a memory location where the content of the picture file is stored.
* \param[in] size of data * \param[in] size The size in bytes of the memory occupied by the @p data.
* \param[in] mimetype mimetype of data * \param[in] mimetype Mimetype 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.
* \param[in] copy Decides whether the data should be copied into the local buffer * \param[in] copy If @c true the data are copied into the engine local buffer, otherwise they are not.
* *
* \return Tvg_Result return value * \return Tvg_Result enumeration.
* \retval TVG_RESULT_SUCCESS: if ok. * \retval TVG_RESULT_SUCCESS Succeed.
* \retval TVG_RESULT_INVALID_PARAMETERS: if paint is invalid * \retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument or the @p size is zero or less.
* \retval TVG_RESULT_NOT_SUPPORTED A file with an unknown extension.
* \retval TVG_RESULT_UNKNOWN An error at a later stage.
* *
* \warning Please do not use it, this API is not official one. It can be modified in the next version. * \warning: It's the user responsibility to release the @p data memory if the @p copy is @c true.
*/ */
TVG_EXPORT Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size, const char *mimetype, bool copy); TVG_EXPORT Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size, const char *mimetype, bool copy);