1# image_mdk.h 2 3 4## Overview 5 6The **image_mdk.h** file declares the APIs used to access the image rectangle, size, format, and component data. 7 8**Library**: libimage_ndk.z.so 9 10**File to include**: <multimedia/image_framework/image_mdk.h> 11 12**Since**: 10 13 14**Related module**: [Image](image.md) 15 16 17## Summary 18 19 20### Structs 21 22| Name| Description| 23| -------- | -------- | 24| struct [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) | Defines the information about an image rectangle. | 25| struct [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) | Defines the information about an image component. | 26 27 28### Types 29 30| Name| Description| 31| -------- | -------- | 32| typedef struct ImageNative_ [ImageNative](image.md#imagenative) | Defines an image object at the native layer. | 33 34 35### Enums 36 37| Name| Description| 38| -------- | -------- | 39| { [OHOS_IMAGE_FORMAT_YCBCR_422_SP](image.md#image-formats) = 1000,<br>[OHOS_IMAGE_FORMAT_JPEG](image.md#image-formats) = 2000, }| Enumerates the image formats.| 40| { [OHOS_IMAGE_COMPONENT_FORMAT_YUV_Y](image.md#image-color-channel-types) = 1,<br>[OHOS_IMAGE_COMPONENT_FORMAT_YUV_U](image.md#image-color-channel-types) = 2,<br>[OHOS_IMAGE_COMPONENT_FORMAT_YUV_V](image.md#image-color-channel-types) = 3,<br>[OHOS_IMAGE_COMPONENT_FORMAT_JPEG](image.md#image-color-channel-types) = 4, }| Enumerates the image components.| 41 42 43### Functions 44 45| Name| Description| 46| -------- | -------- | 47| [ImageNative](image.md#imagenative) \* [OH_Image_InitImageNative](image.md#oh_image_initimagenative) (napi_env env, napi_value source) | Converts an **Image** object at the JavaScript native layer into an **ImageNative** object. | 48| int32_t [OH_Image_ClipRect](image.md#oh_image_cliprect) (const [ImageNative](image.md#imagenative) \*native, struct [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) \*rect) | Obtains [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) of an **ImageNative** object. | 49| int32_t [OH_Image_Size](image.md#oh_image_size) (const [ImageNative](image.md#imagenative) \*native, struct [OhosImageSize](_ohos_image_size.md) \*size) | Obtains [OhosImageSize](_ohos_image_size.md) of an **ImageNative** object. | 50| int32_t [OH_Image_Format](image.md#oh_image_format) (const [ImageNative](image.md#imagenative) \*native, int32_t \*format) | Obtains the image format of an **ImageNative** object. | 51| int32_t [OH_Image_GetComponent](image.md#oh_image_getcomponent) (const [ImageNative](image.md#imagenative) \*native, int32_t componentType, struct [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) \*componentNative) | Obtains [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) of an **ImageNative** object. | 52| int32_t [OH_Image_Release](image.md#oh_image_release) ([ImageNative](image.md#imagenative) \*native) | Releases an **ImageNative** object. | 53