harmony 鸿蒙ImageProcessing

  • 2025-06-12
  • 浏览 (7)

ImageProcessing

Overview

The ImageProcessing module provides APIs for image processing, including Color Space Conversion (CSC) and metadata generation.

Since: 13

Summary

Files

Name Description
image_processing.h Declares the image processing functions.
image_processing_types.h Declares the image processing types.

Structs

Name Description
struct ImageProcessing_ColorSpaceInfo Describes the color space information, which is used in CSC capability query.

Types

Name Description
typedef struct OH_ImageProcessing OH_ImageProcessing Provides the declaration of the OH_ImageProcessing struct.
typedef struct OH_PixelmapNative OH_PixelmapNative Provides the declaration of the OH_PixelmapNative struct.
typedef struct OH_AVFormat OH_AVFormat Provides the declaration of the OH_AVFormat struct.
typedef struct ImageProcessing_ColorSpaceInfo ImageProcessing_ColorSpaceInfo Defines a struct for the color space information, which is used in CSC capability query.
typedef enum ImageDetailEnhancer_QualityLevel ImageDetailEnhancer_QualityLevel Defines an enum for the quality levels, which are used for detail enhancement.
typedef enum ImageProcessing_ErrorCode ImageProcessing_ErrorCode Defines an enum for the error codes used in image processing.

Enums

Name Description
ImageDetailEnhancer_QualityLevel {
IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_NONE,
IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_LOW,
IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUM,
IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_HIGH }
Enumerates the quality levels, which are used for detail enhancement.
ImageProcessing_ErrorCode {
IMAGE_PROCESSING_SUCCESS,
IMAGE_PROCESSING_ERROR_INVALID_PARAMETER = 401,
IMAGE_PROCESSING_ERROR_UNKNOWN = 29200001,
IMAGE_PROCESSING_ERROR_INITIALIZE_FAILED,
IMAGE_PROCESSING_ERROR_CREATE_FAILED,
IMAGE_PROCESSING_ERROR_PROCESS_FAILED,
IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING,
IMAGE_PROCESSING_ERROR_OPERATION_NOT_PERMITTED,
IMAGE_PROCESSING_ERROR_NO_MEMORY,
IMAGE_PROCESSING_ERROR_INVALID_INSTANCE,
IMAGE_PROCESSING_ERROR_INVALID_VALUE
}
Enumerates the error codes used in image processing.

Functions

Name Description
ImageProcessing_ErrorCode OH_ImageProcessing_InitializeEnvironment (void) Initializes the global environment of the image processing module.
ImageProcessing_ErrorCode OH_ImageProcessing_DeinitializeEnvironment (void) Deinitializes the global environment of the image processing module.
bool OH_ImageProcessing_IsColorSpaceConversionSupported (const ImageProcessing_ColorSpaceInfo *sourceImageInfo, const ImageProcessing_ColorSpaceInfo *destinationImageInfo) Checks whether CSC is supported for an image.
bool OH_ImageProcessing_IsCompositionSupported (const ImageProcessing_ColorSpaceInfo *sourceImageInfo, const ImageProcessing_ColorSpaceInfo *sourceGainmapInfo, const ImageProcessing_ColorSpaceInfo *destinationImageInfo) Checks whether a dual-layer HDR image can be converted into a single-layer HDR image.
bool OH_ImageProcessing_IsDecompositionSupported (const ImageProcessing_ColorSpaceInfo *sourceImageInfo, const ImageProcessing_ColorSpaceInfo *destinationImageInfo, const ImageProcessing_ColorSpaceInfo *destinationGainmapInfo) Checks whether a single-layer HDR image can be converted into a dual-layer HDR image.
bool OH_ImageProcessing_IsMetadataGenerationSupported (const ImageProcessing_ColorSpaceInfo *sourceImageInfo) Checks whether metadata generation is supported for an image.
ImageProcessing_ErrorCode OH_ImageProcessing_Create (OH_ImageProcessing **imageProcessor, int32_t type) Creates an image processing instance.
ImageProcessing_ErrorCode OH_ImageProcessing_Destroy (OH_ImageProcessing *imageProcessor) Destroys an image processing instance.
ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter (OH_ImageProcessing *imageProcessor, const OH_AVFormat *parameter) Sets a parameter for the image processing module.
ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter (OH_ImageProcessing *imageProcessor, OH_AVFormat *parameter) Obtains a parameter of the image processing module.
ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace (OH_ImageProcessing *imageProcessor, OH_PixelmapNative *sourceImage, OH_PixelmapNative *destinationImage) Converts the color space for a single-layer image.
ImageProcessing_ErrorCode OH_ImageProcessing_Compose (OH_ImageProcessing *imageProcessor, OH_PixelmapNative *sourceImage, OH_PixelmapNative *sourceGainmap, OH_PixelmapNative *destinationImage) Converts a dual-layer HDR image into a single-layer HDR image.
ImageProcessing_ErrorCode OH_ImageProcessing_Decompose (OH_ImageProcessing *imageProcessor, OH_PixelmapNative *sourceImage, OH_PixelmapNative *destinationImage, OH_PixelmapNative *destinationGainmap) Converts a single-layer HDR image into a double-layer HDR image.
ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata (OH_ImageProcessing *imageProcessor, OH_PixelmapNative *sourceImage) Generates metadata for an HDR image.
ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail (OH_ImageProcessing *imageProcessor, OH_PixelmapNative *sourceImage, OH_PixelmapNative *destinationImage) Enhances the image definition and details.

