14d949f91Sopenharmony_ci/*
24d949f91Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
34d949f91Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
44d949f91Sopenharmony_ci * you may not use this file except in compliance with the License.
54d949f91Sopenharmony_ci * You may obtain a copy of the License at
64d949f91Sopenharmony_ci *
74d949f91Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
84d949f91Sopenharmony_ci *
94d949f91Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
104d949f91Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
114d949f91Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
124d949f91Sopenharmony_ci * See the License for the specific language governing permissions and
134d949f91Sopenharmony_ci * limitations under the License.
144d949f91Sopenharmony_ci */
154d949f91Sopenharmony_ci
164d949f91Sopenharmony_ci/**
174d949f91Sopenharmony_ci * @addtogroup ImageEffect
184d949f91Sopenharmony_ci * @{
194d949f91Sopenharmony_ci *
204d949f91Sopenharmony_ci * @brief Provides APIs for obtaining and using a image effect.
214d949f91Sopenharmony_ci *
224d949f91Sopenharmony_ci * @since 12
234d949f91Sopenharmony_ci */
244d949f91Sopenharmony_ci
254d949f91Sopenharmony_ci/**
264d949f91Sopenharmony_ci * @file image_effect_interface.h
274d949f91Sopenharmony_ci *
284d949f91Sopenharmony_ci * @brief Declares the functions for rendering image.
294d949f91Sopenharmony_ci *
304d949f91Sopenharmony_ci * @library libimage_effect.so
314d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
324d949f91Sopenharmony_ci * @since 12
334d949f91Sopenharmony_ci */
344d949f91Sopenharmony_ci
354d949f91Sopenharmony_ci#ifndef NATIVE_IMAGE_EFFECT_H
364d949f91Sopenharmony_ci#define NATIVE_IMAGE_EFFECT_H
374d949f91Sopenharmony_ci
384d949f91Sopenharmony_ci#include "image_effect_errors.h"
394d949f91Sopenharmony_ci#include "image_effect_filter.h"
404d949f91Sopenharmony_ci
414d949f91Sopenharmony_ci#ifdef __cplusplus
424d949f91Sopenharmony_ciextern "C" {
434d949f91Sopenharmony_ci#endif
444d949f91Sopenharmony_ci
454d949f91Sopenharmony_citypedef struct OH_NativeBuffer OH_NativeBuffer;
464d949f91Sopenharmony_citypedef struct NativeWindow OHNativeWindow;
474d949f91Sopenharmony_citypedef struct OH_PictureNative OH_PictureNative;
484d949f91Sopenharmony_ci
494d949f91Sopenharmony_ci/**
504d949f91Sopenharmony_ci * @brief Define the new type name OH_ImageEffect for struct OH_ImageEffect
514d949f91Sopenharmony_ci *
524d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
534d949f91Sopenharmony_ci * @since 12
544d949f91Sopenharmony_ci */
554d949f91Sopenharmony_citypedef struct OH_ImageEffect OH_ImageEffect;
564d949f91Sopenharmony_ci
574d949f91Sopenharmony_ci/**
584d949f91Sopenharmony_ci * @brief Create an OH_ImageEffect instance. It should be noted that the life cycle of the OH_ImageEffect instance
594d949f91Sopenharmony_ci * pointed to by the return value * needs to be manually released by {@link OH_ImageEffect_Release}
604d949f91Sopenharmony_ci *
614d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
624d949f91Sopenharmony_ci * @param name The name of image effect
634d949f91Sopenharmony_ci * @return Returns a pointer to an OH_ImageEffect instance if the execution is successful, otherwise returns nullptr
644d949f91Sopenharmony_ci * @since 12
654d949f91Sopenharmony_ci */
664d949f91Sopenharmony_ciOH_ImageEffect *OH_ImageEffect_Create(const char *name);
674d949f91Sopenharmony_ci
684d949f91Sopenharmony_ci/**
694d949f91Sopenharmony_ci * @brief Create and add the OH_EffectFilter to the OH_ImageEffect
704d949f91Sopenharmony_ci *
714d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
724d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
734d949f91Sopenharmony_ci * @param filterName Indicates the name of the filter that can be customized by the developer or supported by the system
744d949f91Sopenharmony_ci * @return Returns a pointer to an OH_EffectFilter instance if the filter name is valid, otherwise returns nullptr
754d949f91Sopenharmony_ci * @since 12
764d949f91Sopenharmony_ci */
774d949f91Sopenharmony_ciOH_EffectFilter *OH_ImageEffect_AddFilter(OH_ImageEffect *imageEffect, const char *filterName);
784d949f91Sopenharmony_ci
794d949f91Sopenharmony_ci/**
804d949f91Sopenharmony_ci * @brief Add the OH_EffectFilter to the OH_ImageEffect
814d949f91Sopenharmony_ci *
824d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
834d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
844d949f91Sopenharmony_ci * @param filter Indicates the filter instance that created by invoking OH_EffectFilter_Create
854d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
864d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
874d949f91Sopenharmony_ci * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer
884d949f91Sopenharmony_ci * @since 12
894d949f91Sopenharmony_ci */
904d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_AddFilterByFilter(OH_ImageEffect *imageEffect, OH_EffectFilter *filter);
914d949f91Sopenharmony_ci
924d949f91Sopenharmony_ci/**
934d949f91Sopenharmony_ci * @brief Create and add the OH_EffectFilter to the OH_ImageEffect by specified position
944d949f91Sopenharmony_ci *
954d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
964d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
974d949f91Sopenharmony_ci * @param index Indicates the position of the OH_EffectFilter witch is created and added
984d949f91Sopenharmony_ci * @param filterName Indicates the name of the filter that can be customized by the developer or supported by the system
994d949f91Sopenharmony_ci * @return Returns a pointer to an OH_EffectFilter instance if the index and filter name is valid, otherwise returns
1004d949f91Sopenharmony_ci * nullptr
1014d949f91Sopenharmony_ci * @since 12
1024d949f91Sopenharmony_ci */
1034d949f91Sopenharmony_ciOH_EffectFilter *OH_ImageEffect_InsertFilter(OH_ImageEffect *imageEffect, uint32_t index, const char *filterName);
1044d949f91Sopenharmony_ci
1054d949f91Sopenharmony_ci/**
1064d949f91Sopenharmony_ci * @brief Add the OH_EffectFilter to the OH_ImageEffect by specified position
1074d949f91Sopenharmony_ci *
1084d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
1094d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
1104d949f91Sopenharmony_ci * @param index Indicates the position of the OH_EffectFilter witch is added
1114d949f91Sopenharmony_ci * @param filter Indicates the filter instance that created by invoking OH_EffectFilter_Create
1124d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
1134d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
1144d949f91Sopenharmony_ci * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer or the index is invalid value
1154d949f91Sopenharmony_ci * @since 12
1164d949f91Sopenharmony_ci */
1174d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_InsertFilterByFilter(OH_ImageEffect *imageEffect, uint32_t index,
1184d949f91Sopenharmony_ci    OH_EffectFilter *filter);
1194d949f91Sopenharmony_ci
1204d949f91Sopenharmony_ci/**
1214d949f91Sopenharmony_ci * @brief Remove all filters of the specified filter name
1224d949f91Sopenharmony_ci *
1234d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
1244d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
1254d949f91Sopenharmony_ci * @param filterName Indicates the name of the filter that can be customized by the developer or supported by the system
1264d949f91Sopenharmony_ci * @return Returns the number of the filters that matches the specified filter name
1274d949f91Sopenharmony_ci * @since 12
1284d949f91Sopenharmony_ci */
1294d949f91Sopenharmony_ciint32_t OH_ImageEffect_RemoveFilter(OH_ImageEffect *imageEffect, const char *filterName);
1304d949f91Sopenharmony_ci
1314d949f91Sopenharmony_ci/**
1324d949f91Sopenharmony_ci * @brief Remove the filter of the specified position
1334d949f91Sopenharmony_ci *
1344d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
1354d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
1364d949f91Sopenharmony_ci * @param index Indicates the position of the OH_EffectFilter witch is removed
1374d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
1384d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
1394d949f91Sopenharmony_ci * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer or the index is invalid value
1404d949f91Sopenharmony_ci * @since 12
1414d949f91Sopenharmony_ci */
1424d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_RemoveFilterByIndex(OH_ImageEffect *imageEffect, uint32_t index);
1434d949f91Sopenharmony_ci
1444d949f91Sopenharmony_ci/**
1454d949f91Sopenharmony_ci * @brief Create and replace the OH_EffectFilter to the OH_ImageEffect by specified position
1464d949f91Sopenharmony_ci *
1474d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
1484d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
1494d949f91Sopenharmony_ci * @param index Indicates the position of the OH_EffectFilter witch is created and replaced
1504d949f91Sopenharmony_ci * @param filterName Indicates the name of the filter that can be customized by the developer or supported by the system
1514d949f91Sopenharmony_ci * @return Returns a pointer to an OH_EffectFilter instance if the index and filter name is valid, otherwise returns
1524d949f91Sopenharmony_ci * nullptr
1534d949f91Sopenharmony_ci * @since 12
1544d949f91Sopenharmony_ci */
1554d949f91Sopenharmony_ciOH_EffectFilter *OH_ImageEffect_ReplaceFilter(OH_ImageEffect *imageEffect, uint32_t index, const char *filterName);
1564d949f91Sopenharmony_ci
1574d949f91Sopenharmony_ci/**
1584d949f91Sopenharmony_ci * @brief Replace the OH_EffectFilter to the OH_ImageEffect by specified position
1594d949f91Sopenharmony_ci *
1604d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
1614d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
1624d949f91Sopenharmony_ci * @param index Indicates the position of the OH_EffectFilter witch is replaced
1634d949f91Sopenharmony_ci * @param filter Indicates the filter instance that created by invoking OH_EffectFilter_Create
1644d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
1654d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
1664d949f91Sopenharmony_ci * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer or the index is invalid value
1674d949f91Sopenharmony_ci * @since 12
1684d949f91Sopenharmony_ci */
1694d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_ReplaceFilterByFilter(OH_ImageEffect *imageEffect, uint32_t index,
1704d949f91Sopenharmony_ci    OH_EffectFilter *filter);
1714d949f91Sopenharmony_ci
1724d949f91Sopenharmony_ci/**
1734d949f91Sopenharmony_ci * @brief Get the number of the filters in OH_ImageEffect
1744d949f91Sopenharmony_ci *
1754d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
1764d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
1774d949f91Sopenharmony_ci * @return Returns the number of the filters in OH_ImageEffect
1784d949f91Sopenharmony_ci * @since 12
1794d949f91Sopenharmony_ci */
1804d949f91Sopenharmony_ciint32_t OH_ImageEffect_GetFilterCount(OH_ImageEffect *imageEffect);
1814d949f91Sopenharmony_ci
1824d949f91Sopenharmony_ci/**
1834d949f91Sopenharmony_ci * @brief Get an OH_EffectFilter instance that add to OH_ImageEffect by the index
1844d949f91Sopenharmony_ci *
1854d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
1864d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
1874d949f91Sopenharmony_ci * @param index Indicates the position of the OH_EffectFilter that add to OH_ImageEffect
1884d949f91Sopenharmony_ci * @return Returns a pointer to an OH_EffectFilter instance if the index is valid, otherwise returns nullptr
1894d949f91Sopenharmony_ci * @since 12
1904d949f91Sopenharmony_ci */
1914d949f91Sopenharmony_ciOH_EffectFilter *OH_ImageEffect_GetFilter(OH_ImageEffect *imageEffect, uint32_t index);
1924d949f91Sopenharmony_ci
1934d949f91Sopenharmony_ci/**
1944d949f91Sopenharmony_ci * @brief Set configuration information to the OH_ImageEffect
1954d949f91Sopenharmony_ci *
1964d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
1974d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
1984d949f91Sopenharmony_ci * @param key Indicates the key of the configuration
1994d949f91Sopenharmony_ci * @param value Indicates the value corresponding to the key of the configuration
2004d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
2014d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
2024d949f91Sopenharmony_ci * @since 12
2034d949f91Sopenharmony_ci */
2044d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_Configure(OH_ImageEffect *imageEffect, const char *key,
2054d949f91Sopenharmony_ci    const ImageEffect_Any *value);
2064d949f91Sopenharmony_ci
2074d949f91Sopenharmony_ci/**
2084d949f91Sopenharmony_ci * @brief Set the Surface to the image effect, this interface must be called before
2094d949f91Sopenharmony_ci * @{link OH_ImageEffect_GetInputSurface} is called
2104d949f91Sopenharmony_ci *
2114d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
2124d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
2134d949f91Sopenharmony_ci * @param nativeWindow A pointer to a OHNativeWindow instance, see {@link OHNativeWindow}
2144d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
2154d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
2164d949f91Sopenharmony_ci * @since 12
2174d949f91Sopenharmony_ci */
2184d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_SetOutputSurface(OH_ImageEffect *imageEffect, OHNativeWindow *nativeWindow);
2194d949f91Sopenharmony_ci
2204d949f91Sopenharmony_ci/**
2214d949f91Sopenharmony_ci * @brief Get the input Surface from the image effect, this interface must be called after
2224d949f91Sopenharmony_ci * @{link OH_ImageEffect_SetOutputSurface} is called
2234d949f91Sopenharmony_ci *
2244d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
2254d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
2264d949f91Sopenharmony_ci * @param nativeWindow A pointer to a OHNativeWindow instance, see {@link OHNativeWindow}
2274d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
2284d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
2294d949f91Sopenharmony_ci * @since 12
2304d949f91Sopenharmony_ci */
2314d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_GetInputSurface(OH_ImageEffect *imageEffect, OHNativeWindow **nativeWindow);
2324d949f91Sopenharmony_ci
2334d949f91Sopenharmony_ci/**
2344d949f91Sopenharmony_ci * @brief Set input pixelmap that contains the image information. It should be noted that the input pixel map will be
2354d949f91Sopenharmony_ci * directly rendered and modified if the output is not set
2364d949f91Sopenharmony_ci *
2374d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
2384d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
2394d949f91Sopenharmony_ci * @param pixelmap Indicates the OH_PixelmapNative that contains the image information
2404d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
2414d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
2424d949f91Sopenharmony_ci * @since 12
2434d949f91Sopenharmony_ci */
2444d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_SetInputPixelmap(OH_ImageEffect *imageEffect, OH_PixelmapNative *pixelmap);
2454d949f91Sopenharmony_ci
2464d949f91Sopenharmony_ci/**
2474d949f91Sopenharmony_ci * @brief Set output pixelmap that contains the image information
2484d949f91Sopenharmony_ci *
2494d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
2504d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
2514d949f91Sopenharmony_ci * @param pixelmap Indicates the OH_PixelmapNative that contains the image information
2524d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
2534d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
2544d949f91Sopenharmony_ci * @since 12
2554d949f91Sopenharmony_ci */
2564d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_SetOutputPixelmap(OH_ImageEffect *imageEffect, OH_PixelmapNative *pixelmap);
2574d949f91Sopenharmony_ci
2584d949f91Sopenharmony_ci/**
2594d949f91Sopenharmony_ci * @brief Set input NativeBuffer that contains the image information. It should be noted that the input NativeBuffer
2604d949f91Sopenharmony_ci * will be directly rendered and modified if the output is not set
2614d949f91Sopenharmony_ci *
2624d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
2634d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
2644d949f91Sopenharmony_ci * @param nativeBuffer Indicates the NativeBuffer that contains the image information
2654d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
2664d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
2674d949f91Sopenharmony_ci * @since 12
2684d949f91Sopenharmony_ci */
2694d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_SetInputNativeBuffer(OH_ImageEffect *imageEffect, OH_NativeBuffer *nativeBuffer);
2704d949f91Sopenharmony_ci
2714d949f91Sopenharmony_ci/**
2724d949f91Sopenharmony_ci * @brief Set output NativeBuffer that contains the image information
2734d949f91Sopenharmony_ci *
2744d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
2754d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
2764d949f91Sopenharmony_ci * @param nativeBuffer Indicates the NativeBuffer that contains the image information
2774d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
2784d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
2794d949f91Sopenharmony_ci * @since 12
2804d949f91Sopenharmony_ci */
2814d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_SetOutputNativeBuffer(OH_ImageEffect *imageEffect, OH_NativeBuffer *nativeBuffer);
2824d949f91Sopenharmony_ci
2834d949f91Sopenharmony_ci/**
2844d949f91Sopenharmony_ci * @brief Set input URI of the image. It should be noted that the image resource will be directly rendered and modified
2854d949f91Sopenharmony_ci * if the output is not set
2864d949f91Sopenharmony_ci *
2874d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
2884d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
2894d949f91Sopenharmony_ci * @param uri An URI for a image resource
2904d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
2914d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
2924d949f91Sopenharmony_ci * @since 12
2934d949f91Sopenharmony_ci */
2944d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_SetInputUri(OH_ImageEffect *imageEffect, const char *uri);
2954d949f91Sopenharmony_ci
2964d949f91Sopenharmony_ci/**
2974d949f91Sopenharmony_ci * @brief Set output URI of the image
2984d949f91Sopenharmony_ci *
2994d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
3004d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
3014d949f91Sopenharmony_ci * @param uri An URI for a image resource
3024d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
3034d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
3044d949f91Sopenharmony_ci * @since 12
3054d949f91Sopenharmony_ci */
3064d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_SetOutputUri(OH_ImageEffect *imageEffect, const char *uri);
3074d949f91Sopenharmony_ci
3084d949f91Sopenharmony_ci/**
3094d949f91Sopenharmony_ci * @brief Set input picture that contains the image information. It should be noted that the input picture will be
3104d949f91Sopenharmony_ci * directly rendered and modified if the output is not set
3114d949f91Sopenharmony_ci *
3124d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
3134d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
3144d949f91Sopenharmony_ci * @param picture Indicates the OH_PictureNative that contains the image information
3154d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
3164d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
3174d949f91Sopenharmony_ci * @since 12
3184d949f91Sopenharmony_ci */
3194d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_SetInputPicture(OH_ImageEffect *imageEffect, OH_PictureNative *picture);
3204d949f91Sopenharmony_ci
3214d949f91Sopenharmony_ci/**
3224d949f91Sopenharmony_ci * @brief Set output picture that contains the image information
3234d949f91Sopenharmony_ci *
3244d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
3254d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
3264d949f91Sopenharmony_ci * @param picture Indicates the OH_PictureNative that contains the image information
3274d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
3284d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
3294d949f91Sopenharmony_ci * @since 12
3304d949f91Sopenharmony_ci */
3314d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_SetOutputPicture(OH_ImageEffect *imageEffect, OH_PictureNative *picture);
3324d949f91Sopenharmony_ci
3334d949f91Sopenharmony_ci/**
3344d949f91Sopenharmony_ci * @brief Render the filter effects that can be a single filter or a chain of filters
3354d949f91Sopenharmony_ci *
3364d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
3374d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
3384d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
3394d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
3404d949f91Sopenharmony_ci * @since 12
3414d949f91Sopenharmony_ci */
3424d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_Start(OH_ImageEffect *imageEffect);
3434d949f91Sopenharmony_ci
3444d949f91Sopenharmony_ci/**
3454d949f91Sopenharmony_ci * @brief Stop rendering the filter effects for next image frame data
3464d949f91Sopenharmony_ci *
3474d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
3484d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
3494d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
3504d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
3514d949f91Sopenharmony_ci * @since 12
3524d949f91Sopenharmony_ci */
3534d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_Stop(OH_ImageEffect *imageEffect);
3544d949f91Sopenharmony_ci
3554d949f91Sopenharmony_ci/**
3564d949f91Sopenharmony_ci * @brief Clear the internal resources of the OH_ImageEffect and destroy the OH_ImageEffect instance
3574d949f91Sopenharmony_ci *
3584d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
3594d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
3604d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
3614d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
3624d949f91Sopenharmony_ci * @since 12
3634d949f91Sopenharmony_ci */
3644d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_Release(OH_ImageEffect *imageEffect);
3654d949f91Sopenharmony_ci
3664d949f91Sopenharmony_ci/**
3674d949f91Sopenharmony_ci * @brief Convert the OH_ImageEffect and the information of the filters in OH_ImageEffect to JSON string
3684d949f91Sopenharmony_ci *
3694d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
3704d949f91Sopenharmony_ci * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer
3714d949f91Sopenharmony_ci * @param info Indicates the serialized information that is obtained by converting the information of the filters in
3724d949f91Sopenharmony_ci * OH_ImageEffect to JSON string
3734d949f91Sopenharmony_ci * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to
3744d949f91Sopenharmony_ci * {@link ImageEffect_ErrorCode}
3754d949f91Sopenharmony_ci * @since 12
3764d949f91Sopenharmony_ci */
3774d949f91Sopenharmony_ciImageEffect_ErrorCode OH_ImageEffect_Save(OH_ImageEffect *imageEffect, char **info);
3784d949f91Sopenharmony_ci
3794d949f91Sopenharmony_ci/**
3804d949f91Sopenharmony_ci * @brief Create an OH_ImageEffect instance by deserializing the JSON string info
3814d949f91Sopenharmony_ci *
3824d949f91Sopenharmony_ci * @syscap SystemCapability.Multimedia.ImageEffect.Core
3834d949f91Sopenharmony_ci * @param info Indicates the serialized information that is obtained by converting the information of the filters in
3844d949f91Sopenharmony_ci * OH_ImageEffect to JSON string
3854d949f91Sopenharmony_ci * @return Returns a pointer to an OH_ImageEffect instance if the execution is successful, otherwise returns nullptr
3864d949f91Sopenharmony_ci * @since 12
3874d949f91Sopenharmony_ci */
3884d949f91Sopenharmony_ciOH_ImageEffect *OH_ImageEffect_Restore(const char *info);
3894d949f91Sopenharmony_ci
3904d949f91Sopenharmony_ci#ifdef __cplusplus
3914d949f91Sopenharmony_ci}
3924d949f91Sopenharmony_ci#endif
3934d949f91Sopenharmony_ci#endif // NATIVE_IMAGE_EFFECT_H
3944d949f91Sopenharmony_ci/** @} */