• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# OH_DecodingOptions
2<!--Kit: Image Kit-->
3<!--Subsystem: Multimedia-->
4<!--Owner: @aulight02-->
5<!--SE: @liyang_bryan-->
6<!--TSE: @xchaosioda-->
7
8## Overview
9
10The OH_DecodingOptions struct describes the decoding options encapsulated at the native layer. The 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](capi-image-source-native-h.md#oh_imagesourcenative_createpixelmap).
11
12The struct cannot be directly operated. Instead, functions must be called to create and release the struct and operate the fields in the struct.
13
14To create an OH_DecodingOptions object, call [OH_DecodingOptions_Create](capi-image-source-native-h.md#oh_decodingoptions_create).
15
16To release an OH_DecodingOptions object, call [OH_DecodingOptions_Release](capi-image-source-native-h.md#oh_decodingoptions_release).
17
18The table below describes the content and operation mode of the OH_DecodingOptions struct.
19
20| Field Type| Field Name| Field Description|Operation Function| Function Description|
21| -------- | -------- | -------- | -------- | -------- |
22| int32_t | pixelFormat | Pixel format.| [OH_DecodingOptions_GetPixelFormat](capi-image-source-native-h.md#oh_decodingoptions_getpixelformat) |Obtains the pixel format.|
23| int32_t | pixelFormat | Pixel format.| [OH_DecodingOptions_SetPixelFormat](capi-image-source-native-h.md#oh_decodingoptions_setpixelformat) | Sets the pixel format.|
24| uint32_t | index | Index of the image to decode.| [OH_DecodingOptions_GetIndex](capi-image-source-native-h.md#oh_decodingoptions_getindex) | Obtains the index of an image.|
25| uint32_t | index | Index of the image to decode.| [OH_DecodingOptions_SetIndex](capi-image-source-native-h.md#oh_decodingoptions_setindex) | Sets the index for an image.|
26| float | rotate | Rotation angle.| [OH_DecodingOptions_GetRotate](capi-image-source-native-h.md#oh_decodingoptions_getrotate) | Obtains the rotation degree.|
27| float | rotate | Rotation angle.| [OH_DecodingOptions_SetRotate](capi-image-source-native-h.md#oh_decodingoptions_setrotate) | Sets the rotation angle.|
28| Image_Size | desiredSize | Desired output size.| [OH_DecodingOptions_GetDesiredSize](capi-image-source-native-h.md#oh_decodingoptions_getdesiredsize) | Obtains the desired output size.|
29| Image_Size | desiredSize | Desired output size.| [OH_DecodingOptions_SetDesiredSize](capi-image-source-native-h.md#oh_decodingoptions_setdesiredsize) | Sets the desired output size.|
30| Image_Region | desiredRegion | Region to decode.| [OH_DecodingOptions_GetDesiredRegion](capi-image-source-native-h.md#oh_decodingoptions_getdesiredregion) | Obtains the region to decode.|
31| Image_Region | desiredRegion | Region to decode.| [OH_DecodingOptions_SetDesiredRegion](capi-image-source-native-h.md#oh_decodingoptions_setdesiredregion) | Sets the region to decode.|
32| int32_t | desiredDynamicRange | Desired dynamic range.| [OH_DecodingOptions_GetDesiredDynamicRange](capi-image-source-native-h.md#oh_decodingoptions_getdesireddynamicrange) |Obtains the desired dynamic range configured during decoding.|
33| int32_t | desiredDynamicRange | Desired dynamic range.| [OH_DecodingOptions_SetDesiredDynamicRange](capi-image-source-native-h.md#oh_decodingoptions_setdesireddynamicrange)|Sets the desired dynamic range during decoding.|
34
35**Since**: 12
36
37**Related module**: [Image_NativeModule](capi-image-nativemodule.md)
38
39**Header file**: [image_source_native.h](capi-image-source-native-h.md)
40