Variables

Name Description
const int32_t IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION Used to create an image processing instance for CSC.
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.
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.
const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION Used to create an image processing instance for metadata generation.
const int32_t IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER Used to create an image processing instance for detail enhancement.
const char * IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL Used to set the quality level for image detail enhancement.

Type Description

ImageDetailEnhancer_QualityLevel

typedef enum ImageDetailEnhancer_QualityLevel ImageDetailEnhancer_QualityLevel

Description

Defines an enum for the quality levels, which are used for detail enhancement.

Corresponding key: IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL

Since: 13

See

OH_ImageProcessing_SetParameter

OH_ImageProcessing_GetParameter

ImageProcessing_ColorSpaceInfo

typedef struct ImageProcessing_ColorSpaceInfo ImageProcessing_ColorSpaceInfo

Description

Defines a struct for the color space information, which is used in CSC capability query.

Since: 13

See

OH_ImageProcessing_IsColorSpaceConversionSupported

OH_ImageProcessing_IsCompositionSupported

OH_ImageProcessing_IsDecompositionSupported

ImageProcessing_ErrorCode

typedef enum ImageProcessing_ErrorCode ImageProcessing_ErrorCode

Description

Defines an enum for the error codes used in image processing.

Since: 13

OH_AVFormat

typedef struct OH_AVFormat OH_AVFormat

Description

Provides the declaration of the OH_AVFormat struct.

Since: 13

OH_ImageProcessing

typedef struct OH_ImageProcessing OH_ImageProcessing

Description

Provides the declaration of the OH_ImageProcessing struct.

Define a null pointer to OH_ImageProcessing. Before OH_ImageProcessing_Create is called to create an image processing instance, the pointer must be null. You can create different image processing instances with different processing types.

Since: 13

OH_PixelmapNative

typedef struct OH_PixelmapNative OH_PixelmapNative

Description

Provides the declaration of the OH_PixelmapNative struct.

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

See

OH_ImageProcessing_SetParameter

OH_ImageProcessing_GetParameter

Value Description
IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_NONE No detail enhancement.
IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_LOW Low-quality detail enhancement, which features fast speed. This is the default value.
IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUM Medium-quality detail enhancement, which features moderate speed.
IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_HIGH High-quality detail enhancement, which features slow speed.

ImageProcessing_ErrorCode

enum ImageProcessing_ErrorCode

Description

Enumerates the error codes used in image processing.

Since: 13

Value Description
IMAGE_PROCESSING_SUCCESS The processing is successful.
IMAGE_PROCESSING_ERROR_INVALID_PARAMETER An 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 An unknown error occurs. For example, the GPU computing or memcpy fails.
IMAGE_PROCESSING_ERROR_INITIALIZE_FAILED The global environment, for example, the GPU environment, fails to be initialized.
IMAGE_PROCESSING_ERROR_CREATE_FAILED Creating the image processing instance fails. For example, the total number of instances exceeds the upper limit.
IMAGE_PROCESSING_ERROR_PROCESS_FAILED The processing fails. For example, the processing times out.
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.
IMAGE_PROCESSING_ERROR_OPERATION_NOT_PERMITTED The operation is not allowed. For example, the function is called in an incorrect running state.
IMAGE_PROCESSING_ERROR_NO_MEMORY Insufficient memory.
IMAGE_PROCESSING_ERROR_INVALID_INSTANCE The image processing instance is invalid, for example, a null instance.
IMAGE_PROCESSING_ERROR_INVALID_VALUE The 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.

