1# Introduction to the Image_NativeModule Structs
2
3This topic describes certain structs provided by the Image_NativeModule module. For details about other structs, see the [API Reference](../../reference/apis-image-kit/_image___native_module.md#structs).
4
5## OH_ImageNative Struct
6
7OH_ImageNative is the image object struct encapsulated at the native layer. The struct cannot be directly operated. Instead, its fields must be operated by calling functions. The table below describes the content and operation mode of the OH_ImageNative struct.
8
9| Field Type| Field Name| Field Description|Operation Function| Function Description|
10| -------- | -------- | -------- | -------- | -------- |
11| Image_Size| imageSize | Image size.|[OH_ImageNative_GetImageSize](../../reference/apis-image-kit/_image___native_module.md#oh_imagenative_getimagesize) | Obtains the image size of an **OH_ImageNative** object.|
12| uint32_t | types |Component type, which is used to describe the image's color component.|[OH_ImageNative_GetComponentTypes](../../reference/apis-image-kit/_image___native_module.md#oh_imagenative_getcomponenttypes) | Obtains the component types of an **OH_ImageNative** object.|
13| OH_NativeBuffer | nativeBuffer | Component buffer.|[OH_ImageNative_GetByteBuffer](../../reference/apis-image-kit/_image___native_module.md#oh_imagenative_getbytebuffer) | Obtains the buffer corresponding to a component type in an **OH_ImageNative** object.|
14| size_t | bufferSize | Buffer size.| [OH_ImageNative_GetBufferSize](../../reference/apis-image-kit/_image___native_module.md#oh_imagenative_getbuffersize) | Obtains the size of the buffer corresponding to a component type in an **OH_ImageNative** object.|
15| int32_t | rowStride | Row stride.| [OH_ImageNative_GetRowStride](../../reference/apis-image-kit/_image___native_module.md#oh_imagenative_getrowstride) | Obtains the row stride corresponding to a component type in an **OH_ImageNative** object.|
16| int32_t | pixelStride | Pixel stride.| [OH_ImageNative_GetPixelStride](../../reference/apis-image-kit/_image___native_module.md#oh_imagenative_getpixelstride) | Obtains the pixel stride corresponding to a component type in an **OH_ImageNative** object.|
17
18You can run [OH_ImageNative_Release](../../reference/apis-image-kit/_image___native_module.md#oh_imagenative_release) to release an **OH_ImageNative** object.
19
20## OH_ImagePackerNative Struct
21
22OH_ImagePackerNative is the image packer struct encapsulated at the native layer. The struct cannot be directly operated. Instead, its fields must be operated by calling functions. The table below describes the content and operation mode of the OH_ImagePackerNative struct.
23
24| Field Type| Field Name| Field Description|Operation Function| Function Description|
25| -------- | -------- | -------- | -------- | -------- |
26| OH_ImageSourceNative | imageSource | Image source.| [OH_ImagePackerNative_PackToDataFromImageSource](../../reference/apis-image-kit/_image___native_module.md#oh_imagepackernative_packtodatafromimagesource) | Encodes an image source into data in a given format.|
27|OH_PixelmapNative | pixelmap | PixelMap at the native layer.| [OH_ImagePackerNative_PackToDataFromPixelmap](../../reference/apis-image-kit/_image___native_module.md#oh_imagepackernative_packtodatafrompixelmap) | Encodes a PixelMap into data in a given format.|
28|int32_t | imagesourceFd | File descriptor of an image source.| [OH_ImagePackerNative_PackToFileFromImageSource](../../reference/apis-image-kit/_image___native_module.md#oh_imagepackernative_packtofilefromimagesource) | Encodes an image source into a file.|
29|int32_t | pixelmapFd | File descriptor of a PixelMap.| [OH_ImagePackerNative_PackToFileFromPixelmap](../../reference/apis-image-kit/_image___native_module.md#oh_imagepackernative_packtofilefrompixelmap) | Encodes a PixelMap into a file.|
30
31You can run [OH_ImagePackerNative_Create](../../reference/apis-image-kit/_image___native_module.md#oh_imagepackernative_create) to create an **OH_ImagePackerNative** object.
32
33You can run [OH_ImagePackerNative_Release](../../reference/apis-image-kit/_image___native_module.md#oh_imagepackernative_release) to release an **OH_ImagePackerNative** object.
34
35## OH_PackingOptions Struct
36
37OH_PackingOptions is the image packing option struct encapsulated at the native layer. The struct cannot be directly operated. Instead, functions must be called to create and release the struct and operate the fields in the struct.
38
39You can run [OH_PackingOptions_Create](../../reference/apis-image-kit/_image___native_module.md#oh_packingoptions_create) to create an **OH_PackingOptions** object.
40
41You can run [OH_PackingOptions_Release](../../reference/apis-image-kit/_image___native_module.md#oh_packingoptions_release) to release an **OH_PackingOptions** object.
42
43The table below describes the content and operation mode of the OH_PackingOptions struct.
44| Field Type| Field Name| Field Description|Operation Function| Function Description|
45| -------- | -------- | -------- | -------- | -------- |
46| Image_MimeType | mimeType | MIME type.| [OH_PackingOptions_GetMimeType](../../reference/apis-image-kit/_image___native_module.md#oh_packingoptions_getmimetype) | Obtains the MIME type.|
47| Image_MimeType | mimeType | MIME type.| [OH_PackingOptions_SetMimeType](../../reference/apis-image-kit/_image___native_module.md#oh_packingoptions_setmimetype) | Sets the MIME type.|
48| uint32_t | quality | Encoding quality.| [OH_PackingOptions_GetQuality](../../reference/apis-image-kit/_image___native_module.md#oh_packingoptions_getquality) | Obtains the encoding quality.|
49| uint32_t | quality | Encoding quality.| [OH_PackingOptions_SetQuality](../../reference/apis-image-kit/_image___native_module.md#oh_packingoptions_setquality) | Sets the encoding quality.|
50| int32_t | desiredDynamicRange | Desired dynamic range.| [OH_PackingOptions_GetDesiredDynamicRange](../../reference/apis-image-kit/_image___native_module.md#oh_packingoptions_getdesireddynamicrange) | Obtains the desired dynamic range during encoding.|
51| int32_t | desiredDynamicRange | Desired dynamic range.| [OH_PackingOptions_SetDesiredDynamicRange](../../reference/apis-image-kit/_image___native_module.md#oh_packingoptions_setdesireddynamicrange) | Sets the desired dynamic range during encoding.|
52
53## OH_ImageReceiverNative Struct
54
55OH_ImageReceiverNative is the image receiver struct encapsulated at the native layer. The struct cannot be directly operated. Instead, functions must be called to create and release the struct and operate the fields in the struct.
56
57You can run [OH_ImageReceiverNative_Create](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceivernative_create) to create an **OH_ImageReceiverNative** object.
58
59You can run [OH_ImageReceiverNative_Release](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceivernative_release) to release an **OH_ImageReceiverNative** object.
60
61The table below describes the content and operation mode of the OH_ImageReceiverNative struct.
62| Field Type| Field Name| Field Description|Operation Function| Function Description|
63| -------- | -------- | -------- | -------- | -------- |
64| uint64_t | surfaceId | Surface ID of the receiver.| [OH_ImageReceiverNative_GetReceivingSurfaceId](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceivernative_getreceivingsurfaceid) |Obtains the receiver ID of an **OH_ImageReceiverNative** object.|
65| OH_ImageNative | image | Image at the native layer.| [OH_ImageReceiverNative_ReadLatestImage](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceivernative_readlatestimage) | Obtains the latest image through an **OH_ImageReceiverNative** object.|
66| OH_ImageNative | image | Image at the native layer.| [OH_ImageReceiverNative_ReadNextImage](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceivernative_readnextimage) |Obtains the next image through an **OH_ImageReceiverNative** object.|
67| OH_ImageReceiver_OnCallback | callback| Callback function of the image receiver.| [OH_ImageReceiverNative_On](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceivernative_on) |Registers an **OH_ImageReceiver_OnCallback**.|
68| OH_ImageReceiver_OnCallback | callback| Callback function of the image receiver.| [OH_ImageReceiverNative_Off](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceivernative_off) |Unregisters an **OH_ImageReceiver_OnCallback**.|
69| Image_Size | size | Size of an image receiver.| [OH_ImageReceiverNative_GetSize](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceivernative_getsize) |Obtains the size of an **OH_ImageReceiverNative**.|
70|int32_t | capacity| Capacity of an image receiver.| [OH_ImageReceiverNative_GetCapacity](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceivernative_getcapacity) |Obtains the capacity of an **OH_ImageReceiverNative**.|
71
72## OH_ImageReceiverOptions Struct
73
74OH_ImageReceiverOptions is the image receiver option setter struct encapsulated at the native layer. It is used to pass parameters during the creation of an **OH_ImageReceiverNative** object.
75The struct cannot be directly operated. Instead, functions must be called to create and release the struct and operate the fields in the struct.
76
77You can run [OH_ImageReceiverOptions_Create](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceiveroptions_create) to create an **OH_ImageReceiverOptions** object.
78
79You can run [OH_ImageReceiverOptions_Release](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceiveroptions_release) to release an **OH_ImageReceiverOptions** object.
80
81The table below describes the content and operation mode of the OH_ImageReceiverOptions struct.
82| Field Type| Field Name| Field Description|Operation Function| Function Description|
83| -------- | -------- | -------- | -------- | -------- |
84| Image_Size | size | Image size.| [OH_ImageReceiverOptions_GetSize](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceiveroptions_getsize)	|Obtains the image size of an **OH_ImageReceiverOptions** object.|
85| Image_Size | size | Image size.| [OH_ImageReceiverOptions_SetSize](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceiveroptions_setsize)	|Sets the image size for an **OH_ImageReceiverOptions** object.|
86| int32_t | capacity | Capacity of the image buffer.| [OH_ImageReceiverOptions_GetCapacity](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceiveroptions_getcapacity)	|Obtains the capacity of an **OH_ImageReceiverOptions** object.|
87| int32_t | capacity | Capacity of the image buffer.| [OH_ImageReceiverOptions_SetCapacity](../../reference/apis-image-kit/_image___native_module.md#oh_imagereceiveroptions_setcapacity)	|Sets the capacity for an **OH_ImageReceiverOptions** object.|
88
89## OH_ImageSourceNative Struct
90
91OH_ImageSourceNative is the image source struct encapsulated at the native layer and is used to create image data. The struct cannot be directly operated. Instead, functions must be called to create and release the struct and operate the fields in the struct.
92
93You can create an **OH_ImageSourceNative** object in multiple ways, as described below.
94| Function| Description|
95| -------- | -------- |
96| [OH_ImageSourceNative_CreateFromUri](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_createfromuri)	|Creates an **OH_ImageSourceNative** object based on a URI.|
97| [OH_ImageSourceNative_CreateFromFd](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_createfromfd)	|Creates an **OH_ImageSourceNative** object based on a file descriptor.|
98| [OH_ImageSourceNative_CreateFromData](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_createfromdata)	|Creates an **OH_ImageSourceNative** object based on buffer data.|
99| [OH_ImageSourceNative_CreateFromRawFile](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_createfromrawfile)	|Creates an **OH_ImageSourceNative** object by using the raw file descriptor of an image resource file.|
100| [OH_ImageSourceNative_CreatePixelmap](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_createpixelmap)	|Creates an **OH_PixelmapNative** object based on image decoding parameters.|
101| [OH_ImageSourceNative_CreatePixelmapList](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_createpixelmaplist)	|Creates an array of **OH_PixelmapNative** objects based on image decoding parameters.|
102
103You can run [OH_ImageSourceNative_Release](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_release) to release an **OH_ImageSourceNative** object.
104
105The table below describes the content and operation mode of the OH_ImageSourceNative struct.
106| Field Type| Field Name| Field Description|Operation Function| Function Description|
107| -------- | -------- | -------- | -------- | -------- |
108| int32_t | delayTimeList | Image delay time list.| [OH_ImageSourceNative_GetDelayTimeList](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_getdelaytimelist)	|Obtains the image delay time list.|
109| OH_ImageSource_Info | info | Image source information.| [OH_ImageSourceNative_GetImageInfo](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_getimageinfo)	|Obtains the information about an image with a given index.|
110| Image_String | value | Configuration item.| [OH_ImageSourceNative_GetImageProperty](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_getimageproperty)	|Obtains the value of an image property.|
111| Image_String | value | Configuration item.| [OH_ImageSourceNative_ModifyImageProperty](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_modifyimageproperty)	|Modifies the value of an image property.|
112| uint32_t | frameCount | Number of frames| [OH_ImageSourceNative_GetFrameCount](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_getframecount)	|Obtains the number of image frames.|
113
114## OH_ImageSource_Info Struct
115
116OH_ImageSource_Info is the image source information struct encapsulated at the native layer. The struct cannot be directly operated. Instead, functions must be called to create and release the struct and operate the fields in the struct.
117
118You can run [OH_ImageSourceInfo_Create](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourceinfo_create) to create an **OH_ImageSource_Info** object.
119
120You can run [OH_ImageSourceInfo_Release](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourceinfo_release) to release an **OH_ImageSource_Info** object.
121
122The table below describes the content and operation mode of the OH_ImageSource_Info struct.
123| Field Type| Field Name| Field Description|Operation Function| Function Description|
124| -------- | -------- | -------- | -------- | -------- |
125| uint32_t | width | Image width.| [OH_ImageSourceInfo_GetWidth](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourceinfo_getwidth)	|Obtains the image width.|
126| uint32_t | height | Image height.| [OH_ImageSourceInfo_GetHeight](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourceinfo_getheight)	|Obtains the image height.|
127| bool | isHdr | Dynamic range.| [OH_ImageSourceInfo_GetDynamicRange](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourceinfo_getdynamicrange)	|Obtains the dynamic range of an image.|
128
129## OH_DecodingOptions Struct
130
131OH_DecodingOptions is the decoding options struct encapsulated at the native layer. This struct is used to set decoding options and is passed in as an input parameter for creating a PixelMap. For details, see [OH_ImageSourceNative_CreatePixelmap](../../reference/apis-image-kit/_image___native_module.md#oh_imagesourcenative_createpixelmap).
132
133The struct cannot be directly operated. Instead, functions must be called to create and release the struct and operate the fields in the struct.
134
135You can run [OH_DecodingOptions_Create](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_create) to create an **OH_DecodingOptions** object.
136
137You can run [OH_DecodingOptions_Release](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_release) to release an **OH_DecodingOptions** object.
138
139The table below describes the content and operation mode of the OH_DecodingOptions struct.
140| Field Type| Field Name| Field Description|Operation Function| Function Description|
141| -------- | -------- | -------- | -------- | -------- |
142| int32_t | pixelFormat | Pixel format.| [OH_DecodingOptions_GetPixelFormat](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_getpixelformat)	|Obtains the pixel format.|
143| int32_t | pixelFormat | Pixel format.| [OH_DecodingOptions_SetPixelFormat](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_setpixelformat)	| Sets the pixel format.|
144| uint32_t | index | Index of the image to decode.| [OH_DecodingOptions_GetIndex](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_getindex)	| Obtains the index of an image.|
145| uint32_t | index | Index of the image to decode.| [OH_DecodingOptions_SetIndex](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_setindex)	| Sets the index for an image.|
146| float | rotate | Rotation angle.| [OH_DecodingOptions_GetRotate](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_getrotate)	| Obtains the rotation degree.|
147| float | rotate | Rotation angle.| [OH_DecodingOptions_SetRotate](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_setrotate)	| Sets the rotation angle.|
148| Image_Size | desiredSize | Desired output size.| [OH_DecodingOptions_GetDesiredSize](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_getdesiredsize)	| Obtains the desired output size.|
149| Image_Size | desiredSize | Desired output size.| [OH_DecodingOptions_SetDesiredSize](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_setdesiredsize)	| Sets the desired output size.|
150| Image_Region | desiredRegion | Region to decode.| [OH_DecodingOptions_GetDesiredRegion](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_getdesiredregion) | Obtains the region to decode.|
151| Image_Region | desiredRegion | Region to decode.| [OH_DecodingOptions_SetDesiredRegion](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_setdesiredregion) | Sets the region to decode.|
152| int32_t | desiredDynamicRange | Desired dynamic range.| [OH_DecodingOptions_GetDesiredDynamicRange](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_getdesireddynamicrange)	|Obtains the desired dynamic range configured during decoding.|
153| int32_t | desiredDynamicRange | Desired dynamic range.| [OH_DecodingOptions_SetDesiredDynamicRange](../../reference/apis-image-kit/_image___native_module.md#oh_decodingoptions_setdesireddynamicrange)|Sets the desired dynamic range during decoding.|
154
155## OH_PixelmapNative Struct
156
157OH_PixelmapNative is an uncompressed PixelMap format struct encapsulated at the native layer after images are decoded.
158
159You can run [OH_PixelmapNative_CreatePixelmap](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapnative_createpixelmap) to create an **OH_PixelmapNative** object. By default, the BGRA_8888 format is used to process data.
160
161You can run [OH_PixelmapNative_Release](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapnative_release) to release an **OH_PixelmapNative** object.
162
163The table below describes the content and operation mode of the OH_PixelmapNative struct.
164| Field Type| Field Name| Field Description|Operation Function| Function Description|
165| -------- | -------- | -------- | -------- | -------- |
166| uint8_t | data | Image pixel data.| [OH_PixelmapNative_ReadPixels](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapnative_readpixels)	| Reads the image pixel data and writes the data to an ArrayBuffer.|
167| uint8_t | data | Image pixel data.| [OH_PixelmapNative_WritePixels](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapnative_writepixels)	| Reads the image pixel data in the buffer and writes the data to a PixelMap.|
168| OH_Pixelmap_ImageInfo | imageInfo | Image information.| [OH_PixelmapNative_GetImageInfo](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapnative_getimageinfo)	| Obtains the image information.|
169| float | alphaRate | Opacity rate.| [OH_PixelmapNative_Opacity](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapnative_opacity)	| Sets the opacity rate to enable the PixelMap to achieve the corresponding opacity effect.|
170|float, float, | scaleX, scaleY | Scale ratios along the X axis and Y axis, respectively.|[OH_PixelmapNative_Scale](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapnative_scale)	| Scales an image based on a given width and height.|
171| float, float| x, y | Distances to translate along the X axis and Y axis, respectively.| [OH_PixelmapNative_Translate](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapnative_translate)	| Translates an image based on given coordinates.|
172| float | angle | Rotation angle.|[OH_PixelmapNative_Rotate](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapnative_rotate) | Rotates an image based on a given angle.|
173| bool, bool | shouldFilpHorizontally, shouldFilpVertically | Whether to flip horizontally or vertically| [OH_PixelmapNative_Flip](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapnative_flip)	| Flips an image based on a given angle.|
174| Image_Region | region | Cropping region.| [OH_PixelmapNative_Crop](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapnative_crop)	| Crops a PixelMap based on a given size.|
175
176## OH_Pixelmap_InitializationOptions Struct
177
178OH_Pixelmap_InitializationOptions is the initialization option struct encapsulated at the native layer. It is used to set the initialization parameters for a PixelMap.
179
180You can run [OH_PixelmapInitializationOptions_Create](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapinitializationoptions_create) to create an **OH_Pixelmap_InitializationOptions** object.
181
182You can run [OH_PixelmapInitializationOptions_Release](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapinitializationoptions_release) to release an **OH_Pixelmap_InitializationOptions** object.
183
184The table below describes the content and operation mode of the OH_Pixelmap_InitializationOptions struct.
185| Field Type| Field Name| Field Description|Operation Function| Function Description|
186| -------- | -------- | -------- | -------- | -------- |
187| uint32_t | width | Image width.| [OH_PixelmapInitializationOptions_GetWidth](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapinitializationoptions_getwidth)	|Obtains the image width.|
188| uint32_t | width | Image width.| [OH_PixelmapInitializationOptions_SetWidth](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapinitializationoptions_setwidth)	|Sets the image width.|
189| uint32_t | height | Image height.| [OH_PixelmapInitializationOptions_GetHeight](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapinitializationoptions_getheight)	|Obtains the image height.|
190| uint32_t | height | Image height.| [OH_PixelmapInitializationOptions_SetHeight](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapinitializationoptions_setheight)	|Sets the image height.|
191| int32_t | pixelFormat | Pixel format.| [OH_PixelmapInitializationOptions_GetPixelFormat](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapinitializationoptions_getpixelformat)	|Obtains the pixel format.|
192| int32_t | pixelFormat | Pixel format.| [OH_PixelmapInitializationOptions_SetPixelFormat](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapinitializationoptions_setpixelformat)	|Sets the pixel format.|
193| int32_t | alphaType | Alpha type.| [OH_PixelmapInitializationOptions_GetAlphaType](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapinitializationoptions_getalphatype)	|Obtains the alpha type.|
194| int32_t | alphaType | Alpha type.| [OH_PixelmapInitializationOptions_SetAlphaType](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapinitializationoptions_setalphatype)	|Sets the alpha type.|
195
196## OH_Pixelmap_ImageInfo Struct
197
198OH_Pixelmap_ImageInfo is the image information struct encapsulated at the native layer. It stores the width, height, row stride, pixel format, and HDR of an image.
199
200You can run [OH_PixelmapImageInfo_Create](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapimageinfo_create) to create an **OH_Pixelmap_ImageInfo** object.
201
202You can run [OH_PixelmapImageInfo_Release](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapimageinfo_release) to release an **OH_Pixelmap_ImageInfo** object.
203
204The table below describes the content and operation mode of the OH_Pixelmap_ImageInfo struct.
205| Field Type| Field Name| Field Description|Operation Function| Function Description|
206| -------- | -------- | -------- | -------- | -------- |
207| uint32_t | width | Image width.| [OH_PixelmapImageInfo_GetWidth](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapimageinfo_getwidth)	| Obtains the image width.|
208| uint32_t | height | Image height.| [OH_PixelmapImageInfo_GetHeight](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapimageinfo_getheight)	| Obtains the image height.|
209| uint32_t | rowStride | Row stride.| [OH_PixelmapImageInfo_GetRowStride](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapimageinfo_getrowstride)	| Obtains the row stride.|
210| int32_t | pixelFormat| Pixel format.| [OH_PixelmapImageInfo_GetPixelFormat](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapimageinfo_getpixelformat)	|Obtains the pixel format.|
211| int32_t | alphaType | Alpha type.| [OH_PixelmapImageInfo_GetAlphaType](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapimageinfo_getalphatype)	|Obtains the alpha type.|
212| bool | isHdr | Dynamic range.| [OH_PixelmapImageInfo_GetDynamicRange](../../reference/apis-image-kit/_image___native_module.md#oh_pixelmapimageinfo_getdynamicrange)	|Obtains the dynamic range of a PixelMap.|
213