diff --git a/graphic/graphic_2d/native_drawing/drawing_color_filter.h b/graphic/graphic_2d/native_drawing/drawing_color_filter.h index 98907ba17b2341321b8f37766dd57834f66d6a76..3b37b557316a3e2e777431c45ce5c66cd70c9400 100644 --- a/graphic/graphic_2d/native_drawing/drawing_color_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_color_filter.h @@ -113,6 +113,19 @@ OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateSrgbGammaToLinear(void); */ OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateLuma(void); +/** + * @brief Creates an OH_Drawing_ColorFilter with the given mutColor used to multiply source color and addColor + * used to add to source color. The Alpha channel will not be affected. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param mulColor Indicates the color, which is a 32-bit (ARGB) variable. + * @param addColor Indicates the color, which is a 32-bit (ARGB) variable. + * @return Returns the pointer to the OH_Drawing_ColorFilter object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateLighting(uint32_t mulColor, uint32_t addColor); + /** * @brief Destroys an OH_Drawing_ColorFilter object and reclaims the memory occupied by the object. * diff --git a/graphic/graphic_2d/native_drawing/drawing_mask_filter.h b/graphic/graphic_2d/native_drawing/drawing_mask_filter.h index 86f487bfe98e88fd4dcc2a167e0132e4a8e46c35..d13ba9c89fd64825af1aa183fb23b4ae952ade79 100644 --- a/graphic/graphic_2d/native_drawing/drawing_mask_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_mask_filter.h @@ -84,6 +84,44 @@ typedef enum { */ OH_Drawing_MaskFilter* OH_Drawing_MaskFilterCreateBlur(OH_Drawing_BlurType blurType, float sigma, bool respectCTM); +/** + * @brief Creates an OH_Drawing_MaskFilter with a table effect. + * + * This API generates an error code, you can view the value of the error code by using {@link OH_Drawing_ErrorCodeGet}. + * Returns OH_DRAWING_SUCCESS when the execution is successful; + * When table is null, OH_DRAWING_ERROR_INVALID_PARAMETER is returned. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param table Indicates a lookup table is applied to each alpha value in the mask. table.length must be = 256. + * @return Returns the pointer to the OH_Drawing_MaskFilter object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_MaskFilter* OH_Drawing_MaskFilterCreateTable(uint8_t table[256]); + +/** + * @brief Creates an OH_Drawing_MaskFilter with a clip table effect. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param min Indicates the minimum value used for comparison with the clipping table. + * @param max Indicates the maximum value used for comparison with the clipping table. + * @return Returns the pointer to the OH_Drawing_MaskFilter object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_MaskFilter* OH_Drawing_MaskFilterCreateClipTable(uint8_t min, uint8_t max); + +/** + * @brief Creates an OH_Drawing_MaskFilter with a gamma table effect. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param gamma Indicates the gamma value used for comparison with the gamma table. + * @return Returns the pointer to the OH_Drawing_MaskFilter object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_MaskFilter* OH_Drawing_MaskFilterCreateGammaTable(float gamma); + /** * @brief Destroys an OH_Drawing_MaskFilter object and reclaims the memory occupied by the object. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 353ce3f539771d30cdac90947de31c81c38d3c4d..e4b66043169e5b18b4c5e2387aa151aed44fdf7f 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -157,6 +157,10 @@ { "name": "OH_Drawing_ColorFilterCreateCompose" }, { "name": "OH_Drawing_ColorFilterCreateLinearToSrgbGamma" }, { "name": "OH_Drawing_ColorFilterCreateLuma" }, + { + "first_introduced": "14", + "name": "OH_Drawing_ColorFilterCreateLighting" + }, { "name": "OH_Drawing_ColorFilterCreateMatrix" }, { "name": "OH_Drawing_ColorFilterCreateSrgbGammaToLinear" }, { "name": "OH_Drawing_ColorFilterDestroy" }, @@ -307,6 +311,18 @@ "name": "OH_Drawing_ImageFilterDestroy" }, { "name": "OH_Drawing_MaskFilterCreateBlur" }, + { + "first_introduced": "14", + "name": "OH_Drawing_MaskFilterCreateTable" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_MaskFilterCreateClipTable" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_MaskFilterCreateGammaTable" + }, { "name": "OH_Drawing_MaskFilterDestroy" }, { "name": "OH_Drawing_MatrixCreate" }, { "name": "OH_Drawing_MatrixCreateRotation" },