Function Description

OH_ImageProcessing_Compose()

ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* imageProcessor,OH_PixelmapNative* sourceImage, OH_PixelmapNative* sourceGainmap, OH_PixelmapNative* destinationImage)

Description

Converts a dual-layer HDR image into a single-layer HDR image.

This function is used to generate an output image based on an input image and input gain map.

Since: 13

Parameters

Name Description
imageProcessor Pointer to an image processing instance, which is created by IMAGE_PROCESSING_TYPE_COMPOSITION.
sourceImage Pointer to the input image.
sourceGainmap Pointer to the input gain map.
destinationImage Pointer to the output image.

Returns

  • Returns IMAGE_PROCESSING_SUCCESS if image processing is successful.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_INSTANCE if the instance is null or is not an image processing instance.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_PARAMETER if the image is empty.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_VALUE if an image property is invalid, for example, unsupported color space.
  • Returns IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING if image processing is not supported.
  • Returns IMAGE_PROCESSING_ERROR_PROCESS_FAILED if an error occurs during image processing.
  • Returns IMAGE_PROCESSING_ERROR_NO_MEMORY if memory allocation fails.

OH_ImageProcessing_ConvertColorSpace()

ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage)

Description

Converts the color space for a single-layer image.

This function enables CSC from HDR images to SDR images, CSC from SDR images to HDR images, CSC from SDR images to SDR images, and CSC from HDR images to SDR images.

Since: 13

Parameters

Name Description
imageProcessor Pointer to an image processing instance, which is created by IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION.
sourceImage Pointer to the input image.
destinationImage Pointer to the output image.

Returns

  • Returns IMAGE_PROCESSING_SUCCESS if image processing is successful.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_INSTANCE if the instance is null or is not an image processing instance.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_PARAMETER if the image is empty.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_VALUE if an image property is invalid, for example, unsupported color space.
  • Returns IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING if image processing is not supported.
  • Returns IMAGE_PROCESSING_ERROR_PROCESS_FAILED if an error occurs during image processing.
  • Returns IMAGE_PROCESSING_ERROR_NO_MEMORY if memory allocation fails.

OH_ImageProcessing_Create()

ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** imageProcessor, int32_t type)

Description

Creates an image processing instance.

Since: 13

Parameters

Name Description
imageProcessor Double pointer to the image processing instance created. The pointer *imageProcessor points to a new image processing object and must be a null pointer before being passed.
type Image processing type. The processing type cannot be changed after the instance is created.

Returns

  • Returns IMAGE_PROCESSING_SUCCESS if the instance is created successfully.
  • Returns IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING if the specified image processing type is not supported, for example, if metadata generation is not supported.
  • Returns IMAGE_PROCESSING_ERROR_CREATE_FAILED if the instance fails to be created.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_INSTANCE if the instance is null or the pointer to the instance is null.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_PARAMETER if the specified image processing type is invalid.

OH_ImageProcessing_Decompose()

ImageProcessing_ErrorCode OH_ImageProcessing_Decompose(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage, OH_PixelmapNative* destinationGainmap)

Description

Converts a single-layer HDR image into a double-layer HDR image.

This function is used to generate an output image and output gain map based on an input image.

Since: 13

Parameters

Name Description
imageProcessor Pointer to an image processing instance, which is created by IMAGE_PROCESSING_TYPE_DECOMPOSITION.
sourceImage Pointer to the input image.
destinationImage Pointer to the output image.
destinationGainmap Pointer to the output gain map.

Returns

  • Returns IMAGE_PROCESSING_SUCCESS if image processing is successful.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_INSTANCE if the instance is null or is not an image processing instance.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_PARAMETER if the image is empty.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_VALUE if an image property is invalid, for example, unsupported color space.
  • Returns IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING if image processing is not supported.
  • Returns IMAGE_PROCESSING_ERROR_PROCESS_FAILED if an error occurs during image processing.
  • Returns IMAGE_PROCESSING_ERROR_NO_MEMORY if memory allocation fails.

OH_ImageProcessing_DeinitializeEnvironment()

