doc: polish up the doxygen.

- applied @retval for those const values.
- applied @return for return value description.
This commit is contained in:
Hermet Park 2023-12-18 18:33:45 +09:00 committed by Hermet Park
parent 9d06308207
commit cd2e343192

View file

@ -293,7 +293,7 @@ public:
*
* @param[in] degree The value of the angle in degrees.
*
* @return Result::Success when succeed, Result::FailedAllocation otherwise.
* @retval Result::Success when succeed, Result::FailedAllocation otherwise.
*/
Result rotate(float degree) noexcept;
@ -302,7 +302,7 @@ public:
*
* @param[in] factor The value of the scaling factor. The default value is 1.
*
* @return Result::Success when succeed, Result::FailedAllocation otherwise.
* @retval Result::Success when succeed, Result::FailedAllocation otherwise.
*/
Result scale(float factor) noexcept;
@ -315,7 +315,7 @@ public:
* @param[in] x The value of the horizontal shift.
* @param[in] y The value of the vertical shift.
*
* @return Result::Success when succeed, Result::FailedAllocation otherwise.
* @retval Result::Success when succeed, Result::FailedAllocation otherwise.
*/
Result translate(float x, float y) noexcept;
@ -326,7 +326,7 @@ public:
*
* @param[in] m The 3x3 augmented matrix.
*
* @return Result::Success when succeed, Result::FailedAllocation otherwise.
* @retval Result::Success when succeed, Result::FailedAllocation otherwise.
*/
Result transform(const Matrix& m) noexcept;
@ -347,7 +347,7 @@ public:
*
* @param[in] o The opacity value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*
* @note Setting the opacity with this API may require multiple render pass for composition. It is recommended to avoid changing the opacity if possible.
* @note ClipPath won't use the opacity value. (see: enum class CompositeMethod::ClipPath)
@ -360,7 +360,7 @@ public:
* @param[in] target The paint of the target object.
* @param[in] method The method used to composite the source object with the target.
*
* @return Result::Success when succeed, Result::InvalidArguments otherwise.
* @retval Result::Success when succeed, Result::InvalidArguments otherwise.
*/
Result composite(std::unique_ptr<Paint> target, CompositeMethod method) noexcept;
@ -373,7 +373,7 @@ public:
*
* @param[in] method The blending method to be set.
*
* @return Result::Success when the blending method is successfully set.
* @retval Result::Success when the blending method is successfully set.
*
* @note Experimental API
*/
@ -390,7 +390,7 @@ public:
* @param[out] h The height of the object.
* @param[in] transformed If @c true, the paint's transformations are taken into account, otherwise they aren't.
*
* @return Result::Success when succeed, Result::InsufficientCondition otherwise.
* @retval Result::Success when succeed, Result::InsufficientCondition otherwise.
*
* @note The bounding box doesn't indicate the actual drawing region. It's the smallest rectangle that encloses the object.
*/
@ -479,7 +479,7 @@ public:
* @param[in] colorStops An array of ColorStop data structure.
* @param[in] cnt The count of the @p colorStops array equal to the colors number used in the gradient.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*/
Result colorStops(const ColorStop* colorStops, uint32_t cnt) noexcept;
@ -488,7 +488,7 @@ public:
*
* @param[in] s The FillSpread value.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*/
Result spread(FillSpread s) noexcept;
@ -499,7 +499,7 @@ public:
*
* @param[in] m The 3x3 augmented matrix.
*
* @return Result::Success when succeed, Result::FailedAllocation otherwise.
* @retval Result::Success when succeed, Result::FailedAllocation otherwise.
*/
Result transform(const Matrix& m) noexcept;
@ -524,7 +524,7 @@ public:
*
* In case no transformation was applied, the identity matrix is returned.
*
* @retval The augmented transformation matrix.
* @return The augmented transformation matrix.
*/
Matrix transform() const noexcept;
@ -606,7 +606,7 @@ public:
* @param[in] paints If @c true, The memory occupied by paints is deallocated; otherwise, the paints will be retained on the canvas.
* @param[in] buffer If @c true, the canvas target buffer is cleared with a zero value.
*
* @return Result::Success when succeed, Result::InsufficientCondition otherwise.
* @retval Result::Success when succeed, Result::InsufficientCondition otherwise.
*
* @see Canvas::push()
* @see Canvas::paints()
@ -621,7 +621,7 @@ public:
*
* @param[in] paint A pointer to the Paint object or @c nullptr.
*
* @return Result::Success when succeed, Result::InsufficientCondition otherwise.
* @retval Result::Success when succeed, Result::InsufficientCondition otherwise.
*
* @note The Update behavior can be asynchronous if the assigned thread number is greater than zero.
*/
@ -630,7 +630,7 @@ public:
/**
* @brief Requests the canvas to draw the Paint objects.
*
* @return Result::Success when succeed, Result::InsufficientCondition otherwise.
* @retval Result::Success when succeed, Result::InsufficientCondition otherwise.
*
* @note Drawing can be asynchronous if the assigned thread number is greater than zero. To guarantee the drawing is done, call sync() afterwards.
* @see Canvas::sync()
@ -643,7 +643,7 @@ public:
* The Canvas rendering can be performed asynchronously. To make sure that rendering is finished,
* the sync() must be called after the draw() regardless of threading.
*
* @return Result::Success when succeed, Result::InsufficientCondition otherwise.
* @retval Result::Success when succeed, Result::InsufficientCondition otherwise.
* @see Canvas::draw()
*/
virtual Result sync() noexcept;
@ -677,7 +677,7 @@ public:
* @param[in] x2 The horizontal coordinate of the second point used to determine the gradient bounds.
* @param[in] y2 The vertical coordinate of the second point used to determine the gradient bounds.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*
* @note In case the first and the second points are equal, an object filled with such a gradient fill is not rendered.
*/
@ -695,7 +695,7 @@ public:
* @param[out] x2 The horizontal coordinate of the second point used to determine the gradient bounds.
* @param[out] y2 The vertical coordinate of the second point used to determine the gradient bounds.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*/
Result linear(float* x1, float* y1, float* x2, float* y2) const noexcept;
@ -739,7 +739,7 @@ public:
* @param[in] cy The vertical coordinate of the center of the bounding circle.
* @param[in] radius The radius of the bounding circle.
*
* @return Result::Success when succeed, Result::InvalidArguments in case the @p radius value is zero or less.
* @retval Result::Success when succeed, Result::InvalidArguments in case the @p radius value is zero or less.
*/
Result radial(float cx, float cy, float radius) noexcept;
@ -752,7 +752,7 @@ public:
* @param[out] cy The vertical coordinate of the center of the bounding circle.
* @param[out] radius The radius of the bounding circle.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*/
Result radial(float* cx, float* cy, float* radius) const noexcept;
@ -798,7 +798,7 @@ public:
*
* The transformation matrix, the color, the fill and the stroke properties are retained.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*
* @note The memory, where the path data is stored, is not deallocated at this stage for caching effect.
*/
@ -812,7 +812,7 @@ public:
* @param[in] x The horizontal coordinate of the initial point of the sub-path.
* @param[in] y The vertical coordinate of the initial point of the sub-path.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*/
Result moveTo(float x, float y) noexcept;
@ -824,7 +824,7 @@ public:
* @param[in] x The horizontal coordinate of the end-point of the line.
* @param[in] y The vertical coordinate of the end-point of the line.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*
* @note In case this is the first command in the path, it corresponds to the moveTo() call.
*/
@ -843,7 +843,7 @@ public:
* @param[in] x The horizontal coordinate of the end-point of the curve.
* @param[in] y The vertical coordinate of the end-point of the curve.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*
* @note In case this is the first command in the path, no data from the path are rendered.
*/
@ -854,7 +854,7 @@ public:
*
* The value of the current point is set to the initial point of the closed sub-path.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*
* @note In case the sub-path does not contain any points, this function has no effect.
*/
@ -880,7 +880,7 @@ public:
* @param[in] rx The x-axis radius of the ellipse defining the rounded corners of the rectangle.
* @param[in] ry The y-axis radius of the ellipse defining the rounded corners of the rectangle.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*
* @note For @p rx and @p ry greater than or equal to the half of @p w and the half of @p h, respectively, the shape become an ellipse.
*/
@ -900,7 +900,7 @@ public:
* @param[in] rx The x-axis radius of the ellipse.
* @param[in] ry The y-axis radius of the ellipse.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*/
Result appendCircle(float cx, float cy, float rx, float ry) noexcept;
@ -917,7 +917,7 @@ public:
* @param[in] sweep The central angle of the arc given in degrees, measured counter-clockwise from @p startAngle.
* @param[in] pie Specifies whether to draw radii from the arc's center to both of its end-point - drawn if @c true.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*
* @note Setting @p sweep value greater than 360 degrees, is equivalent to calling appendCircle(cx, cy, radius, radius).
*/
@ -935,7 +935,7 @@ public:
* @param[in] pts The array of the two-dimensional points.
* @param[in] ptsCnt The number of the points in the @p pts array.
*
* @return Result::Success when succeed, Result::InvalidArguments otherwise.
* @retval Result::Success when succeed, Result::InvalidArguments otherwise.
*
* @note The interface is designed for optimal path setting if the caller has a completed path commands already.
*/
@ -946,7 +946,7 @@ public:
*
* @param[in] width The width of the stroke. The default value is 0.
*
* @return Result::Success when succeed, Result::FailedAllocation otherwise.
* @retval Result::Success when succeed, Result::FailedAllocation otherwise.
*/
Result strokeWidth(float width) noexcept;
@ -958,7 +958,7 @@ public:
* @param[in] b The blue color channel value in the range [0 ~ 255]. The default value is 0.
* @param[in] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. The default value is 0.
*
* @return Result::Success when succeed, Result::FailedAllocation otherwise.
* @retval Result::Success when succeed, Result::FailedAllocation otherwise.
*/
Result strokeFill(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255) noexcept;
@ -996,7 +996,7 @@ public:
*
* @param[in] cap The cap style value. The default value is @c StrokeCap::Square.
*
* @return Result::Success when succeed, Result::FailedAllocation otherwise.
* @retval Result::Success when succeed, Result::FailedAllocation otherwise.
*/
Result strokeCap(StrokeCap cap) noexcept;
@ -1007,7 +1007,7 @@ public:
*
* @param[in] join The join style value. The default value is @c StrokeJoin::Bevel.
*
* @return Result::Success when succeed, Result::FailedAllocation otherwise.
* @retval Result::Success when succeed, Result::FailedAllocation otherwise.
*/
Result strokeJoin(StrokeJoin join) noexcept;
@ -1017,7 +1017,7 @@ public:
*
* @param[in] miterlimit The miterlimit imposes a limit on the extent of the stroke join, when the @c StrokeJoin::Miter join style is set. The default value is 4.
*
* @return Result::Success when succeed, Result::NonSupport unsupported value, Result::FailedAllocation otherwise.
* @retval Result::Success when succeed, Result::NonSupport unsupported value, Result::FailedAllocation otherwise.
*
* @since 0.11
*/
@ -1033,7 +1033,7 @@ public:
* @param[in] b The blue color channel value in the range [0 ~ 255]. The default value is 0.
* @param[in] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. The default value is 0.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*
* @note Either a solid color or a gradient fill is applied, depending on what was set as last.
* @note ClipPath won't use the fill values. (see: enum class CompositeMethod::ClipPath)
@ -1047,7 +1047,7 @@ public:
*
* @param[in] f The unique pointer to the gradient fill.
*
* @return Result::Success when succeed, Result::MemoryCorruption otherwise.
* @retval Result::Success when succeed, Result::MemoryCorruption otherwise.
*
* @note Either a solid color or a gradient fill is applied, depending on what was set as last.
*/
@ -1058,7 +1058,7 @@ public:
*
* @param[in] r The fill rule value. The default value is @c FillRule::Winding.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*/
Result fill(FillRule r) noexcept;
@ -1068,7 +1068,7 @@ public:
*
* @param[in] strokeFirst If @c true the stroke is rendered before the fill, otherwise the stroke is rendered as the second one (the default option).
*
* @return Result::Success when succeed, Result::FailedAllocation otherwise.
* @retval Result::Success when succeed, Result::FailedAllocation otherwise.
*
* @since 0.10
*/
@ -1134,7 +1134,7 @@ public:
* @param[out] b The blue color channel value in the range [0 ~ 255].
* @param[out] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque.
*
* @return Result::Success when succeed, Result::InsufficientCondition otherwise.
* @retval Result::Success when succeed, Result::InsufficientCondition otherwise.
*/
Result strokeFill(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a = nullptr) const noexcept;
@ -1259,7 +1259,7 @@ public:
* @param[in] w A new width of the image in pixels.
* @param[in] h A new height of the image in pixels.
*
* @return Result::Success when succeed, Result::InsufficientCondition otherwise.
* @retval Result::Success when succeed, Result::InsufficientCondition otherwise.
*/
Result size(float w, float h) noexcept;
@ -1269,7 +1269,7 @@ public:
* @param[out] w The width of the image in pixels.
* @param[out] h The height of the image in pixels.
*
* @return Result::Success when succeed.
* @retval Result::Success when succeed.
*/
Result size(float* w, float* h) const noexcept;
@ -1319,7 +1319,7 @@ public:
*
* @param[out] triangles Optional. A pointer to the array of Polygons used by this mesh.
*
* @return uint32_t The number of polygons in the array.
* @return The number of polygons in the array.
*
* @note Modifying the triangles returned by this method will modify them directly within the mesh.
* @warning Please do not use it, this API is not official one. It could be modified in the next version.
@ -1373,7 +1373,7 @@ public:
*
* @param[in] paint A Paint object to be drawn.
*
* @return Result::Success when succeed, Result::MemoryCorruption otherwise.
* @retval Result::Success when succeed, Result::MemoryCorruption otherwise.
*
* @note The rendering order of the paints is the same as the order as they were pushed. Consider sorting the paints before pushing them if you intend to use layering.
* @see Scene::paints()
@ -1401,7 +1401,7 @@ public:
*
* @param[in] free If @c true, the memory occupied by paints is deallocated, otherwise it is not.
*
* @return Result::Success when succeed
* @retval Result::Success when succeed
*
* @warning If you don't free the paints they become dangled. They are supposed to be reused, otherwise you are responsible for their lives. Thus please use the @p free argument only when you know how it works, otherwise it's not recommended.
*
@ -1796,11 +1796,11 @@ public:
* @param[in] quality The encoded quality level. @c 0 is the minimum, @c 100 is the maximum value(recommended).
* @param[in] fps The desired frames per second (FPS). For example, to encode data at 60 FPS, pass 60. Pass 0 to keep the original frame data.
*
* @return Result::Success if the export succeeds.
* @return Result::InsufficientCondition if there are ongoing resource-saving operations.
* @return Result::NonSupport if an attempt is made to save the file with an unknown extension or in an unsupported format.
* @return Result::MemoryCorruption in case of an internal error.
* @return Result::Unknown if attempting to save an empty paint.
* @retval Result::Success if the export succeeds.
* @retval Result::InsufficientCondition if there are ongoing resource-saving operations.
* @retval Result::NonSupport if an attempt is made to save the file with an unknown extension or in an unsupported format.
* @retval Result::MemoryCorruption in case of an internal error.
* @retval Result::Unknown if attempting to save an empty paint.
*
* @note A higher frames per second (FPS) would result in a larger file size. It is recommended to use the default value.
* @note Saving can be asynchronous if the assigned thread number is greater than zero. To guarantee the saving is done, call sync() afterwards.