api: revise an api & untag experimental apis

API Modifications:
- Tvg_Result tvg_paint_set_clip(Tvg_Paint* paint, Tvg_Paint* clipper)
 -> Tvg_Result tvg_paint_clip(Tvg_Paint* paint, Tvg_Paint* clipper)
This commit is contained in:
Hermet Park 2025-03-18 17:09:05 +09:00
parent ad888019e9
commit b2ba294372
3 changed files with 20 additions and 20 deletions

View file

@ -224,7 +224,7 @@ enum class BlendMethod : uint8_t
* *
* @see Scene::push(SceneEffect effect, ...) * @see Scene::push(SceneEffect effect, ...)
* *
* @note Experimental API * @since 1.0
*/ */
enum class SceneEffect : uint8_t enum class SceneEffect : uint8_t
{ {
@ -257,7 +257,7 @@ enum class CanvasEngine : uint8_t
* @see Paint::type() * @see Paint::type()
* @see Fill::type() * @see Fill::type()
* *
* @note Experimental API * @since 1.0
*/ */
enum class Type : uint8_t enum class Type : uint8_t
{ {
@ -394,7 +394,7 @@ public:
* @retval Result::NonSupport If the @p clipper type is not Shape. * @retval Result::NonSupport If the @p clipper type is not Shape.
* *
* @note @p clipper only supports the Shape type. * @note @p clipper only supports the Shape type.
* @note Experimental API * @since 1.0
*/ */
Result clip(Paint* clipper) noexcept; Result clip(Paint* clipper) noexcept;
@ -407,7 +407,7 @@ public:
* *
* @param[in] method The blending method to be set. * @param[in] method The blending method to be set.
* *
* @note Experimental API * @since 1.0
*/ */
Result blend(BlendMethod method) noexcept; Result blend(BlendMethod method) noexcept;
@ -1128,7 +1128,7 @@ public:
* @param[in] simultaneous Determines how to trim multiple paths within a single shape. If set to @c true (default), trimming is applied simultaneously to all paths; * @param[in] simultaneous Determines how to trim multiple paths within a single shape. If set to @c true (default), trimming is applied simultaneously to all paths;
* Otherwise, all paths are treated as a single entity with a combined length equal to the sum of their individual lengths and are trimmed as such. * Otherwise, all paths are treated as a single entity with a combined length equal to the sum of their individual lengths and are trimmed as such.
* *
* @note Experimental API * @since 1.0
*/ */
Result trimpath(float begin, float end, bool simultaneous = true) noexcept; Result trimpath(float begin, float end, bool simultaneous = true) noexcept;
@ -1399,7 +1399,7 @@ public:
* *
* @see Accessor::id() * @see Accessor::id()
* *
* @note Experimental API * @since 1.0
*/ */
const Paint* paint(uint32_t id) noexcept; const Paint* paint(uint32_t id) noexcept;
@ -1501,7 +1501,7 @@ public:
* For example, use SceneEffect::GaussianBlur to apply a blur with specific parameters. * For example, use SceneEffect::GaussianBlur to apply a blur with specific parameters.
* @param[in] ... Additional variadic parameters required for certain effects (e.g., sigma and direction for GaussianBlur). * @param[in] ... Additional variadic parameters required for certain effects (e.g., sigma and direction for GaussianBlur).
* *
* @note Experimental API * @since 1.0
*/ */
Result push(SceneEffect effect, ...) noexcept; Result push(SceneEffect effect, ...) noexcept;
@ -1551,7 +1551,7 @@ public:
* @retval Result::InsufficientCondition when the specified @p name cannot be found. * @retval Result::InsufficientCondition when the specified @p name cannot be found.
* *
* @note If the @p name is not specified, ThorVG will select any available font candidate. * @note If the @p name is not specified, ThorVG will select any available font candidate.
* @note Experimental API * @since 1.0
*/ */
Result font(const char* name, float size, const char* style = nullptr) noexcept; Result font(const char* name, float size, const char* style = nullptr) noexcept;
@ -1563,7 +1563,7 @@ public:
* *
* @param[in] text The multi-byte text encoded with utf8 string to be rendered. * @param[in] text The multi-byte text encoded with utf8 string to be rendered.
* *
* @note Experimental API * @since 1.0
*/ */
Result text(const char* text) noexcept; Result text(const char* text) noexcept;

View file

@ -211,7 +211,7 @@ typedef enum {
* @see tvg_paint_get_type() * @see tvg_paint_get_type()
* @see tvg_gradient_get_type() * @see tvg_gradient_get_type()
* *
* @note Experimental API * @since 1.0
*/ */
typedef enum { typedef enum {
TVG_TYPE_UNDEF = 0, ///< Undefined type. TVG_TYPE_UNDEF = 0, ///< Undefined type.
@ -995,9 +995,9 @@ TVG_API Tvg_Result tvg_paint_get_mask_method(const Tvg_Paint* paint, const Tvg_P
* @retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument. * @retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument.
* @retval TVG_RESULT_NOT_SUPPORTED If the @p clipper type is not Shape. * @retval TVG_RESULT_NOT_SUPPORTED If the @p clipper type is not Shape.
* *
* @note Experimental API * @since 1.0
*/ */
TVG_API Tvg_Result tvg_paint_set_clip(Tvg_Paint* paint, Tvg_Paint* clipper); TVG_API Tvg_Result tvg_paint_clip(Tvg_Paint* paint, Tvg_Paint* clipper);
/** /**
@ -1009,7 +1009,7 @@ TVG_API Tvg_Result tvg_paint_set_clip(Tvg_Paint* paint, Tvg_Paint* clipper);
* @return Tvg_Result enumeration. * @return Tvg_Result enumeration.
* @retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument. * @retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument.
* *
* @note Experimental API * @since 1.0
*/ */
TVG_API Tvg_Result tvg_paint_get_type(const Tvg_Paint* paint, Tvg_Type* type); TVG_API Tvg_Result tvg_paint_get_type(const Tvg_Paint* paint, Tvg_Type* type);
@ -1450,7 +1450,7 @@ TVG_API Tvg_Result tvg_shape_get_stroke_miterlimit(const Tvg_Paint* paint, float
* @return Tvg_Result enumeration. * @return Tvg_Result enumeration.
* @retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. * @retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer.
* *
* @note Experimental API * @since 1.0
*/ */
TVG_API Tvg_Result tvg_shape_set_trimpath(Tvg_Paint* paint, float begin, float end, bool simultaneous); TVG_API Tvg_Result tvg_shape_set_trimpath(Tvg_Paint* paint, float begin, float end, bool simultaneous);
@ -1771,7 +1771,7 @@ TVG_API Tvg_Result tvg_gradient_get_transform(const Tvg_Gradient* grad, Tvg_Matr
* @return Tvg_Result enumeration. * @return Tvg_Result enumeration.
* @retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument. * @retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument.
* *
* @note Experimental API * @since 1.0
*/ */
TVG_API Tvg_Result tvg_gradient_get_type(const Tvg_Gradient* grad, Tvg_Type* type); TVG_API Tvg_Result tvg_gradient_get_type(const Tvg_Gradient* grad, Tvg_Type* type);
@ -1924,7 +1924,7 @@ TVG_API Tvg_Result tvg_picture_get_size(const Tvg_Paint* paint, float* w, float*
* @return A pointer to the paint object that matches the given identifier, or @c nullptr if no matching paint object is found. * @return A pointer to the paint object that matches the given identifier, or @c nullptr if no matching paint object is found.
* *
* @see tvg_accessor_generate_id() * @see tvg_accessor_generate_id()
* @note experimental API * @note Experimental API
*/ */
TVG_API const Tvg_Paint* tvg_picture_get_paint(Tvg_Paint* paint, uint32_t id); TVG_API const Tvg_Paint* tvg_picture_get_paint(Tvg_Paint* paint, uint32_t id);
@ -2046,7 +2046,7 @@ TVG_API Tvg_Paint* tvg_text_new(void);
* @retval TVG_RESULT_INSUFFICIENT_CONDITION The specified @p name cannot be found. * @retval TVG_RESULT_INSUFFICIENT_CONDITION The specified @p name cannot be found.
* *
* @note If the @p name is not specified, ThorVG will select any available font candidate. * @note If the @p name is not specified, ThorVG will select any available font candidate.
* @note Experimental API * @since 1.0
*/ */
TVG_API Tvg_Result tvg_text_set_font(Tvg_Paint* paint, const char* name, float size, const char* style); TVG_API Tvg_Result tvg_text_set_font(Tvg_Paint* paint, const char* name, float size, const char* style);
@ -2063,7 +2063,7 @@ TVG_API Tvg_Result tvg_text_set_font(Tvg_Paint* paint, const char* name, float s
* @return Tvg_Result enumeration. * @return Tvg_Result enumeration.
* @retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr passed as the @p paint argument. * @retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr passed as the @p paint argument.
* *
* @note Experimental API * @since 1.0
*/ */
TVG_API Tvg_Result tvg_text_set_text(Tvg_Paint* paint, const char* text); TVG_API Tvg_Result tvg_text_set_text(Tvg_Paint* paint, const char* text);
@ -2548,7 +2548,7 @@ TVG_API Tvg_Result tvg_lottie_animation_get_marker(Tvg_Animation* animation, uin
* @return Tvg_Result enumeration. * @return Tvg_Result enumeration.
* @retval TVG_RESULT_INSUFFICIENT_CONDITION In case the animation is not loaded. * @retval TVG_RESULT_INSUFFICIENT_CONDITION In case the animation is not loaded.
* *
* @note Experimental API * @since 1.0
*/ */
TVG_API Tvg_Result tvg_lottie_animation_tween(Tvg_Animation* animation, float from, float to, float progress); TVG_API Tvg_Result tvg_lottie_animation_tween(Tvg_Animation* animation, float from, float to, float progress);

View file

@ -298,7 +298,7 @@ TVG_API Tvg_Result tvg_paint_get_type(const Tvg_Paint* paint, Tvg_Type* type)
} }
TVG_API Tvg_Result tvg_paint_set_clip(Tvg_Paint* paint, Tvg_Paint* clipper) TVG_API Tvg_Result tvg_paint_clip(Tvg_Paint* paint, Tvg_Paint* clipper)
{ {
if (!paint) return TVG_RESULT_INVALID_ARGUMENT; if (!paint) return TVG_RESULT_INVALID_ARGUMENT;
return (Tvg_Result) reinterpret_cast<Paint*>(paint)->clip((Paint*)(clipper)); return (Tvg_Result) reinterpret_cast<Paint*>(paint)->clip((Paint*)(clipper));