• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# image_processing.h
2
3## Overview
4
5The **image_processing.h** file declares the image processing functions. It provides capabilities such as Color Space Conversion (CSC), metadata generation, and image scaling.
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### Functions
18
19| Name| Description|
20| -- | -- |
21| [ImageProcessing_ErrorCode OH_ImageProcessing_InitializeEnvironment(void)](#oh_imageprocessing_initializeenvironment) | Initializes the global environment of the image processing module.<br>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](capi-image-processing-h.md#oh_imageprocessing_create). It must be used in pair with [OH_ImageProcessing_DeinitializeEnvironment](capi-image-processing-h.md#oh_imageprocessing_deinitializeenvironment), which is used to deinitialize the global environment. This function can be used to check whether the GPU works properly.|
22| [ImageProcessing_ErrorCode OH_ImageProcessing_DeinitializeEnvironment(void)](#oh_imageprocessing_deinitializeenvironment) | Deinitializes the global environment of the image processing module.<br>This function must be called after [OH_ImageProcessing_InitializeEnvironment](capi-image-processing-h.md#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](capi-image-processing-h.md#oh_imageprocessing_initializeenvironment) is not called.|
23| [bool OH_ImageProcessing_IsColorSpaceConversionSupported(const ImageProcessing_ColorSpaceInfo* sourceImageInfo,const ImageProcessing_ColorSpaceInfo* destinationImageInfo)](#oh_imageprocessing_iscolorspaceconversionsupported) | Checks whether CSC is supported for an image.|
24| [bool OH_ImageProcessing_IsCompositionSupported(const ImageProcessing_ColorSpaceInfo* sourceImageInfo,const ImageProcessing_ColorSpaceInfo* sourceGainmapInfo,const ImageProcessing_ColorSpaceInfo* destinationImageInfo)](#oh_imageprocessing_iscompositionsupported) | Checks whether a dual-layer HDR image can be converted into a single-layer HDR image.|
25| [bool OH_ImageProcessing_IsDecompositionSupported(const ImageProcessing_ColorSpaceInfo* sourceImageInfo,const ImageProcessing_ColorSpaceInfo* destinationImageInfo,const ImageProcessing_ColorSpaceInfo* destinationGainmapInfo)](#oh_imageprocessing_isdecompositionsupported) | Checks whether a single-layer HDR image can be converted into a dual-layer HDR image.|
26| [bool OH_ImageProcessing_IsMetadataGenerationSupported(const ImageProcessing_ColorSpaceInfo* sourceImageInfo)](#oh_imageprocessing_ismetadatagenerationsupported) | Checks whether metadata generation is supported for an image.|
27| [ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** imageProcessor, int32_t type)](#oh_imageprocessing_create) | Creates an image processing instance.|
28| [ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* imageProcessor)](#oh_imageprocessing_destroy) | Destroys an image processing instance.|
29| [ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* imageProcessor,const OH_AVFormat* parameter)](#oh_imageprocessing_setparameter) | Sets a parameter for the image processing module. This function sets the parameter by key.|
30| [ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* imageProcessor,OH_AVFormat* parameter)](#oh_imageprocessing_getparameter) | Obtains a parameter of the image processing module. This function obtains the parameter by key.|
31| [ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* imageProcessor,OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage)](#oh_imageprocessing_convertcolorspace) | 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.|
32| [ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* imageProcessor,OH_PixelmapNative* sourceImage, OH_PixelmapNative* sourceGainmap, OH_PixelmapNative* destinationImage)](#oh_imageprocessing_compose) | 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.|
33| [ImageProcessing_ErrorCode OH_ImageProcessing_Decompose(OH_ImageProcessing* imageProcessor,OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage, OH_PixelmapNative* destinationGainmap)](#oh_imageprocessing_decompose) | 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.|
34| [ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* imageProcessor,OH_PixelmapNative* sourceImage)](#oh_imageprocessing_generatemetadata) | Generates metadata for an HDR image.  |
35| [ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail(OH_ImageProcessing* imageProcessor,OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage)](#oh_imageprocessing_enhancedetail) | 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.|
36
37## Function Description
38
39### OH_ImageProcessing_InitializeEnvironment()
40
41```
42ImageProcessing_ErrorCode OH_ImageProcessing_InitializeEnvironment(void)
43```
44
45**Description**
46
47Initializes the global environment of the image processing module.
48
49This 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](capi-image-processing-h.md#oh_imageprocessing_create). It must be used in pair with [OH_ImageProcessing_DeinitializeEnvironment](capi-image-processing-h.md#oh_imageprocessing_deinitializeenvironment), which is used to deinitialize the global environment. This function can be used to check whether the GPU works properly.
50
51**Since**: 13
52
53**Returns**
54
55| Type| Description|
56| -- | -- |
57| [ImageProcessing_ErrorCode](capi-image-processing-types-h.md#imageprocessing_errorcode) | **IMAGE_PROCESSING_SUCCESS**: The initialization is successful.<br>**IMAGE_PROCESSING_ERROR_INITIALIZE_FAILED**: The initialization fails.|
58
59### OH_ImageProcessing_DeinitializeEnvironment()
60
61```
62ImageProcessing_ErrorCode OH_ImageProcessing_DeinitializeEnvironment(void)
63```
64
65**Description**
66
67Deinitializes the global environment of the image processing module.
68
69This function must be called after [OH_ImageProcessing_InitializeEnvironment](capi-image-processing-h.md#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](capi-image-processing-h.md#oh_imageprocessing_initializeenvironment) is not called.
70
71**Since**: 13
72
73**Returns**
74
75| Type| Description|
76| -- | -- |
77| [ImageProcessing_ErrorCode](capi-image-processing-types-h.md#imageprocessing_errorcode) | **IMAGE_PROCESSING_SUCCESS**: Deinitialization is successful.<br> **IMAGE_PROCESSING_ERROR_OPERATION_NOT_PERMITTED**: The image processing instance is not destroyed or [OH_ImageProcessing_InitializeEnvironment](capi-image-processing-h.md#oh_imageprocessing_initializeenvironment) is not called.|
78
79### OH_ImageProcessing_IsColorSpaceConversionSupported()
80
81```
82bool OH_ImageProcessing_IsColorSpaceConversionSupported(const ImageProcessing_ColorSpaceInfo* sourceImageInfo,const ImageProcessing_ColorSpaceInfo* destinationImageInfo)
83```
84
85**Description**
86
87Checks whether CSC is supported for an image.
88
89**Since**: 13
90
91
92**Parameters**
93
94| Name| Description|
95| -- | -- |
96| const [ImageProcessing_ColorSpaceInfo](capi-imageprocessing-imageprocessing-colorspaceinfo.md)* sourceImageInfo | Pointer to the color space information of the input image.|
97| const [ImageProcessing_ColorSpaceInfo](capi-imageprocessing-imageprocessing-colorspaceinfo.md)* destinationImageInfo | Pointer to the color space information of the output image.|
98
99**Returns**
100
101| Type| Description|
102| -- | -- |
103| bool | Check result. The value **true** is returned if CSC is supported.<br> **false** is returned otherwise.|
104
105### OH_ImageProcessing_IsCompositionSupported()
106
107```
108bool OH_ImageProcessing_IsCompositionSupported(const ImageProcessing_ColorSpaceInfo* sourceImageInfo,const ImageProcessing_ColorSpaceInfo* sourceGainmapInfo,const ImageProcessing_ColorSpaceInfo* destinationImageInfo)
109```
110
111**Description**
112
113Checks whether a dual-layer HDR image can be converted into a single-layer HDR image.
114
115**Since**: 13
116
117
118**Parameters**
119
120| Name| Description|
121| -- | -- |
122| const [ImageProcessing_ColorSpaceInfo](capi-imageprocessing-imageprocessing-colorspaceinfo.md)* sourceImageInfo | Pointer to the color space information of the input image.|
123| const [ImageProcessing_ColorSpaceInfo](capi-imageprocessing-imageprocessing-colorspaceinfo.md)* sourceGainmapInfo | Pointer to the color space information of the input gain map.|
124| const [ImageProcessing_ColorSpaceInfo](capi-imageprocessing-imageprocessing-colorspaceinfo.md)* destinationImageInfo | Pointer to the color space information of the output image.|
125
126**Returns**
127
128| Type| Description|
129| -- | -- |
130| bool | Check result. The value **true** is returned if such a conversion is supported.<br> **false** is returned otherwise.|
131
132### OH_ImageProcessing_IsDecompositionSupported()
133
134```
135bool OH_ImageProcessing_IsDecompositionSupported(const ImageProcessing_ColorSpaceInfo* sourceImageInfo,const ImageProcessing_ColorSpaceInfo* destinationImageInfo,const ImageProcessing_ColorSpaceInfo* destinationGainmapInfo)
136```
137
138**Description**
139
140Checks whether a single-layer HDR image can be converted into a dual-layer HDR image.
141
142**Since**: 13
143
144
145**Parameters**
146
147| Name| Description|
148| -- | -- |
149| const [ImageProcessing_ColorSpaceInfo](capi-imageprocessing-imageprocessing-colorspaceinfo.md)* sourceImageInfo | Pointer to the color space information of the input image.|
150| const [ImageProcessing_ColorSpaceInfo](capi-imageprocessing-imageprocessing-colorspaceinfo.md)* destinationImageInfo | Pointer to the color space information of the output image.|
151| const [ImageProcessing_ColorSpaceInfo](capi-imageprocessing-imageprocessing-colorspaceinfo.md)* destinationGainmapInfo | Pointer to the color space information of the output gain map.|
152
153**Returns**
154
155| Type| Description|
156| -- | -- |
157| bool | Check result. The value **true** is returned if such a conversion is supported.<br> **false** is returned otherwise.|
158
159### OH_ImageProcessing_IsMetadataGenerationSupported()
160
161```
162bool OH_ImageProcessing_IsMetadataGenerationSupported(const ImageProcessing_ColorSpaceInfo* sourceImageInfo)
163```
164
165**Description**
166
167Checks whether metadata generation is supported for an image.
168
169**Since**: 13
170
171
172**Parameters**
173
174| Name| Description|
175| -- | -- |
176| const [ImageProcessing_ColorSpaceInfo](capi-imageprocessing-imageprocessing-colorspaceinfo.md)* sourceImageInfo | Pointer to the color space information of the input image.|
177
178**Returns**
179
180| Type| Description|
181| -- | -- |
182| bool | Check result. The value **true** is returned if metadata generation is supported.<br> **false** is returned otherwise.|
183
184### OH_ImageProcessing_Create()
185
186```
187ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** imageProcessor, int32_t type)
188```
189
190**Description**
191
192Creates an image processing instance.
193
194**Since**: 13
195
196
197**Parameters**
198
199| Name| Description|
200| -- | -- |
201| [OH_ImageProcessing](capi-imageprocessing-oh-imageprocessing.md)** 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.|
202| int32_t type | Image processing type. The processing type cannot be changed after the instance is created.|
203
204**Returns**
205
206| Type| Description|
207| -- | -- |
208| [ImageProcessing_ErrorCode](capi-image-processing-types-h.md#imageprocessing_errorcode) | **IMAGE_PROCESSING_SUCCESS**: The instance is created successfully.<br> **IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING**: The specified image processing type is not supported, for example, if metadata generation is not supported.<br> **IMAGE_PROCESSING_ERROR_CREATE_FAILED**: The instance fails to be created.<br> **IMAGE_PROCESSING_ERROR_INVALID_INSTANCE**: The instance is null or the pointer to the instance is null.<br> **IMAGE_PROCESSING_ERROR_INVALID_PARAMETER**: The specified image processing type is invalid.|
209
210### OH_ImageProcessing_Destroy()
211
212```
213ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* imageProcessor)
214```
215
216**Description**
217
218Destroys an image processing instance.
219
220**Since**: 13
221
222
223**Parameters**
224
225| Name| Description|
226| -- | -- |
227| [OH_ImageProcessing](capi-imageprocessing-oh-imageprocessing.md)* imageProcessor | Pointer to an image processing instance. You are advised to set the pointer to a null pointer after the instance is destroyed.|
228
229**Returns**
230
231| Type| Description|
232| -- | -- |
233| [ImageProcessing_ErrorCode](capi-image-processing-types-h.md#imageprocessing_errorcode) | **IMAGE_PROCESSING_SUCCESS**: The instance is destroyed.<br> **IMAGE_PROCESSING_ERROR_INVALID_INSTANCE**: The instance is null or is not an image processing instance.|
234
235### OH_ImageProcessing_SetParameter()
236
237```
238ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* imageProcessor,const OH_AVFormat* parameter)
239```
240
241**Description**
242
243Sets a parameter for the image processing module. This function sets the parameter by key.
244
245**Since**: 13
246
247
248**Parameters**
249
250| Name| Description|
251| -- | -- |
252| [OH_ImageProcessing](capi-imageprocessing-oh-imageprocessing.md)* imageProcessor | Pointer to an image processing instance.|
253| const [OH_AVFormat](../apis-avcodec-kit/_core.md#oh_avformat)* parameter | Pointer to the parameter.|
254
255**Returns**
256
257| Type| Description|
258| -- | -- |
259| [ImageProcessing_ErrorCode](capi-image-processing-types-h.md#imageprocessing_errorcode) | **IMAGE_PROCESSING_SUCCESS**: The operation is successful.<br> **IMAGE_PROCESSING_ERROR_INVALID_INSTANCE**: The instance is null or is not an image processing instance.<br> **IMAGE_PROCESSING_ERROR_INVALID_PARAMETER**: **parameter** is empty.<br> **IMAGE_PROCESSING_ERROR_INVALID_VALUE**: **parameter** is invalid, for example, if **parameter** contains an unsupported parameter key or value.<br> **IMAGE_PROCESSING_ERROR_NO_MEMORY**: Memory allocation fails.|
260
261### OH_ImageProcessing_GetParameter()
262
263```
264ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* imageProcessor,OH_AVFormat* parameter)
265```
266
267**Description**
268
269Obtains a parameter of the image processing module. This function obtains the parameter by key.
270
271**Since**: 13
272
273
274**Parameters**
275
276| Name| Description|
277| -- | -- |
278| [OH_ImageProcessing](capi-imageprocessing-oh-imageprocessing.md)* imageProcessor | Pointer to an image processing instance.|
279| [OH_AVFormat](../apis-avcodec-kit/_core.md#oh_avformat)* parameter | Pointer to the parameter.|
280
281**Returns**
282
283| Type| Description|
284| -- | -- |
285| [ImageProcessing_ErrorCode](capi-image-processing-types-h.md#imageprocessing_errorcode) | **IMAGE_PROCESSING_SUCCESS**: The operation is successful.<br> **IMAGE_PROCESSING_ERROR_INVALID_INSTANCE**: The instance is null or is not an image processing instance.<br> **IMAGE_PROCESSING_ERROR_INVALID_PARAMETER**: **parameter** is empty.|
286
287### OH_ImageProcessing_ConvertColorSpace()
288
289```
290ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* imageProcessor,OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage)
291```
292
293**Description**
294
295Converts 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.
296
297**Since**: 13
298
299
300**Parameters**
301
302| Name| Description|
303| -- | -- |
304| [OH_ImageProcessing](capi-imageprocessing-oh-imageprocessing.md)* imageProcessor | Pointer to an image processing instance, which is created by **IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION**.|
305| [OH_PixelmapNative](capi-image-nativemodule-oh-pixelmapnative.md)* sourceImage | Pointer to the input image.|
306| [OH_PixelmapNative](capi-image-nativemodule-oh-pixelmapnative.md)* destinationImage | Pointer to the output image.|
307
308**Returns**
309
310| Type| Description|
311| -- | -- |
312| [ImageProcessing_ErrorCode](capi-image-processing-types-h.md#imageprocessing_errorcode) | **IMAGE_PROCESSING_SUCCESS**: Image processing is successful.<br> **IMAGE_PROCESSING_ERROR_INVALID_INSTANCE**: The instance is null or is not an image processing instance.<br> **IMAGE_PROCESSING_ERROR_INVALID_PARAMETER**: The image is empty.<br> **IMAGE_PROCESSING_ERROR_INVALID_VALUE**: An image property is invalid, for example, unsupported color space.<br> **IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING**: Image processing is not supported.<br> **IMAGE_PROCESSING_ERROR_PROCESS_FAILED**: An error occurs during image processing.<br> **IMAGE_PROCESSING_ERROR_NO_MEMORY**: Memory allocation fails.|
313
314### OH_ImageProcessing_Compose()
315
316```
317ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* imageProcessor,OH_PixelmapNative* sourceImage, OH_PixelmapNative* sourceGainmap, OH_PixelmapNative* destinationImage)
318```
319
320**Description**
321
322Converts 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.
323
324**Since**: 13
325
326
327**Parameters**
328
329| Name| Description|
330| -- | -- |
331| [OH_ImageProcessing](capi-imageprocessing-oh-imageprocessing.md)* imageProcessor | Pointer to an image processing instance, which is created by **IMAGE_PROCESSING_TYPE_COMPOSITION**.|
332| [OH_PixelmapNative](capi-image-nativemodule-oh-pixelmapnative.md)* sourceImage | Pointer to the input image.|
333| [OH_PixelmapNative](capi-image-nativemodule-oh-pixelmapnative.md)* sourceGainmap | Pointer to the input gain map.|
334| [OH_PixelmapNative](capi-image-nativemodule-oh-pixelmapnative.md)* destinationImage | Pointer to the output image.|
335
336**Returns**
337
338| Type| Description|
339| -- | -- |
340| [ImageProcessing_ErrorCode](capi-image-processing-types-h.md#imageprocessing_errorcode) | **IMAGE_PROCESSING_SUCCESS**: Image processing is successful.<br> **IMAGE_PROCESSING_ERROR_INVALID_INSTANCE**: The instance is null or is not an image processing instance.<br> **IMAGE_PROCESSING_ERROR_INVALID_PARAMETER**: The image is empty.<br> **IMAGE_PROCESSING_ERROR_INVALID_VALUE**: An image property is invalid, for example, unsupported color space.<br> **IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING**: Image processing is not supported.<br> **IMAGE_PROCESSING_ERROR_PROCESS_FAILED**: An error occurs during image processing.<br> **IMAGE_PROCESSING_ERROR_NO_MEMORY**: Memory allocation fails.|
341
342### OH_ImageProcessing_Decompose()
343
344```
345ImageProcessing_ErrorCode OH_ImageProcessing_Decompose(OH_ImageProcessing* imageProcessor,OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage, OH_PixelmapNative* destinationGainmap)
346```
347
348**Description**
349
350Converts 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.
351
352**Since**: 13
353
354
355**Parameters**
356
357| Name| Description|
358| -- | -- |
359| [OH_ImageProcessing](capi-imageprocessing-oh-imageprocessing.md)* imageProcessor | Pointer to an image processing instance, which is created by **IMAGE_PROCESSING_TYPE_DECOMPOSITION**.|
360| [OH_PixelmapNative](capi-image-nativemodule-oh-pixelmapnative.md)* sourceImage | Pointer to the input image.|
361| [OH_PixelmapNative](capi-image-nativemodule-oh-pixelmapnative.md)* destinationImage | Pointer to the output image.|
362| [OH_PixelmapNative](capi-image-nativemodule-oh-pixelmapnative.md)* destinationGainmap | Pointer to the output gain map.|
363
364**Returns**
365
366| Type| Description|
367| -- | -- |
368| [ImageProcessing_ErrorCode](capi-image-processing-types-h.md#imageprocessing_errorcode) | **IMAGE_PROCESSING_SUCCESS**: Image processing is successful.<br> **IMAGE_PROCESSING_ERROR_INVALID_INSTANCE**: The instance is null or is not an image processing instance.<br> **IMAGE_PROCESSING_ERROR_INVALID_PARAMETER**: The image is empty.<br> **IMAGE_PROCESSING_ERROR_INVALID_VALUE**: An image property is invalid, for example, unsupported color space.<br> **IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING**: Image processing is not supported.<br> **IMAGE_PROCESSING_ERROR_PROCESS_FAILED**: An error occurs during image processing.<br> **IMAGE_PROCESSING_ERROR_NO_MEMORY**: Memory allocation fails.|
369
370### OH_ImageProcessing_GenerateMetadata()
371
372```
373ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* imageProcessor,OH_PixelmapNative* sourceImage)
374```
375
376**Description**
377
378Generates metadata for an HDR image. This function is used to generate metadata for HDR images.
379
380**Since**: 13
381
382
383**Parameters**
384
385| Name| Description|
386| -- | -- |
387| [OH_ImageProcessing](capi-imageprocessing-oh-imageprocessing.md)* imageProcessor | Pointer to an image processing instance, which is created by **IMAGE_PROCESSING_TYPE_METADATA_GENERATION**.|
388| [OH_PixelmapNative](capi-image-nativemodule-oh-pixelmapnative.md)* sourceImage | Pointer to the input image.|
389
390**Returns**
391
392| Type| Description|
393| -- | -- |
394| [ImageProcessing_ErrorCode](capi-image-processing-types-h.md#imageprocessing_errorcode) | **IMAGE_PROCESSING_SUCCESS**: Image processing is successful.<br> **IMAGE_PROCESSING_ERROR_INVALID_INSTANCE**: The instance is null or is not an image processing instance.<br> **IMAGE_PROCESSING_ERROR_INVALID_PARAMETER**: The image is empty.<br> **IMAGE_PROCESSING_ERROR_INVALID_VALUE**: An image property is invalid, for example, unsupported color space.<br> **IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING**: Image processing is not supported.<br> **IMAGE_PROCESSING_ERROR_PROCESS_FAILED**: An error occurs during image processing.<br> **IMAGE_PROCESSING_ERROR_NO_MEMORY**: Memory allocation fails.|
395
396### OH_ImageProcessing_EnhanceDetail()
397
398```
399ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail(OH_ImageProcessing* imageProcessor,OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage)
400```
401
402**Description**
403
404Enhances 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.
405
406**Since**: 13
407
408
409**Parameters**
410
411| Name| Description|
412| -- | -- |
413| [OH_ImageProcessing](capi-imageprocessing-oh-imageprocessing.md)* imageProcessor | Pointer to an image processing instance, which is created by **IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER**.|
414| [OH_PixelmapNative](capi-image-nativemodule-oh-pixelmapnative.md)* sourceImage | Pointer to the input image.|
415| [OH_PixelmapNative](capi-image-nativemodule-oh-pixelmapnative.md)* destinationImage | Pointer to the output image.|
416
417**Returns**
418
419| Type| Description|
420| -- | -- |
421| [ImageProcessing_ErrorCode](capi-image-processing-types-h.md#imageprocessing_errorcode) | **IMAGE_PROCESSING_SUCCESS**: Image processing is successful.<br> **IMAGE_PROCESSING_ERROR_INVALID_INSTANCE**: The instance is null or is not an image processing instance.<br> **IMAGE_PROCESSING_ERROR_INVALID_PARAMETER**: The image is empty.<br> **IMAGE_PROCESSING_ERROR_INVALID_VALUE**: An image property is invalid, for example, unsupported color space.<br> **IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING**: Image processing is not supported.<br> **IMAGE_PROCESSING_ERROR_PROCESS_FAILED**: An error occurs during image processing.<br> **IMAGE_PROCESSING_ERROR_NO_MEMORY**: Memory allocation fails.|
422