openharmony 鸿蒙 capi-image-processing-types-h

2026-08-25 浏览 (1)

image_processing_types.h

Overview

The file declares the image processing types.

File to include: <multimedia/video_processing_engine/image_processing_types.h>

Library: libimage_processing.so

System capability: SystemCapability.Multimedia.VideoProcessingEngine

Since: 13

Related module: ImageProcessing

Summary

Structs

Nametypedef KeywordDescription
ImageProcessing_ColorSpaceInfoImageProcessing_ColorSpaceInfoDescribes the color space information, which is used in Color Space Conversion (CSC) capability query.
OH_ImageProcessingOH_ImageProcessingProvides the declaration of the OH_ImageProcessing struct.
To use it, first declare a null pointer of OH_ImageProcessing, and then initialize it by calling OH_ImageProcessing_Create. This function creates an image processing instance. Multiple instances can be created for different image processing tasks.
OH_PixelmapNativeOH_PixelmapNativeProvides the declaration of the OH_PixelmapNative struct.
OH_AVFormatOH_AVFormatProvides the declaration of the OH_AVFormat struct.

Enums

Nametypedef KeywordDescription
ImageDetailEnhancer_QualityLevelImageDetailEnhancer_QualityLevelEnumerates the quality levels, which are used for detail enhancement.
Corresponding key: IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL.
ImageProcessing_ErrorCodeImageProcessing_ErrorCodeEnumerates the error codes used in image processing.

Variables

NameDescription
const int32_t IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSIONUsed to create an image processing instance for CSC.
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_IsColorSpaceConversionSupported to check whether a conversion can be performed between single-layer images.
Since: 13
Reference: OH_ImageProcessing_Create
const int32_t IMAGE_PROCESSING_TYPE_COMPOSITIONUsed to create an image processing instance for converting a dual-layer HDR image into a single-layer HDR image.
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 to check whether the conversion from a dual-layer HDR image into a single-layer HDR image is supported.
Since: 13
Reference: OH_ImageProcessing_Create
const int32_t IMAGE_PROCESSING_TYPE_DECOMPOSITIONUsed to create an image processing instance for converting a single-layer HDR image into a dual-layer HDR image.
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 to check whether the conversion from a single-layer HDR image into a dual-layer HDR image is supported.
Since: 13
Reference: OH_ImageProcessing_Create
const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATIONUsed to create an image processing instance for metadata generation.
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 returns IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING.
Since: 13
Reference: OH_ImageProcessing_Create
const int32_t IMAGE_PROCESSING_TYPE_DETAIL_ENHANCERUsed to create an image processing instance for detail enhancement.
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.
Since: 13
Reference: OH_ImageProcessing_Create
const char * IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVELUsed to set the quality level for image detail enhancement.
Use ImageDetailEnhancer_QualityLevel to obtain the quality level. Use OH_ImageProcessing_SetParameter to set the quality level. Use OH_ImageProcessing_GetParameter to obtain the quality level in use.
Since: 13

Enum Description

ImageDetailEnhancer_QualityLevel

enum ImageDetailEnhancer_QualityLevel

Description

Enumerates the quality levels, which are used for detail enhancement.

Corresponding key: IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL.

Since: 13

Enum ItemDescription
IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_NONENo detail enhancement.
Supported input resolution (in px): [32, 3000] for width; [32, 3000] for height
Supported output resolution (in px): [32, 3000] for width; [32, 3000] for height
IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_LOWLow-quality detail enhancement, which features fast speed. This is the default value.
Supported input resolution (in px): [32, 3000] for width; [32, 3000] for height
Supported output resolution (in px): [32, 3000] for width; [32, 3000] for height
IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUMMedium-quality detail enhancement, which features moderate speed.
Supported input resolution (in px): [32, 3000] for width; [32, 3000] for height
Supported output resolution (in px): [32, 3000] for width; [32, 3000] for height
IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_HIGHHigh-quality detail enhancement, which features slow speed.
Supported input resolution (in px) in API version 13 to 22: [512, 2000] for width; [512, 2000] for height
Supported output resolution (in px) in API version 13 to 22: [512, 2000] for width; [512, 2000] for height
Supported input resolution (in px) in API version 23 and later: [180, 2000] for width; [180, 2000] for height
Supported output resolution (in px) in API version 23 and later: [512, 2000] for width; [512, 2000] for height

See also

OH_ImageProcessing_SetParameter, OH_ImageProcessing_GetParameter

ImageProcessing_ErrorCode

enum ImageProcessing_ErrorCode

Description

Enumerates the error codes used in image processing.

Since: 13

Enum ItemDescription
IMAGE_PROCESSING_SUCCESSThe operation is successful.
IMAGE_PROCESSING_ERROR_INVALID_PARAMETER = 401An input parameter is invalid.
This error code is returned in the following cases:
1. The input or output buffer is either invalid or empty.
2. The provided parameter is invalid or missing.
3. The type is invalid. For example, the type passed in the creation function does not exist.
IMAGE_PROCESSING_ERROR_UNKNOWN = 29200001An unknown error occurs. For example, the GPU computing or memcpy fails.
IMAGE_PROCESSING_ERROR_INITIALIZE_FAILEDThe global environment, for example, the GPU environment, fails to be initialized.
IMAGE_PROCESSING_ERROR_CREATE_FAILEDCreating the image processing instance fails. For example, the total number of instances exceeds the upper limit.
IMAGE_PROCESSING_ERROR_PROCESS_FAILEDThe processing fails. For example, the processing times out.
IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSINGThe processing type is not supported. You can call OH_ImageProcessing_IsXXXSupported to check whether a specific processing type is supported.
IMAGE_PROCESSING_ERROR_OPERATION_NOT_PERMITTEDThe operation is not allowed. For example, the function is called in an incorrect running state.
IMAGE_PROCESSING_ERROR_NO_MEMORYInsufficient memory.
IMAGE_PROCESSING_ERROR_INVALID_INSTANCEThe image processing instance is invalid, for example, a null instance.
IMAGE_PROCESSING_ERROR_INVALID_VALUEThe input value is invalid.
This error code is returned in the following cases:
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.
2. The parameter is invalid. For example, the parameter does not contain valid information, such as invalid quality level for detail enhancement.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-image-nativemodule-oh-pixelmap-hdrmetadatavalue

openharmony 鸿蒙 capi-image-imagepacker-opts-

openharmony 鸿蒙 capi-image-nativemodule-image-region

openharmony 鸿蒙 capi-image-imagepacker-native-

openharmony 鸿蒙 capi-image-imagenative-

openharmony 鸿蒙 capi-image-processing-h

openharmony 鸿蒙 capi-image-ohosimagesourcesupportedformat

openharmony 鸿蒙 capi-image-nativemodule-image-size

openharmony 鸿蒙 capi-image-mdk-h

openharmony 鸿蒙 capi-image-ohosimagesourcedelaytimelist

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/1x7tKUJz