From 2bf3d30f0743bff13101e10dc549dd358b86d6b2 Mon Sep 17 00:00:00 2001 From: yirenyin111 Date: Fri, 4 Jul 2025 15:12:35 +0800 Subject: [PATCH 1/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 From 72646297831803eb5d4e6e43c7f5c35ea6817412 Mon Sep 17 00:00:00 2001 From: yirenyin111 Date: Fri, 4 Jul 2025 15:12:35 +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