diff --git a/multimedia/image_effect/BUILD.gn b/multimedia/image_effect/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..ce73bd9a3f70c64b88622c15e38373aebfecb73e --- /dev/null +++ b/multimedia/image_effect/BUILD.gn @@ -0,0 +1,37 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_library("libimage_effect") { + ndk_description_file = "./libimage_effect.ndk.json" + min_compact_version = "12" + output_name = "image_effect" + output_extension = "so" + system_capability = "SystemCapability.Multimedia.ImageEffect.Core" + system_capability_headers = [ + "multimedia/image_effect/image_effect_errors.h", + "multimedia/image_effect/image_effect_filter.h", + "multimedia/image_effect/image_effect.h", + ] +} + +ohos_ndk_headers("libimage_effect_header") { + dest_dir = "$ndk_headers_out_dir/multimedia/image_effect" + sources = [ + "image_effect.h", + "image_effect_errors.h", + "image_effect_filter.h", + ] +} diff --git a/multimedia/image_effect/image_effect.h b/multimedia/image_effect/image_effect.h new file mode 100644 index 0000000000000000000000000000000000000000..383a338dd93fe68bd60a86653052e613bf890913 --- /dev/null +++ b/multimedia/image_effect/image_effect.h @@ -0,0 +1,298 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup ImageEffect + * @{ + * + * @brief Provides APIs for obtaining and using a image effect. + * + * @since 12 + */ + +/** + * @file image_effect.h + * + * @brief Declares the functions for rendering image. + * + * @library libimage_effect.so + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ + +#ifndef NATIVE_IMAGE_EFFECT_H +#define NATIVE_IMAGE_EFFECT_H + +#include "image_effect_errors.h" +#include "image_effect_filter.h" +#include "native_buffer/native_buffer.h" +#include "native_window/external_window.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Define the new type name OH_ImageEffect for struct OH_ImageEffect + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef struct OH_ImageEffect OH_ImageEffect; + +/** + * @brief Create an OH_ImageEffect instance. It should be noted that the life cycle of the OH_ImageEffect instance + * pointed to by the return value * needs to be manually released by {@link OH_ImageEffect_Release} + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param name The name of image effect + * @return Returns a pointer to an OH_ImageEffect instance if the execution is successful, otherwise returns nullptr + * @since 12 + */ +OH_ImageEffect *OH_ImageEffect_Create(const char *name); + +/** + * @brief Create and add the OH_EffectFilter to the OH_ImageEffect + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @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 filter name is valid, otherwise returns nullptr + * @since 12 + */ +OH_EffectFilter *OH_ImageEffect_AddFilter(OH_ImageEffect *imageEffect, const char *filterName); + +/** + * @brief Create and add the OH_EffectFilter to the OH_ImageEffect by 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 created and added + * @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_InsertFilter(OH_ImageEffect *imageEffect, uint32_t index, const char *filterName); + +/** + * @brief Remove all filters of the specified filter name + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param filterName Indicates the name of the filter that can be customized by the developer or supported by the system + * @return Returns the number of the filters that matches the specified filter name + * @since 12 + */ +int32_t OH_ImageEffect_RemoveFilter(OH_ImageEffect *imageEffect, const char *filterName); + +/** + * @brief Get the number of the filters in OH_ImageEffect + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @return Returns the number of the filters in OH_ImageEffect + * @since 12 + */ +int32_t OH_ImageEffect_GetFilterCount(OH_ImageEffect *imageEffect); + +/** + * @brief Get an OH_EffectFilter instance that add to OH_ImageEffect by the index + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param index Indicates the position of the OH_EffectFilter that add to OH_ImageEffect + * @return Returns a pointer to an OH_EffectFilter instance if the index is valid, otherwise returns nullptr + * @since 12 + */ +OH_EffectFilter *OH_ImageEffect_GetFilter(OH_ImageEffect *imageEffect, uint32_t index); + +/** + * @brief Set configuration information to the OH_ImageEffect + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param key Indicates the key of the configuration + * @param value Indicates the value corresponding to the key of the configuration + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_Configure(OH_ImageEffect *imageEffect, const char *key, + const ImageEffect_Any *value); + +/** + * @brief Set the Surface to the image effect, this interface must be called before + * @{link OH_ImageEffect_GetInputSurface} is called + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param nativeWindow A pointer to a OHNativeWindow instance, see {@link OHNativeWindow} + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_SetOutputSurface(OH_ImageEffect *imageEffect, OHNativeWindow *nativeWindow); + +/** + * @brief Get the input Surface from the image effect, this interface must be called after + * @{link OH_ImageEffect_SetOutputSurface} is called + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param nativeWindow A pointer to a OHNativeWindow instance, see {@link OHNativeWindow} + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_GetInputSurface(OH_ImageEffect *imageEffect, OHNativeWindow **nativeWindow); + +/** + * @brief Set input pixelmap that contains the image information. It should be noted that the input pixel map will be + * directly rendered and modified if the output is not set + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param pixelmap Indicates the OH_PixelmapNative that contains the image information + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_SetInputPixelmap(OH_ImageEffect *imageEffect, OH_PixelmapNative *pixelmap); + +/** + * @brief Set output pixelmap that contains the image information + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param pixelmap Indicates the OH_PixelmapNative that contains the image information + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_SetOutputPixelmap(OH_ImageEffect *imageEffect, OH_PixelmapNative *pixelmap); + +/** + * @brief Set input NativeBuffer that contains the image information. It should be noted that the input NativeBuffer + * will be directly rendered and modified if the output is not set + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param nativeBuffer Indicates the NativeBuffer that contains the image information + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_SetInputNativeBuffer(OH_ImageEffect *imageEffect, OH_NativeBuffer *nativeBuffer); + +/** + * @brief Set output NativeBuffer that contains the image information + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param nativeBuffer Indicates the NativeBuffer that contains the image information + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_SetOutputNativeBuffer(OH_ImageEffect *imageEffect, OH_NativeBuffer *nativeBuffer); + +/** + * @brief Set input URI of the image. It should be noted that the image resource will be directly rendered and modified + * if the output is not set + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param uri An URI for a image resource + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_SetInputUri(OH_ImageEffect *imageEffect, const char *uri); + +/** + * @brief Set output URI of the image + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param uri An URI for a image resource + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_SetOutputUri(OH_ImageEffect *imageEffect, const char *uri); + +/** + * @brief Render the filter effects that can be a single filter or a chain of filters + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_Start(OH_ImageEffect *imageEffect); + +/** + * @brief Stop rendering the filter effects for next image frame data + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_Stop(OH_ImageEffect *imageEffect); + +/** + * @brief Clear the internal resources of the OH_ImageEffect and destroy the OH_ImageEffect instance + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_Release(OH_ImageEffect *imageEffect); + +/** + * @brief Convert the OH_ImageEffect and the information of the filters in OH_ImageEffect to JSON string + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param info Indicates the serialized information that is obtained by converting the information of the filters in + * OH_ImageEffect to JSON string + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_Save(OH_ImageEffect *imageEffect, char **info); + +/** + * @brief Create an OH_ImageEffect instance by deserializing the JSON string info + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Indicates the serialized information that is obtained by converting the information of the filters in + * OH_ImageEffect to JSON string + * @return Returns a pointer to an OH_ImageEffect instance if the execution is successful, otherwise returns nullptr + * @since 12 + */ +OH_ImageEffect *OH_ImageEffect_Restore(const char *info); + +#ifdef __cplusplus +} +#endif +#endif // NATIVE_IMAGE_EFFECT_H +/** @} */ \ No newline at end of file diff --git a/multimedia/image_effect/image_effect_errors.h b/multimedia/image_effect/image_effect_errors.h new file mode 100644 index 0000000000000000000000000000000000000000..4d2f5245cdceb3583b2d86dfe5e744c4802bcbf5 --- /dev/null +++ b/multimedia/image_effect/image_effect_errors.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup ImageEffect + * @{ + * + * @brief Provides the error code for ImageEffect. + * + * @since 12 + */ + +/** + * @file image_effect_errors.h + * + * @brief Defines the error code used in ImageEffect. + * + * @library libimage_effect.so + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ + +#ifndef NATIVE_IMAGE_EFFECT_ERRORS_H +#define NATIVE_IMAGE_EFFECT_ERRORS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Effect error code + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef enum ImageEffect_ErrorCode { + /** + * The operation completed successfully. + */ + EFFECT_SUCCESS = 0, + /** + * Permission denied. + */ + EFFECT_ERROR_PERMISSION_DENIED = 201, + /** + * Invalid parameter. + */ + EFFECT_ERROR_PARAM_INVALID = 401, + /** + * Warning code if input and output buffer size is not match, it will be rendered through output buffer size. + */ + EFFECT_BUFFER_SIZE_NOT_MATCH = 29000001, + /** + * Warning code if input and output color space is not match, it will be rendered by modifying the color space of + * output image. + */ + EFFECT_COLOR_SPACE_NOT_MATCH = 29000002, + /** + * The input and output image type is not match. For example, set input OH_Pixelmap and set output NativeBuffer. + */ + EFFECT_INPUT_OUTPUT_NOT_MATCH = 29000101, + /** + * Over the max number of the filters that can be added. + */ + EFFECT_EFFECT_NUMBER_LIMITED = 29000102, + /** + * The input or output image type is not supported. For example, the pixel format beyond the current definition. + */ + EFFECT_INPUT_OUTPUT_NOT_SUPPORTED = 29000103, + /** + * Allocate memory fail. For example, over sized image resource. + */ + EFFECT_ALLOCATE_MEMORY_FAILED = 29000104, + /** + * Parameter error. For example, the invalid value set for filter. + */ + EFFECT_PARAM_ERROR = 29000121, + /** + * Key error. For example, the invalid key set for filter. + */ + EFFECT_KEY_ERROR = 29000122, + /** + * Unknown error. + */ + EFFECT_UNKNOWN = 29000199, +} ImageEffect_ErrorCode; + +#ifdef __cplusplus +} +#endif +#endif // NATIVE_IMAGE_EFFECT_ERRORS_H +/** @} */ \ No newline at end of file diff --git a/multimedia/image_effect/image_effect_filter.h b/multimedia/image_effect/image_effect_filter.h new file mode 100644 index 0000000000000000000000000000000000000000..803c7fa032e3af045709c190d6ceda5e1e79b1ff --- /dev/null +++ b/multimedia/image_effect/image_effect_filter.h @@ -0,0 +1,699 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup ImageEffect + * @{ + * + * @brief Provides APIs for obtaining and using a image filter. + * + * @since 12 + */ + +/** + * @file image_effect_filter.h + * + * @brief Declares the functions for setting filter parameters, registering custom filter and filter lookup information. + * + * @library libimage_effect.so + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ + +#ifndef NATIVE_IMAGE_EFFECT_FILTER_H +#define NATIVE_IMAGE_EFFECT_FILTER_H + +#include +#include "image_effect_errors.h" +#include "multimedia/image_framework/pixelmap_native.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Define the new type name OH_EffectFilter for struct OH_EffectFilter + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef struct OH_EffectFilter OH_EffectFilter; + +/** + * @brief Define the brightness filter name that contain the parameter matched with the key refer to + * OH_EFFECT_FILTER_INTENSITY_KEY and the value refer to {@link ImageEffect_Any} that contain the data type of + * {@link EFFECT_DATA_TYPE_FLOAT} + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +#define OH_EFFECT_BRIGHTNESS_FILTER "Brightness" + +/** + * @brief Define the contrast filter name that contain the parameter matched with the key refer to + * OH_EFFECT_FILTER_INTENSITY_KEY and the value refer to {@link ImageEffect_Any} that contain the data type of + * {@link EFFECT_DATA_TYPE_FLOAT} + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +#define OH_EFFECT_CONTRAST_FILTER "Contrast" + +/** + * @brief Define the crop filter name that contain the parameter matched with the key refer to + * OH_EFFECT_FILTER_REGION_KEY and the value refer to {@link ImageEffect_Any} that contain the data type of + * {@link EFFECT_DATA_TYPE_PTR} for {@link ImageEffect_Region} + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +#define OH_EFFECT_CROP_FILTER "Crop" + +/** + * @brief Define the key that means intensity + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +#define OH_EFFECT_FILTER_INTENSITY_KEY "FilterIntensity" + +/** + * @brief Define the key that means region and matches the value ref to {@link ImageEffect_Any} contain the data type of + * {@link EFFECT_DATA_TYPE_PTR} for {@link ImageEffect_Region} + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +#define OH_EFFECT_FILTER_REGION_KEY "FilterRegion" + +/** + * @brief Enumerates the data type + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef enum ImageEffect_DataType { + /** unknown data type */ + EFFECT_DATA_TYPE_UNKNOWN = 0, + /** int32_t data type */ + EFFECT_DATA_TYPE_INT32 = 1, + /** float data type */ + EFFECT_DATA_TYPE_FLOAT = 2, + /** double data type */ + EFFECT_DATA_TYPE_DOUBLE = 3, + /** char data type */ + EFFECT_DATA_TYPE_CHAR = 4, + /** long data type */ + EFFECT_DATA_TYPE_LONG = 5, + /** bool data type */ + EFFECT_DATA_TYPE_BOOL = 6, + /** point data type */ + EFFECT_DATA_TYPE_PTR = 7, +} ImageEffect_DataType; + +/** + * @brief Data value for the union + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef union ImageEffect_DataValue { + /** Parameter of 32-bit integer value matches with {@link EFFECT_DATA_TYPE_INT32} */ + int32_t int32Value; + /** Parameter of float value matches with {@link EFFECT_DATA_TYPE_FLOAT} */ + float floatValue; + /** Parameter of double value matches with {@link EFFECT_DATA_TYPE_DOUBLE} */ + double doubleValue; + /** Parameter of character value matches with {@link EFFECT_DATA_TYPE_CHAR} */ + char charValue; + /** Parameter of long integer value matches with {@link EFFECT_DATA_TYPE_LONG} */ + long longValue; + /** Parameter of bool value matches with {@link EFFECT_DATA_TYPE_BOOL} */ + bool boolValue; + /** Parameter of point value matches with {@link EFFECT_DATA_TYPE_PTR} */ + void *ptrValue; +} ImageEffect_DataValue; + +/** + * @brief Data parameter struct information + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef struct ImageEffect_Any { + /** Effect any data type */ + ImageEffect_DataType dataType = ImageEffect_DataType::EFFECT_DATA_TYPE_UNKNOWN; + /** Effect any data value */ + ImageEffect_DataValue dataValue = { 0 }; +} ImageEffect_Any; + +/** + * @brief Enumerates the pixel format type + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef enum ImageEffect_Format { + /** Unknown pixel format */ + EFFECT_PIXEL_FORMAT_UNKNOWN = 0, + /** RGBA8888 pixel format */ + EFFECT_PIXEL_FORMAT_RGBA8888 = 1, + /** NV21 pixel format */ + EFFECT_PIXEL_FORMAT_NV21 = 2, + /** NV12 pixel format */ + EFFECT_PIXEL_FORMAT_NV12 = 3, + /** RGBA 10bit pixel format */ + EFFECT_PIXEL_FORMAT_RGBA1010102 = 4, + /** YCBCR420 semi-planar 10bit pixel format */ + EFFECT_PIXEL_FORMAT_YCBCR_P010 = 5, + /** YCRCB420 semi-planar 10bit pixel format */ + EFFECT_PIXEL_FORMAT_YCRCB_P010 = 6, +} ImageEffect_Format; + +/** + * @brief Enumerates the effect buffer type + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef enum ImageEffect_BufferType { + /** Unknown buffer type */ + EFFECT_BUFFER_TYPE_UNKNOWN = 0, + /** Pixel buffer type */ + EFFECT_BUFFER_TYPE_PIXEL = 1, + /** Texture buffer type */ + EFFECT_BUFFER_TYPE_TEXTURE = 2, +} ImageEffect_BufferType; + +/** + * @brief Define the new type name OH_EffectFilterInfo for struct OH_EffectFilterInfo + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef struct OH_EffectFilterInfo OH_EffectFilterInfo; + +/** + * @brief Create an OH_EffectFilterInfo instance. It should be noted that the life cycle of the OH_EffectFilterInfo + * instance pointed to by the return value * needs to be manually released by {@link OH_EffectFilterInfo_Release} + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @return Returns a pointer to an OH_EffectFilterInfo instance if the execution is successful, otherwise returns + * nullptr + * @since 12 + */ +OH_EffectFilterInfo *OH_EffectFilterInfo_Create(); + +/** + * @brief Set the filter name for OH_EffectFilterInfo structure + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectFilterInfo structure instance pointer + * @param name Indicates the filter name + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilterInfo_SetFilterName(OH_EffectFilterInfo *info, const char *name); + +/** + * @brief Get the filter name from OH_EffectFilterInfo structure + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectFilterInfo structure instance pointer + * @param name Indicates the filter name + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilterInfo_GetFilterName(OH_EffectFilterInfo *info, char **name); + +/** + * @brief Set the supported buffer types for OH_EffectFilterInfo structure + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectFilterInfo structure instance pointer + * @param size The size of {@link ImageEffect_BufferType} that can be supported + * @param bufferTypeArray Array of {@link ImageEffect_BufferType} that can be supported + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilterInfo_SetSupportedBufferTypes(OH_EffectFilterInfo *info, uint32_t size, + ImageEffect_BufferType *bufferTypeArray); + +/** + * @brief Get the supported buffer types from OH_EffectFilterInfo structure + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectFilterInfo structure instance pointer + * @param size The size of {@link OH_EffectBufferInfoType} that can be supported + * @param bufferTypeArray Array of {@link OH_EffectBufferInfoType} that can be supported + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilterInfo_GetSupportedBufferTypes(OH_EffectFilterInfo *info, uint32_t *size, + ImageEffect_BufferType **bufferTypeArray); + +/** + * @brief Set the supported formats for OH_EffectFilterInfo structure + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectFilterInfo structure instance pointer + * @param size The size of {@link ImageEffect_Format} that can be supported + * @param formatArray Array of {@link ImageEffect_Format} that can be supported + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilterInfo_SetSupportedFormats(OH_EffectFilterInfo *info, uint32_t size, + ImageEffect_Format *formatArray); + +/** + * @brief Get the supported formats from OH_EffectFilterInfo structure + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectFilterInfo structure instance pointer + * @param size The size of {@link ImageEffect_Format} that can be supported + * @param formatArray Array of {@link ImageEffect_Format} that can be supported + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilterInfo_GetSupportedFormats(OH_EffectFilterInfo *info, uint32_t *size, + ImageEffect_Format **formatArray); + +/** + * @brief Clear the internal resources of the OH_EffectFilterInfo and destroy the OH_EffectFilterInfo instance + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectFilterInfo structure instance pointer + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilterInfo_Release(OH_EffectFilterInfo *info); + +/** + * @brief EffectFilter names information + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef struct ImageEffect_FilterNames { + /** EffectFilter names array size */ + uint32_t size = 0; + /** EffectFilter names memory block */ + const char **nameList = nullptr; +} ImageEffect_FilterNames; + +/** + * @brief Define the new type name OH_EffectBufferInfo for struct OH_EffectBufferInfo + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef struct OH_EffectBufferInfo OH_EffectBufferInfo; + +/** + * @brief Create an OH_EffectBufferInfo instance. It should be noted that the life cycle of the OH_EffectBufferInfo + * instance pointed to by the return value * needs to be manually released by {@link OH_EffectBufferInfo_Release} + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @return Returns a pointer to an OH_EffectBufferInfo instance if the execution is successful, otherwise returns + * nullptr + * @since 12 + */ +OH_EffectBufferInfo *OH_EffectBufferInfo_Create(); + +/** + * @brief Set access to the address of the image in memory + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectBufferInfo structure instance pointer + * @param addr Indicates the address of the image in memory + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectBufferInfo_SetAddr(OH_EffectBufferInfo *info, void *addr); + +/** + * @brief Provide direct access to the address of the image in memory for rendering the filter effects + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectBufferInfo structure instance pointer + * @param addr Indicates the address of the image in memory + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectBufferInfo_GetAddr(OH_EffectBufferInfo *info, void **addr); + +/** + * @brief Set the width of the image in pixels + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectBufferInfo structure instance pointer + * @param width Indicates the width of the image + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectBufferInfo_SetWidth(OH_EffectBufferInfo *info, int32_t width); + +/** + * @brief Get the width of the image in pixels + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectBufferInfo structure instance pointer + * @param width Indicates the width of the image + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectBufferInfo_GetWidth(OH_EffectBufferInfo *info, int32_t *width); + +/** + * @brief Set the height of the image in pixels + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectBufferInfo structure instance pointer + * @param height Indicates the height of the image + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectBufferInfo_SetHeight(OH_EffectBufferInfo *info, int32_t height); + +/** + * @brief Get the height of the image in pixels + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectBufferInfo structure instance pointer + * @param height Indicates the height of the image + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectBufferInfo_GetHeight(OH_EffectBufferInfo *info, int32_t *height); + +/** + * @brief Set number of bytes per row for the image + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectBufferInfo structure instance pointer + * @param rowSize Indicates number of bytes per row + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectBufferInfo_SetRowSize(OH_EffectBufferInfo *info, int32_t rowSize); + +/** + * @brief Get number of bytes per row for the image + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectBufferInfo structure instance pointer + * @param rowSize Indicates number of bytes per row + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectBufferInfo_GetRowSize(OH_EffectBufferInfo *info, int32_t *rowSize); + +/** + * @brief Set the format of the image for OH_EffectBufferInfo + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectBufferInfo structure instance pointer + * @param format Indicates {@link ImageEffect_Format} of the image + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectBufferInfo_SetEffectFormat(OH_EffectBufferInfo *info, ImageEffect_Format format); + +/** + * @brief Get the format of the image from OH_EffectBufferInfo + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectBufferInfo structure instance pointer + * @param format Indicates {@link ImageEffect_Format} of the image + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectBufferInfo_GetEffectFormat(OH_EffectBufferInfo *info, ImageEffect_Format *format); + +/** + * @brief Clear the internal resources of the OH_EffectBufferInfo and destroy the OH_EffectBufferInfo instance + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Encapsulate OH_EffectBufferInfo structure instance pointer + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectBufferInfo_Release(OH_EffectBufferInfo *info); + +/** + * @brief When executing the method of {@link OH_EffectFilter_SetValue} for the delegate filter, the function pointer + * will be called for checking the parameters is valid for the delegate filter + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param filter Encapsulate OH_EffectFilter structure instance pointer + * @param key Indicates the key of the filter + * @param value Indicates the value corresponding to the key of the filter + * @return Returns true if the parameter is valid, otherwise returns false + * @since 12 + */ +typedef bool (*OH_EffectFilterDelegate_SetValue)(OH_EffectFilter *filter, const char *key, + const ImageEffect_Any *value); + +/** + * @brief Actively execute this callback function at the end of invoking the method of + * {@link OH_EffectFilterDelegate_Render} for passing possible new OH_EffectBufferInfo to the next filter. It should be + * noted that when passing new OH_EffectBufferInfo, the buffer in OH_EffectBufferInfo needs to be manually released + * after the execution of the function ends + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param filter Encapsulate OH_EffectFilter structure instance pointer + * @param info Indicates the information of the image, such as width, height, etc. See {@link OH_EffectBufferInfo} + * @since 12 + */ +typedef void (*OH_EffectFilterDelegate_PushData)(OH_EffectFilter *filter, OH_EffectBufferInfo *info); + +/** + * @brief When the method of OH_ImageEffect_Start is executed on delegate filter that is contained in OH_ImageEffect, + * the function pointer will be called for rendering the delegate filter effects + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param filter Encapsulate OH_EffectFilter structure instance pointer + * @param info Indicates the information of the image, such as width, height, etc. See {@link OH_EffectBufferInfo} + * @param pushData Indicates the callback function for passing possible new OH_EffectBufferInfo to the next filter. See + * {@link OH_EffectFilterDelegate_PushData} + * @return Returns true if this function point is executed successfully, otherwise returns false + * @since 12 + */ +typedef bool (*OH_EffectFilterDelegate_Render)(OH_EffectFilter *filter, OH_EffectBufferInfo *info, + OH_EffectFilterDelegate_PushData pushData); + +/** + * @brief When the method of OH_ImageEffect_Save is executed on delegate filter that is contained in OH_ImageEffect, + * the function pointer will be called for serializing the delegate filter parameters + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param filter Encapsulate OH_EffectFilter structure instance pointer + * @param info Indicates the serialized information that is obtained by converting the delegate filter parameters to + * JSON string + * @return Returns true if this function point is executed successfully, otherwise returns false + * @since 12 + */ +typedef bool (*OH_EffectFilterDelegate_Save)(OH_EffectFilter *filter, char **info); + +/** + * @brief When the method of OH_ImageEffect_Restore is executed on delegate filter that is contained in OH_ImageEffect, + * the function pointer will be called for deserializing the delegate filter parameters + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Indicates the serialized information that is obtained by converting the delegate filter parameters to + * JSON string + * @return Returns a pointer to an OH_EffectFilter instance if the execution is successful, otherwise returns nullptr + * @since 12 + */ +typedef OH_EffectFilter *(*OH_EffectFilterDelegate_Restore)(const char *info); + +/** + * @brief A collection of all callback function pointers in OH_EffectFilter. Register an instance of this structure to + * the OH_EffectFilter instance by invoking {@link OH_EffectFilter_Register}, and perform related rendering operations + * through the callback + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef struct ImageEffect_FilterDelegate { + /** Monitor checking parameters */ + OH_EffectFilterDelegate_SetValue setValue; + /** Monitor render */ + OH_EffectFilterDelegate_Render render; + /** Monitor serialize */ + OH_EffectFilterDelegate_Save save; + /** Monitor deserialize */ + OH_EffectFilterDelegate_Restore restore; +} ImageEffect_FilterDelegate; + +/** + * @brief Describes the region information + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef struct ImageEffect_Region { + /** X coordinate of the start point of a line */ + int32_t x0; + /** Y coordinate of the start point of a line */ + int32_t y0; + /** X coordinate of the end point of a line */ + int32_t x1; + /** Y coordinate of the end point of a line */ + int32_t y1; +} ImageEffect_Region; + +/** + * @brief Describes the image size information + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef struct ImageEffect_Size { + /** Image width, in pixels */ + int32_t width; + /** Image height, in pixels */ + int32_t height; +} ImageEffect_Size; + +/** + * @brief Create an OH_EffectFilter instance. It should be noted that the life cycle of the OH_EffectFilter instance + * pointed to by the return value * needs to be manually released by {@link OH_EffectFilter_Release} + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param name Indicates the filter name. For example, see {@link OH_EFFECT_BRIGHTNESS_FILTER} + * @return Returns a pointer to an OH_EffectFilter instance if the execution is successful, otherwise returns nullptr + * @since 12 + */ +OH_EffectFilter *OH_EffectFilter_Create(const char *name); + +/** + * @brief Set the filter parameter. It can be set multiple parameters by invoking this function multiple times + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param filter Encapsulate OH_EffectFilter structure instance pointer + * @param key Indicates the key of the filter. For example, see {@link OH_EFFECT_FILTER_INTENSITY_KEY} + * @param value Indicates the value corresponding to the key of the filter + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilter_SetValue(OH_EffectFilter *filter, const char *key, const ImageEffect_Any *value); + +/** + * @brief Get the filter parameter + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param filter Encapsulate OH_EffectFilter structure instance pointer + * @param key Indicates the key of the filter + * @param value Indicates the value corresponding to the key of the filter + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilter_GetValue(OH_EffectFilter *filter, const char *key, ImageEffect_Any *value); + +/** + * @brief Register the delegate filter + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param info Indicates the capabilities supported by delegate filter, see {@link OH_EffectFilterInfo} + * @param delegate A collection of all callback functions, see {@link ImageEffect_FilterDelegate} + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilter_Register(const OH_EffectFilterInfo *info, + const ImageEffect_FilterDelegate *delegate); + +/** + * @brief Lookup for the filter names that matches the lookup condition. It should be noted that the allocated memory of + * ImageEffect_FilterNames can be manually released by invoking {@link OH_EffectFilter_ReleaseFilterNames} if need + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param key Indicates the lookup condition + * @return Returns Filter name array that matches the key, see {@link ImageEffect_FilterNames} + * @since 12 + */ +ImageEffect_FilterNames *OH_EffectFilter_LookupFilters(const char *key); + +/** + * @brief Clear the internal cached resources of the ImageEffect_FilterNames + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +void OH_EffectFilter_ReleaseFilterNames(); + +/** + * @brief Lookup for the capabilities that supported by the filter + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param name Indicates the filter name + * @param info Indicates the capabilities supported by the filter, see {@link OH_EffectFilterInfo} + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilter_LookupFilterInfo(const char *name, OH_EffectFilterInfo *info); + +/** + * @brief Render the filter effects. The function is designed to support the same input and output image + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param filter Encapsulate OH_EffectFilter structure instance pointer + * @param inputPixelmap Indicates the input image + * @param outputPixelmap Indicates the output image + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilter_Render(OH_EffectFilter *filter, OH_PixelmapNative *inputPixelmap, + OH_PixelmapNative *outputPixelmap); + +/** + * @brief Clear the internal resources of the OH_EffectFilter and destroy the OH_EffectFilter instance + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param filter Encapsulate OH_EffectFilter structure instance pointer + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * @since 12 + */ +ImageEffect_ErrorCode OH_EffectFilter_Release(OH_EffectFilter *filter); + +#ifdef __cplusplus +} +#endif +#endif // NATIVE_IMAGE_EFFECT_FILTER_H +/** @} */ \ No newline at end of file diff --git a/multimedia/image_effect/libimage_effect.ndk.json b/multimedia/image_effect/libimage_effect.ndk.json new file mode 100644 index 0000000000000000000000000000000000000000..882db511448aa36052fbe8ad9fe133b1b9ba6271 --- /dev/null +++ b/multimedia/image_effect/libimage_effect.ndk.json @@ -0,0 +1,198 @@ +[ + { + "first_introduced": "12", + "name": "OH_EffectFilterInfo_Create" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilterInfo_SetFilterName" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilterInfo_GetFilterName" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilterInfo_SetSupportedBufferTypes" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilterInfo_GetSupportedBufferTypes" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilterInfo_SetSupportedFormats" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilterInfo_GetSupportedFormats" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilterInfo_Release" + }, + { + "first_introduced": "12", + "name": "OH_EffectBufferInfo_Create" + }, + { + "first_introduced": "12", + "name": "OH_EffectBufferInfo_SetAddr" + }, + { + "first_introduced": "12", + "name": "OH_EffectBufferInfo_GetAddr" + }, + { + "first_introduced": "12", + "name": "OH_EffectBufferInfo_SetWidth" + }, + { + "first_introduced": "12", + "name": "OH_EffectBufferInfo_GetWidth" + }, + { + "first_introduced": "12", + "name": "OH_EffectBufferInfo_SetHeight" + }, + { + "first_introduced": "12", + "name": "OH_EffectBufferInfo_GetHeight" + }, + { + "first_introduced": "12", + "name": "OH_EffectBufferInfo_SetRowSize" + }, + { + "first_introduced": "12", + "name": "OH_EffectBufferInfo_GetRowSize" + }, + { + "first_introduced": "12", + "name": "OH_EffectBufferInfo_SetEffectFormat" + }, + { + "first_introduced": "12", + "name": "OH_EffectBufferInfo_GetEffectFormat" + }, + { + "first_introduced": "12", + "name": "OH_EffectBufferInfo_Release" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilter_Create" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilter_SetValue" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilter_GetValue" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilter_Register" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilter_LookupFilters" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilter_ReleaseFilterNames" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilter_LookupFilterInfo" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilter_Render" + }, + { + "first_introduced": "12", + "name": "OH_EffectFilter_Release" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_Create" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_AddFilter" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_InsertFilter" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_RemoveFilter" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_GetFilterCount" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_GetFilter" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_Configure" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_SetOutputSurface" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_GetInputSurface" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_SetInputPixelmap" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_SetOutputPixelmap" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_SetInputNativeBuffer" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_SetOutputNativeBuffer" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_SetInputUri" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_SetOutputUri" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_Start" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_Stop" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_Release" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_Save" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_Restore" + } +] \ No newline at end of file