ImageProcessing_ErrorCode OH_ImageProcessing_DeinitializeEnvironment(void)

Description

Deinitializes the global environment of the image processing module.

This function must be called after OH_ImageProcessing_InitializeEnvironment is called. Generally, this function is called when the main process is about to exit. Do not call this function when an image processing instance exists or when OH_ImageProcessing_InitializeEnvironment is not called.

Since: 13

Returns

  • Returns IMAGE_PROCESSING_SUCCESS if deinitialization is successful.
  • Returns IMAGE_PROCESSING_ERROR_OPERATION_NOT_PERMITTED if the image processing instance is not destroyed or OH_ImageProcessing_InitializeEnvironment is not called.

OH_ImageProcessing_Destroy()

ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* imageProcessor)

Description

Destroys an image processing instance.

Since: 13

Parameters

Name Description
imageProcessor Pointer to an image processing instance, You are advised to set the pointer to a null pointer after the instance is destroyed.

Returns

  • Returns IMAGE_PROCESSING_SUCCESS if the instance is destroyed.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_INSTANCE if the instance is null or is not an image processing instance.

OH_ImageProcessing_EnhanceDetail()

ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage)

Description

Enhances the image definition and details.

This function performs necessary scaling operations on the source image based on the preset sizes of the input and output images to generate the target image. It uses multiple scaling methods to balance performance and image quality.

Since: 13

Parameters

Name Description
imageProcessor Pointer to an image processing instance, which is created by IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER.
sourceImage Pointer to the input image.
destinationImage Pointer to the output image.

Returns

  • Returns IMAGE_PROCESSING_SUCCESS if image processing is successful.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_INSTANCE if the instance is null or is not an image processing instance.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_PARAMETER if the image is empty.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_VALUE if an image property is invalid, for example, unsupported color space.
  • Returns IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING if image processing is not supported.
  • Returns IMAGE_PROCESSING_ERROR_PROCESS_FAILED if an error occurs during image processing.
  • Returns IMAGE_PROCESSING_ERROR_NO_MEMORY if memory allocation fails.

OH_ImageProcessing_GenerateMetadata()

ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage)

Description

Generates metadata for an HDR image.

Since: 13

Parameters

Name Description
imageProcessor Pointer to an image processing instance, which is created by IMAGE_PROCESSING_TYPE_METADATA_GENERATION.
sourceImage Pointer to the input image.

Returns

  • Returns IMAGE_PROCESSING_SUCCESS if image processing is successful.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_INSTANCE if the instance is null or is not an image processing instance.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_PARAMETER if the image is empty.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_VALUE if an image property is invalid, for example, unsupported color space.
  • Returns IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING if image processing is not supported.
  • Returns IMAGE_PROCESSING_ERROR_PROCESS_FAILED if an error occurs during image processing.
  • Returns IMAGE_PROCESSING_ERROR_NO_MEMORY if memory allocation fails.

OH_ImageProcessing_GetParameter()

ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* imageProcessor, OH_AVFormat* parameter)

Description

Obtains a parameter of the image processing module.

This function obtains the parameter by key.

Since: 13

Parameters

Name Description
imageProcessor Pointer to an image processing instance.
parameter Pointer to the parameter used by the image processing instance.

Returns

  • Returns IMAGE_PROCESSING_SUCCESS if the parameters fail to be obtained.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_INSTANCE if the instance is null or is not an image processing instance.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_PARAMETER if parameter is empty.

OH_ImageProcessing_InitializeEnvironment()

ImageProcessing_ErrorCode OH_ImageProcessing_InitializeEnvironment(void)

Description

Initializes the global environment of the image processing module.

This function is optional. Generally, this function is called when the main process is started. It is used to initialize the global environment of the image processing module and reduce the time consumed by OH_ImageProcessing_Create. It must be used in pair with OH_ImageProcessing_DeinitializeEnvironment, which is used to deinitialize the global environment. This function can be used to check whether the GPU works properly.

Since: 13

Returns

Returns IMAGE_PROCESSING_SUCCESS if the initialization is successful; returns IMAGE_PROCESSING_ERROR_INITIALIZE_FAILED otherwise.

OH_ImageProcessing_IsColorSpaceConversionSupported()

bool OH_ImageProcessing_IsColorSpaceConversionSupported(const ImageProcessing_ColorSpaceInfo* sourceImageInfo, const ImageProcessing_ColorSpaceInfo* destinationImageInfo)

