From da2ef9e8ee47271e885957a4e91c33f8db914298 Mon Sep 17 00:00:00 2001 From: z00428214 Date: Thu, 11 Jul 2024 22:18:07 +0800 Subject: [PATCH] =?UTF-8?q?imageEffect=E6=96=B0=E5=A2=9E=E6=BB=A4=E9=95=9C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=81=E5=88=A0=E9=99=A4=E3=80=81=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: z00428214 --- multimedia/image_effect/image_effect.h | 69 +++++++++++++++++++ .../image_effect/libimage_effect.ndk.json | 20 ++++++ 2 files changed, 89 insertions(+) diff --git a/multimedia/image_effect/image_effect.h b/multimedia/image_effect/image_effect.h index ee5a5a33f3b..ae59ff948e2 100644 --- a/multimedia/image_effect/image_effect.h +++ b/multimedia/image_effect/image_effect.h @@ -74,6 +74,19 @@ OH_ImageEffect *OH_ImageEffect_Create(const char *name); */ OH_EffectFilter *OH_ImageEffect_AddFilter(OH_ImageEffect *imageEffect, const char *filterName); +/** + * @brief Add the OH_EffectFilter to the OH_ImageEffect by the OH_EffectFilter instance pointer + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param filter Indicates the filter instance that created by invoking OH_EffectFilter_Create + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_AddFilterByFilter(OH_ImageEffect *imageEffect, OH_EffectFilter *filter); + /** * @brief Create and add the OH_EffectFilter to the OH_ImageEffect by specified position * @@ -87,6 +100,21 @@ OH_EffectFilter *OH_ImageEffect_AddFilter(OH_ImageEffect *imageEffect, const cha */ OH_EffectFilter *OH_ImageEffect_InsertFilter(OH_ImageEffect *imageEffect, uint32_t index, const char *filterName); +/** + * @brief Insert the OH_EffectFilter to the OH_ImageEffect by the OH_EffectFilter instance pointer + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param index Indicates the position of the OH_EffectFilter witch is added + * @param filter Indicates the filter instance that created by invoking OH_EffectFilter_Create + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer or the index is invalid value + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_InsertFilterByFilter(OH_ImageEffect *imageEffect, uint32_t index, + OH_EffectFilter *filter); + /** * @brief Remove all filters of the specified filter name * @@ -98,6 +126,47 @@ OH_EffectFilter *OH_ImageEffect_InsertFilter(OH_ImageEffect *imageEffect, uint32 */ int32_t OH_ImageEffect_RemoveFilter(OH_ImageEffect *imageEffect, const char *filterName); +/** + * @brief Remove the filter of the specified position + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param index Indicates the position of the OH_EffectFilter witch is removed + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer or the index is invalid value + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_RemoveFilterByIndex(OH_ImageEffect *imageEffect, uint32_t index); + +/** + * @brief Create and replace the OH_EffectFilter in the OH_ImageEffect by the filter name + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param index Indicates the position of the OH_EffectFilter witch is created and replaced + * @param filterName Indicates the name of the filter that can be customized by the developer or supported by the system + * @return Returns a pointer to an OH_EffectFilter instance if the index and filter name is valid, otherwise returns + * nullptr + * @since 12 + */ +OH_EffectFilter *OH_ImageEffect_ReplaceFilter(OH_ImageEffect *imageEffect, uint32_t index, const char *filterName); + +/** + * @brief Replace the OH_EffectFilter in the OH_ImageEffect by the OH_EffectFilter instance pointer + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param index Indicates the position of the OH_EffectFilter witch is replaced + * @param filter Indicates the filter instance that created by invoking OH_EffectFilter_Create + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer or the index is invalid value + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_ReplaceFilterByFilter(OH_ImageEffect *imageEffect, uint32_t index, + OH_EffectFilter *filter); + /** * @brief Get the number of the filters in OH_ImageEffect * diff --git a/multimedia/image_effect/libimage_effect.ndk.json b/multimedia/image_effect/libimage_effect.ndk.json index fc19da6bd5a..6b3c6abab74 100644 --- a/multimedia/image_effect/libimage_effect.ndk.json +++ b/multimedia/image_effect/libimage_effect.ndk.json @@ -131,14 +131,34 @@ "first_introduced": "12", "name": "OH_ImageEffect_AddFilter" }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_AddFilterByFilter" + }, { "first_introduced": "12", "name": "OH_ImageEffect_InsertFilter" }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_InsertFilterByFilter" + }, { "first_introduced": "12", "name": "OH_ImageEffect_RemoveFilter" }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_RemoveFilterByIndex" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_ReplaceFilter" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_ReplaceFilterByFilter" + }, { "first_introduced": "12", "name": "OH_ImageEffect_GetFilterCount" -- Gitee