1# image_processing_types.h 2 3## Overview 4 5The **image_processing_types.h** file declares the image processing types. 6 7**Library**: libimage_processing.so 8 9**System capability**: SystemCapability.Multimedia.VideoProcessingEngine 10 11**Since**: 13 12 13**Related module**: [ImageProcessing](capi-imageprocessing.md) 14 15## Summary 16 17### Structs 18 19| Name| typedef Keyword| Description| 20| -- | -- | -- | 21| [ImageProcessing_ColorSpaceInfo](capi-imageprocessing-imageprocessing-colorspaceinfo.md) | ImageProcessing_ColorSpaceInfo | Describes the color space information, which is used in Color Space Conversion (CSC) capability query.| 22| [OH_ImageProcessing](capi-imageprocessing-oh-imageprocessing.md) | OH_ImageProcessing | Provides the declaration of the OH_ImageProcessing struct.<br>To use it, first declare a null pointer of OH_ImageProcessing, and then initialize it by calling [OH_ImageProcessing_Create](capi-image-processing-h.md#oh_imageprocessing_create). This function creates an image processing instance. Multiple instances can be created for different image processing tasks.| 23| [OH_PixelmapNative](capi-image-nativemodule-oh-pixelmapnative.md) | OH_PixelmapNative | Provides the declaration of the OH_PixelmapNative struct.| 24| [OH_AVFormat](../apis-avcodec-kit/_core.md#oh_avformat) | OH_AVFormat | Provides the declaration of the OH_AVFormat struct.| 25 26### Enums 27 28| Name| typedef Keyword| Description| 29| -- | -- | -- | 30| [ImageDetailEnhancer_QualityLevel](#imagedetailenhancer_qualitylevel) | ImageDetailEnhancer_QualityLevel | Enumerates the quality levels, which are used for detail enhancement.<br>Corresponding key: IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL.| 31| [ImageProcessing_ErrorCode](#imageprocessing_errorcode) | ImageProcessing_ErrorCode | Enumerates the error codes used in image processing.| 32 33### Variables 34 35| Name| Description| 36| -- | -- | 37| const int32_t IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION | Used to create an image processing instance for CSC.<br>CSC includes conversion from single-layer HDR images to SDR images, conversion between SDR images, and conversion from SDR images to single-layer HDR images. Some capabilities are supported by vendors. Use [OH_ImageProcessing_IsColorSpaceConversionSuported](capi-image-processing-h.md#oh_imageprocessing_iscolorspaceconversionsupported) to check whether a conversion can be performed between single-layer images.<br>**Since**: 13<br>**Reference**: [OH_ImageProcessing_Create](capi-image-processing-h.md#oh_imageprocessing_create)| 38| const int32_t IMAGE_PROCESSING_TYPE_COMPOSITION | Used to create an image processing instance for converting a dual-layer HDR image into a single-layer HDR image.<br>The instance provides the capability of converting dual-layer HDR images into single-layer HDR images. Some capabilities are supported by vendors. Use [OH_ImageProcessing_IsCompositionSupported](capi-image-processing-h.md#oh_imageprocessing_iscompositionsupported) to check whether the conversion from a dual-layer HDR image into a single-layer HDR image is supported.<br>**Since**: 13<br>**Reference**: [OH_ImageProcessing_Create](capi-image-processing-h.md#oh_imageprocessing_create)| 39| const int32_t IMAGE_PROCESSING_TYPE_DECOMPOSITION | Used to create an image processing instance for converting a single-layer HDR image into a dual-layer HDR image.<br>The instance provides the capability of converting single-layer HDR images into dual-layer HDR images. Some capabilities are supported by vendors. Use [OH_ImageProcessing_IsDecompositionSupported](capi-image-processing-h.md#oh_imageprocessing_isdecompositionsupported) to check whether the conversion from a single-layer HDR image into a dual-layer HDR image is supported.<br>**Since**: 13<br>**Reference**: [OH_ImageProcessing_Create](capi-image-processing-h.md#oh_imageprocessing_create)| 40| const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION | Used to create an image processing instance for metadata generation.<br>This variable generates the HDR Vivid metadata of a single-layer HDR image. Some capabilities are supported by vendors. If the capability is not supported, [OH_ImageProcessing_Create](capi-image-processing-h.md#oh_imageprocessing_create) returns [IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING](capi-image-processing-types-h.md#imageprocessing_errorcode).<br>**Since**: 13<br>**Reference**: [OH_ImageProcessing_Create](capi-image-processing-h.md#oh_imageprocessing_create)| 41| const int32_t IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER | Used to create an image processing instance for detail enhancement.<br>This variable scales or resizes the image based on the specified image quality, or only enhances the image details to render the image without changing the resolution.<br>**Since**: 13<br>**Reference**: [OH_ImageProcessing_Create](capi-image-processing-h.md#oh_imageprocessing_create)| 42| const char * IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL | Used to set the quality level for image detail enhancement.<br>Use [ImageDetailEnhancer_QualityLevel](capi-image-processing-types-h.md#imagedetailenhancer_qualitylevel) to obtain the quality level. Use [OH_ImageProcessing_SetParameter](capi-image-processing-h.md#oh_imageprocessing_setparameter) to set the quality level. Use [OH_ImageProcessing_GetParameter](capi-image-processing-h.md#oh_imageprocessing_getparameter) to obtain the quality level in use.<br>**Since**: 13| 43 44## Enum Description 45 46### ImageDetailEnhancer_QualityLevel 47 48``` 49enum ImageDetailEnhancer_QualityLevel 50``` 51 52**Description** 53 54Enumerates the quality levels, which are used for detail enhancement. 55 56Corresponding key: IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL. 57 58**Since**: 13 59 60| Enum Item| Description| 61| -- | -- | 62| IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_NONE | No detail enhancement.| 63| IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_LOW | Low-quality detail enhancement, which features fast speed. This is the default value.| 64| IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUM | Medium-quality detail enhancement, which features moderate speed.| 65| IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_HIGH | High-quality detail enhancement, which features slow speed.| 66 67**See also** 68 69[OH_ImageProcessing_SetParameter](capi-image-processing-h.md#oh_imageprocessing_setparameter), [OH_ImageProcessing_GetParameter](capi-image-processing-h.md#oh_imageprocessing_getparameter) 70 71### ImageProcessing_ErrorCode 72 73``` 74enum ImageProcessing_ErrorCode 75``` 76 77**Description** 78 79Enumerates the error codes used in image processing. 80 81**Since**: 13 82 83| Enum Item| Description| 84| -- | -- | 85| IMAGE_PROCESSING_SUCCESS | The operation is successful.| 86| IMAGE_PROCESSING_ERROR_INVALID_PARAMETER = 401 | An input parameter is invalid.<br>This error code is returned in the following cases:<br>1. The input or output buffer is either invalid or empty.<br>2. The provided parameter is invalid or missing.<br>3. The type is invalid. For example, the type passed in the creation function does not exist.| 87| IMAGE_PROCESSING_ERROR_UNKNOWN = 29200001 | An unknown error occurs. For example, the GPU computing or memcpy fails.| 88| IMAGE_PROCESSING_ERROR_INITIALIZE_FAILED | The global environment, for example, the GPU environment, fails to be initialized.| 89| IMAGE_PROCESSING_ERROR_CREATE_FAILED | Creating the image processing instance fails. For example, the total number of instances exceeds the upper limit.| 90| IMAGE_PROCESSING_ERROR_PROCESS_FAILED | The processing fails. For example, the processing times out.| 91| IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING | The processing type is not supported. You can call OH_ImageProcessing_Is*XXX*Supported to check whether a specific processing type is supported.| 92| IMAGE_PROCESSING_ERROR_OPERATION_NOT_PERMITTED | The operation is not allowed. For example, the function is called in an incorrect running state.| 93| IMAGE_PROCESSING_ERROR_NO_MEMORY | Insufficient memory.| 94| IMAGE_PROCESSING_ERROR_INVALID_INSTANCE | The image processing instance is invalid, for example, a null instance.| 95| IMAGE_PROCESSING_ERROR_INVALID_VALUE | The input value is invalid.<br>This error code is returned in the following cases:<br>1. The input or output image buffer is invalid. For example, the width (height) of the image buffer is too large or the color space is incorrect.<br>2. The parameter is invalid. For example, the parameter does not contain valid information, such as invalid quality level for detail enhancement.| 96