From 25aa64ec076a4da77086103c5098cea6817fb2c3 Mon Sep 17 00:00:00 2001 From: yirenyin111 Date: Fri, 4 Jul 2025 12:00:50 +0800 Subject: [PATCH 1/2] add GetEffectPixelMap interface --- graphic/graphic_2d/native_effect/effect_filter.h | 13 +++++++++++++ .../native_effect/libnative_effect.ndk.json | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_effect/effect_filter.h b/graphic/graphic_2d/native_effect/effect_filter.h index feb4fae62..8328a4eac 100644 --- a/graphic/graphic_2d/native_effect/effect_filter.h +++ b/graphic/graphic_2d/native_effect/effect_filter.h @@ -149,6 +149,19 @@ EffectErrorCode OH_Filter_SetColorMatrix(OH_Filter* filter, OH_Filter_ColorMatri */ EffectErrorCode OH_Filter_GetEffectPixelMap(OH_Filter* filter, OH_PixelmapNative** pixelmap); +/** + * @brief Get a pixelmap with the filter effect. + * + * @syscap SystemCapability.Multimedia.Image.Core + * @param filter The OH_Filter pointer will be operated. + * @param pixelmap The pixelmap pointer will be operated. + * @param useCpuRender Whether to use CPU render. + * @return Returns {@link EffectErrorCode}. + * @since 20 + * @version 1.0 + */ +EffectErrorCode OH_Filter_GetEffectPixelMapUseCpuRender(OH_Filter* filter, OH_PixelmapNative** pixelmap, bool useCpuRender); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_effect/libnative_effect.ndk.json b/graphic/graphic_2d/native_effect/libnative_effect.ndk.json index c97ec522d..0d56b8926 100644 --- a/graphic/graphic_2d/native_effect/libnative_effect.ndk.json +++ b/graphic/graphic_2d/native_effect/libnative_effect.ndk.json @@ -7,5 +7,6 @@ { "name": "OH_Filter_GrayScale" }, { "name": "OH_Filter_Invert" }, { "name": "OH_Filter_SetColorMatrix" }, - { "name": "OH_Filter_GetEffectPixelMap" } + { "name": "OH_Filter_GetEffectPixelMap" }, + { "name": "OH_Filter_GetEffectPixelMapUseCpuRender" } ] \ No newline at end of file -- Gitee From 19d743da7ba7e3b55bd9f7395a2d781a3bb83206 Mon Sep 17 00:00:00 2001 From: yirenyin111 Date: Fri, 4 Jul 2025 12:00:50 +0800 Subject: [PATCH 2/2] add GetEffectPixelMap interface Signed-off-by: yirenyin111 --- graphic/graphic_2d/native_effect/effect_filter.h | 13 +++++++++++++ .../native_effect/libnative_effect.ndk.json | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_effect/effect_filter.h b/graphic/graphic_2d/native_effect/effect_filter.h index feb4fae62..8328a4eac 100644 --- a/graphic/graphic_2d/native_effect/effect_filter.h +++ b/graphic/graphic_2d/native_effect/effect_filter.h @@ -149,6 +149,19 @@ EffectErrorCode OH_Filter_SetColorMatrix(OH_Filter* filter, OH_Filter_ColorMatri */ EffectErrorCode OH_Filter_GetEffectPixelMap(OH_Filter* filter, OH_PixelmapNative** pixelmap); +/** + * @brief Get a pixelmap with the filter effect. + * + * @syscap SystemCapability.Multimedia.Image.Core + * @param filter The OH_Filter pointer will be operated. + * @param pixelmap The pixelmap pointer will be operated. + * @param useCpuRender Whether to use CPU render. + * @return Returns {@link EffectErrorCode}. + * @since 20 + * @version 1.0 + */ +EffectErrorCode OH_Filter_GetEffectPixelMapUseCpuRender(OH_Filter* filter, OH_PixelmapNative** pixelmap, bool useCpuRender); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_effect/libnative_effect.ndk.json b/graphic/graphic_2d/native_effect/libnative_effect.ndk.json index c97ec522d..0d56b8926 100644 --- a/graphic/graphic_2d/native_effect/libnative_effect.ndk.json +++ b/graphic/graphic_2d/native_effect/libnative_effect.ndk.json @@ -7,5 +7,6 @@ { "name": "OH_Filter_GrayScale" }, { "name": "OH_Filter_Invert" }, { "name": "OH_Filter_SetColorMatrix" }, - { "name": "OH_Filter_GetEffectPixelMap" } + { "name": "OH_Filter_GetEffectPixelMap" }, + { "name": "OH_Filter_GetEffectPixelMapUseCpuRender" } ] \ No newline at end of file -- Gitee