diff --git a/graphic/graphic_2d/native_effect/effect_filter.h b/graphic/graphic_2d/native_effect/effect_filter.h
index 781d6da40..d89dabed0 100644
--- a/graphic/graphic_2d/native_effect/effect_filter.h
+++ b/graphic/graphic_2d/native_effect/effect_filter.h
@@ -25,7 +25,7 @@
/**
* @file effect_filter.h
*
- * @brief This file declares the APIs of an image effect filter.
+ * @brief Declares the APIs for filter effects. It supports creating and managing various filter effects, including frosted glass blur, brightness adjustment, grayscale conversion, and color inversion. It also supports implementing rich image processing effects through custom matrices, applicable to scenarios such as image editing, photo beautification, and visual effects.
* @kit ArkGraphics2D
* @library libnative_effect.so
* @syscap SystemCapability.Multimedia.Image.Core
@@ -41,10 +41,10 @@ extern "C" {
#endif
/**
- * @brief Creates an **OH_Filter** object.
+ * @brief Creates an **OH_Filter** object to apply various filter effects (such as blur, brightening, or grayscale) to an image, applicable to scenarios such as image editing, album apps, and video processing.
*
- * @param pixelmap [in] Pointer to the PixelMap. Cannot be NULL.
- * @param filter [out] Double pointer to the filter created. Cannot be NULL.
+ * @param pixelmap [in] The pixelmap object used as the source image for filter effect processing.
+ * @param filter [out] Double pointer used to receive the filter.
* @return
* - {@link EffectErrorCode#EFFECT_SUCCESS} if the operation is successful.
* - {@link EffectErrorCode#EFFECT_BAD_PARAMETER} if pixelmap or filter is NULL.
@@ -58,7 +58,7 @@ EffectErrorCode OH_Filter_CreateEffect(OH_PixelmapNative* pixelmap, OH_Filter**
/**
* @brief Releases an **OH_Filter** object.
*
- * @param filter [in] Pointer to the filter. Cannot be NULL.
+ * @param filter [in] Pointer to the filter.
* @return
* - {@link EffectErrorCode#EFFECT_SUCCESS} if the operation is successful.
* - {@link EffectErrorCode#EFFECT_BAD_PARAMETER} if filter is NULL.
@@ -69,13 +69,13 @@ EffectErrorCode OH_Filter_CreateEffect(OH_PixelmapNative* pixelmap, OH_Filter**
EffectErrorCode OH_Filter_Release(OH_Filter* filter);
/**
- * @brief Creates the frosted glass effect and adds it to a filter.
+ * @brief Creates a frosted glass filter effect and adds it to a filter effect chain.
*
- * @param filter [in] Pointer to the filter. Cannot be NULL.
- * @param radius [in] Blur radius of the frosted glass effect, in px.
+ * @param filter [in] Filter pointer, which needs to be created through OH_Filter_CreateEffect.
+ * @param radius [in] Blur radius of the frosted glass effect. Value range: [0, +∞), in pixels. A value of 0 produces no blur effect; larger values produce stronger blur effects.
* @return
* - {@link EffectErrorCode#EFFECT_SUCCESS} if the operation is successful.
- * - {@link EffectErrorCode#EFFECT_BAD_PARAMETER} if filter is NULL.
+ * - {@link EffectErrorCode#EFFECT_BAD_PARAMETER} if filter is a null pointer or radius is less than 0.
*
* @since 12
* @version 1.0
@@ -83,30 +83,27 @@ EffectErrorCode OH_Filter_Release(OH_Filter* filter);
EffectErrorCode OH_Filter_Blur(OH_Filter* filter, float radius);
/**
- * @brief Creates the frosted glass effect and adds it to a filter. It supports the tiling mode of the shader effect.
+ * @brief Creates a frosted glass filter effect and adds it to a filter effect chain. It supports selecting the shader effect tile mode.
*
- * @param filter [in] Pointer to the filter. Cannot be NULL.
- * @param radius [in] Blur radius of the frosted glass effect, in px.
- * @param tileMode [in] Tile mode of the shader effect. For details about the available options,
- * see {@link EffectTileMode}.
+ * @param filter [in] Filter pointer, which needs to be created through OH_Filter_CreateEffect.
+ * @param radius [in] Blur radius of the frosted glass effect. Value range: [0, +∞), in pixels. No blur effect is produced when the parameter value is 0. The larger the value, the stronger the blur effect.
+ * @param tileMode [in] Shader effect tile mode. Different modes determine different processing methods for image edge areas.
* @return
* - {@link EffectErrorCode#EFFECT_SUCCESS} if the operation is successful.
- * - {@link EffectErrorCode#EFFECT_BAD_PARAMETER} if filter is NULL.
+ * - {@link EffectErrorCode#EFFECT_BAD_PARAMETER} if filter is a null pointer or radius is less than 0.
*
* @since 14
*/
EffectErrorCode OH_Filter_BlurWithTileMode(OH_Filter* filter, float radius, EffectTileMode tileMode);
/**
- * @brief Creates the brightening effect and adds it to a filter.
+ * @brief Creates a brightening effect and adds it to a filter effect chain.
*
- * @param filter [in] Pointer to the filter. Cannot be NULL.
- * @param brightness [in] Brightness value of the brightening effect, ranging from 0 to 1.
- * When the value is 0, the image brightness remains unchanged.
- * When the value is 1, the image becomes fully brightened.
+ * @param filter [in] Filter pointer, which needs to be created through OH_Filter_CreateEffect.
+ * @param brightness [in] Brightness value of the brightening effect. Value range: [0, 1]. The image remains unchanged when the value is 0, and becomes completely white when the value is 1.
* @return
* - {@link EffectErrorCode#EFFECT_SUCCESS} if the operation is successful.
- * - {@link EffectErrorCode#EFFECT_BAD_PARAMETER} if filter is NULL.
+ * - {@link EffectErrorCode#EFFECT_BAD_PARAMETER} if filter is a null pointer or brightness is outside the value range [0, 1].
*
* @since 12
* @version 1.0
@@ -114,9 +111,9 @@ EffectErrorCode OH_Filter_BlurWithTileMode(OH_Filter* filter, float radius, Effe
EffectErrorCode OH_Filter_Brighten(OH_Filter* filter, float brightness);
/**
- * @brief Creates the grayscale effect and adds it to a filter.
+ * @brief Creates a grayscale effect and adds it to a filter effect chain.
*
- * @param filter [in] Pointer to the filter. Cannot be NULL.
+ * @param filter [in] Filter pointer, which needs to be created through OH_Filter_CreateEffect.
* @return
* - {@link EffectErrorCode#EFFECT_SUCCESS} if the operation is successful.
* - {@link EffectErrorCode#EFFECT_BAD_PARAMETER} if filter is NULL.
@@ -127,9 +124,9 @@ EffectErrorCode OH_Filter_Brighten(OH_Filter* filter, float brightness);
EffectErrorCode OH_Filter_GrayScale(OH_Filter* filter);
/**
- * @brief Creates the inverted color effect and adds it to a filter.
+ * @brief Creates an inverted color effect and adds it to a filter effect chain.
*
- * @param filter [in] Pointer to the filter. Cannot be NULL.
+ * @param filter [in] Filter pointer, which needs to be created through OH_Filter_CreateEffect.
* @return
* - {@link EffectErrorCode#EFFECT_SUCCESS} if the operation is successful.
* - {@link EffectErrorCode#EFFECT_BAD_PARAMETER} if filter is NULL.
@@ -140,10 +137,10 @@ EffectErrorCode OH_Filter_GrayScale(OH_Filter* filter);
EffectErrorCode OH_Filter_Invert(OH_Filter* filter);
/**
- * @brief Creates a custom effect through a matrix and adds it to a filter.
+ * @brief Creates a custom effect through a matrix and adds it to a filter effect chain, applicable to scenarios that require specific color transformation effects (such as color correction, hue adjustment, or color temperature adjustment).
*
- * @param filter [in] Pointer to the filter. Cannot be NULL.
- * @param matrix [in] Custom {@link OH_Filter_ColorMatrix} used to create the filter. Cannot be NULL.
+ * @param filter [in] Filter pointer, which needs to be created through OH_Filter_CreateEffect.
+ * @param matrix [in] Custom matrix used to create the filter.
* @return
* - {@link EffectErrorCode#EFFECT_SUCCESS} if the operation is successful.
* - {@link EffectErrorCode#EFFECT_BAD_PARAMETER} if filter or matrix is NULL.
@@ -154,10 +151,10 @@ EffectErrorCode OH_Filter_Invert(OH_Filter* filter);
EffectErrorCode OH_Filter_SetColorMatrix(OH_Filter* filter, OH_Filter_ColorMatrix* matrix);
/**
- * @brief Obtains the PixelMap with the filter effect.
+ * @brief Obtains the bitmap generated by the filter.
*
- * @param filter [in] Pointer to the filter. Cannot be NULL.
- * @param pixelmap [out] Double pointer to the PixelMap obtained. Cannot be NULL.
+ * @param filter [in] Filter pointer used to create a bitmap, which needs to be created through OH_Filter_CreateEffect.
+ * @param pixelmap [out] Double pointer used to receive the PixelMap.
* @return
* - {@link EffectErrorCode#EFFECT_SUCCESS} if the operation is successful.
* - {@link EffectErrorCode#EFFECT_BAD_PARAMETER} if filter or pixelmap is NULL.
diff --git a/graphic/graphic_2d/native_effect/effect_types.h b/graphic/graphic_2d/native_effect/effect_types.h
index 85afc1f71..78a2e6851 100644
--- a/graphic/graphic_2d/native_effect/effect_types.h
+++ b/graphic/graphic_2d/native_effect/effect_types.h
@@ -25,7 +25,7 @@
/**
* @file effect_types.h
*
- * @brief This file declares the data types of the image effect filter.
+ * @brief Declares the data types for filter effects, used to define the matrices, status codes, and tile modes for filter effects, and supports scenarios such as creating custom filter effects and processing image shader tiling.
* @kit ArkGraphics2D
* @library libnative_effect.so
* @syscap SystemCapability.Multimedia.Image.Core
@@ -43,7 +43,7 @@ extern "C" {
#endif
/**
- * @brief Defines a struct for a filter used to generate a filter PixelMap.
+ * @brief Defines a filter struct used with EffectKit module APIs to implement filter effect processing.
*
* @since 12
* @version 1.0
@@ -51,7 +51,7 @@ extern "C" {
typedef struct OH_Filter OH_Filter;
/**
- * @brief Defines a pixel map defined by the image framework.
+ * @brief Declares a pixel map object defined by the image framework.
*
* @since 12
* @version 1.0
@@ -59,7 +59,7 @@ typedef struct OH_Filter OH_Filter;
typedef struct OH_PixelmapNative OH_PixelmapNative;
/**
- * @brief Describes a matrix used to create an effect filter.
+ * @brief Defines a 4x5 matrix for creating a filter effect, with elements of floating-point numbers.
*
* @since 12
* @version 1.0
@@ -70,19 +70,19 @@ struct OH_Filter_ColorMatrix {
};
/**
- * @brief Enumerates the status codes that may be used by the effect filter.
+ * @brief Enumerates the status codes of the filter effect. These status codes are returned when filter effect APIs are used. Developers should determine the operation result based on the returned status code and handle it accordingly. For the usage instructions of the status codes for specific APIs, see the corresponding API documentation.
*
* @since 12
* @version 1.0
*/
typedef enum {
- /** Operation successful. */
+ /** The operation is successful. */
EFFECT_SUCCESS = 0,
- /** Invalid parameter. */
+ /** Invalid parameter. Check the parameter type and range. */
EFFECT_BAD_PARAMETER = 401,
- /** Unsupported operation. */
+ /** The operation is not supported. Check the API usage. */
EFFECT_UNSUPPORTED_OPERATION = 7600201,
- /** Unknown error. */
+ /** An unidentified error occurred. Possible causes include abnormal system resources or improper API calling. Check the API call parameters and system resource status first. */
EFFECT_UNKNOWN_ERROR = 7600901,
} EffectErrorCode;
@@ -92,13 +92,13 @@ typedef enum {
* @since 14
*/
typedef enum {
- /** Replicates the edge color if the shader effect draws outside of its original boundary. */
+ /** Clamp mode. If the shader effect exceeds its original bounds, the remaining area is filled with the edge color of the shader. Applicable to scenarios requiring a smooth transition to a solid color background. */
CLAMP = 0,
- /** Repeats the shader effect in both horizontal and vertical directions. */
+ /** Repeat mode. Repeats the shader effect in both horizontal and vertical directions. Applicable to scenarios requiring seamless tiled textures, such as background pattern filling. */
REPEAT,
- /** Repeats the shader effect in both horizontal and vertical directions, alternating mirror images. */
+ /** Mirror mode. Repeats the shader effect in both horizontal and vertical directions, alternating mirrored images so that adjacent images always join seamlessly. Applicable to scenarios requiring continuity while avoiding abrupt repeating edges, such as gradient backgrounds. */
MIRROR,
- /** Renders the shader effect only within the original boundary. */
+ /** Decal mode. Renders the shader effect only within its original bounds. Applicable to scenarios requiring precise control over shader boundaries, where areas outside the bounds remain transparent or retain the original content. */
DECAL,
} EffectTileMode;