Description

Checks whether CSC is supported for an image.

Since: 13

Parameters

Name Description
sourceImageInfo Pointer to the color space information of the input image.
destinationImageInfo Pointer to the color space information of the output image.

Returns

Returns true if CSC is supported; returns false otherwise.

OH_ImageProcessing_IsCompositionSupported()

bool OH_ImageProcessing_IsCompositionSupported(const ImageProcessing_ColorSpaceInfo* sourceImageInfo, const ImageProcessing_ColorSpaceInfo* sourceGainmapInfo, const ImageProcessing_ColorSpaceInfo* destinationImageInfo)

Description

Checks whether a dual-layer HDR image can be converted into a single-layer HDR image.

Since: 13

Parameters

Name Description
sourceImageInfo Pointer to the color space information of the input image.
sourceGainmapInfo Pointer to the color space information of the input gain map.
destinationImageInfo Pointer to the color space information of the output image.

Returns

Returns true if such a conversion is supported; returns false otherwise.

OH_ImageProcessing_IsDecompositionSupported()

bool OH_ImageProcessing_IsDecompositionSupported(const ImageProcessing_ColorSpaceInfo* sourceImageInfo, const ImageProcessing_ColorSpaceInfo* destinationImageInfo, const ImageProcessing_ColorSpaceInfo* destinationGainmapInfo)

Description

Checks whether a single-layer HDR image can be converted into a dual-layer HDR image.

Since: 13

Parameters

Name Description
sourceImageInfo Pointer to the color space information of the input image.
destinationImageInfo Pointer to the color space information of the output image.
destinationGainmapInfo Pointer to the color space information of the output gain map.

Returns

Returns true if such a conversion is supported; returns false otherwise.

OH_ImageProcessing_IsMetadataGenerationSupported()

bool OH_ImageProcessing_IsMetadataGenerationSupported(const ImageProcessing_ColorSpaceInfo* sourceImageInfo)

Description

Checks whether metadata generation is supported for an image.

Since: 13

Parameters

Name Description
sourceImageInfo Pointer to the color space information of the input image.

Returns

Returns true if metadata generation is supported; returns false otherwise.

OH_ImageProcessing_SetParameter()

ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* imageProcessor, const OH_AVFormat* parameter)

Description

Sets a parameter for the image processing module.

This function sets the parameter by key.

Since: 13

Parameters

Name Description
imageProcessor Pointer to an image processing instance.
parameter Pointer to the parameter.

Returns

  • Returns IMAGE_PROCESSING_SUCCESS if the parameter is set successfully.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_INSTANCE if the instance is null or is not an image processing instance.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_PARAMETER if parameter is empty.
  • Returns IMAGE_PROCESSING_ERROR_INVALID_VALUE if parameter is invalid, for example, if parameter contains an unsupported parameter key or value.
  • Returns IMAGE_PROCESSING_ERROR_NO_MEMORY if memory allocation fails.

Variable Description

IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL

const char* IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL

Description

Used 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

See

OH_VideoProcessing_SetParameter

OH_VideoProcessing_GetParameter

IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION

const int32_t IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION

Description

Used 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_IsColorSpaceConversionSuported to check whether a conversion can be performed between single-layer images.

Since: 13

See

OH_ImageProcessing_Create

IMAGE_PROCESSING_TYPE_COMPOSITION

const int32_t IMAGE_PROCESSING_TYPE_COMPOSITION

Description

Used 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

See

OH_ImageProcessing_Create

IMAGE_PROCESSING_TYPE_DECOMPOSITION

const int32_t IMAGE_PROCESSING_TYPE_DECOMPOSITION

Description

Used 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

See

OH_ImageProcessing_Create

IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER

const int32_t IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER

Description

Used 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

See

OH_ImageProcessing_Create

IMAGE_PROCESSING_TYPE_METADATA_GENERATION

const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION

Description

Used 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

See

OH_ImageProcessing_Create

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Image Kit

harmony 鸿蒙_image___native_module

harmony 鸿蒙Image_Region

harmony 鸿蒙Image_Size

harmony 鸿蒙Image_String

harmony 鸿蒙ImageEffect

harmony 鸿蒙ImageEffect_Any

harmony 鸿蒙ImageEffect_FilterDelegate

harmony 鸿蒙ImageEffect_FilterNames

harmony 鸿蒙ImageEffect_Region

0  赞