image_source_native.h

Overview

The image_source_native.h file declares the APIs for image decoding.

Library: libimage_source.so

System capability: SystemCapability.Multimedia.Image.ImageSource

Since: 12

Related module: Image_NativeModule

Summary

Types

Name Description
typedef struct OH_ImageSourceNative OH_ImageSourceNative Defines a struct for the image source, which is used to perform operations related to an image source.
typedef struct OH_ImageSource_Info OH_ImageSource_Info Defines a struct for the image source information, which is used in OH_ImageSourceInfo_Create.
typedef struct OH_DecodingOptions OH_DecodingOptions Defines a struct for decoding options, which are used in OH_ImageSourceNative_CreatePixelmap.

Enums

Name Description
IMAGE_DYNAMIC_RANGE {
IMAGE_DYNAMIC_RANGE_AUTO = 0,
IMAGE_DYNAMIC_RANGE_SDR = 1,
IMAGE_DYNAMIC_RANGE_HDR = 2
}
Enumerates the desired dynamic range for decoding.

Functions

Name Description
Image_ErrorCode OH_ImageSourceInfo_Create (OH_ImageSource_Info **info) Creates the pointer to an OH_ImageSource_Info object.
Image_ErrorCode OH_ImageSourceInfo_GetWidth (OH_ImageSource_Info *info, uint32_t *width) Obtains the image width.
Image_ErrorCode OH_ImageSourceInfo_GetHeight (OH_ImageSource_Info *info, uint32_t *height) Obtains the image height.
Image_ErrorCode OH_ImageSourceInfo_GetDynamicRange (OH_ImageSource_Info *info, bool *isHdr) Obtains the dynamic range of an image.
Image_ErrorCode OH_ImageSourceInfo_Release (OH_ImageSource_Info *info) Releases the pointer to an OH_ImageSource_Info object.
Image_ErrorCode OH_DecodingOptions_Create (OH_DecodingOptions **options) Creates the pointer to an OH_DecodingOptions object.
Image_ErrorCode OH_DecodingOptions_GetPixelFormat (OH_DecodingOptions *options, int32_t *pixelFormat) Obtains the pixel format.
Image_ErrorCode OH_DecodingOptions_SetPixelFormat (OH_DecodingOptions *options, int32_t pixelFormat) Sets the pixel format.
Image_ErrorCode OH_DecodingOptions_GetIndex (OH_DecodingOptions *options, uint32_t *index) Obtains the index of an image.
Image_ErrorCode OH_DecodingOptions_SetIndex (OH_DecodingOptions *options, uint32_t index) Sets the index for an image.
Image_ErrorCode OH_DecodingOptions_GetRotate (OH_DecodingOptions *options, float *rotate) Obtains the rotation degree.
Image_ErrorCode OH_DecodingOptions_SetRotate (OH_DecodingOptions *options, float rotate) Sets the rotation angle.
Image_ErrorCode OH_DecodingOptions_GetDesiredSize (OH_DecodingOptions *options, Image_Size *desiredSize) Obtains the desired output size.
Image_ErrorCode OH_DecodingOptions_SetDesiredSize (OH_DecodingOptions *options, Image_Size *desiredSize) Sets the desired output size.
Image_ErrorCode OH_DecodingOptions_GetDesiredRegion (OH_DecodingOptions *options, Image_Region *desiredRegion) Obtains the region to decode.
Image_ErrorCode OH_DecodingOptions_SetDesiredRegion (OH_DecodingOptions *options, Image_Region *desiredRegion) Sets the region to decode.
Image_ErrorCode OH_DecodingOptions_GetDesiredDynamicRange (OH_DecodingOptions *options, int32_t *desiredDynamicRange) Obtains the desired dynamic range configured during decoding.
Image_ErrorCode OH_DecodingOptions_SetDesiredDynamicRange (OH_DecodingOptions *options, int32_t desiredDynamicRange) Sets the desired dynamic range during decoding.
Image_ErrorCode OH_DecodingOptions_Release (OH_DecodingOptions *options) Releases the pointer to an OH_DecodingOptions object.
Image_ErrorCode OH_ImageSourceNative_CreateFromUri (char *uri, size_t uriSize, OH_ImageSourceNative **res) Creates the pointer to an OH_ImageSourceNative object based on a URI.
Image_ErrorCode OH_ImageSourceNative_CreateFromFd (int32_t fd, OH_ImageSourceNative **res) Creates the pointer to an OH_ImageSourceNative object based on a file descriptor.
Image_ErrorCode OH_ImageSourceNative_CreateFromData (uint8_t *data, size_t dataSize, OH_ImageSourceNative **res) Creates the pointer to an OH_ImageSourceNative object based on buffer data.
Image_ErrorCode OH_ImageSourceNative_CreateFromRawFile (RawFileDescriptor *rawFile, OH_ImageSourceNative **res) Creates the pointer to an OH_ImageSourceNative object by using the raw file descriptor of an image resource file.
Image_ErrorCode OH_ImageSourceNative_CreatePixelmap (OH_ImageSourceNative *source, OH_DecodingOptions *options, OH_PixelmapNative **pixelmap) Creates the pointer to an OH_PixelmapNative object based on decoding options.
Image_ErrorCode OH_ImageSourceNative_CreatePixelmapList (OH_ImageSourceNative *source, OH_DecodingOptions *options, OH_PixelmapNative *resVecPixMap[], size_t size) Creates an array of OH_PixelmapNative objects based on decoding options.
Image_ErrorCode OH_ImageSourceNative_CreatePicture (OH_ImageSourceNative *source, OH_DecodingOptionsForPicture *options, OH_PictureNative **picture) Creates the pointer to an OH_PictureNative object based on decoding options.
Image_ErrorCode OH_ImageSourceNative_GetDelayTimeList (OH_ImageSourceNative *source, int32_t *delayTimeList, size_t size) Obtains the image delay time list.
Image_ErrorCode OH_ImageSourceNative_GetImageInfo (OH_ImageSourceNative *source, int32_t index, OH_ImageSource_Info *info) Obtains the information about an image with a given index.
Image_ErrorCode OH_ImageSourceNative_GetImageProperty (OH_ImageSourceNative *source, Image_String *key, Image_String *value) Obtains the value of an image property.
Image_ErrorCode OH_ImageSourceNative_ModifyImageProperty (OH_ImageSourceNative *source, Image_String *key, Image_String *value) Modifies the value of an image property.
Image_ErrorCode OH_ImageSourceNative_GetFrameCount (OH_ImageSourceNative *source, uint32_t *frameCount) Obtains the number of image frames.
Image_ErrorCode OH_ImageSourceNative_Release (OH_ImageSourceNative *source) Releases the pointer to an OH_ImageSourceNative object.
Image_ErrorCode OH_DecodingOptionsForPicture_Create (OH_DecodingOptionsForPicture **options) Creates the pointer to an OH_DecodingOptionsForPicture object.
Image_ErrorCode OH_DecodingOptionsForPicture_GetDesiredAuxiliaryPictures (OH_DecodingOptionsForPicture *options, Image_AuxiliaryPictureType **desiredAuxiliaryPictures, size_t *length) Obtains desired auxiliary pictures in the decoding options (auxiliary pictures contained in picture expected to be decoded.)
Image_ErrorCode OH_DecodingOptionsForPicture_SetDesiredAuxiliaryPictures (OH_DecodingOptionsForPicture *options, Image_AuxiliaryPictureType *desiredAuxiliaryPictures, size_t length) Sets desired auxiliary pictures in the decoding options.
Image_ErrorCode OH_DecodingOptionsForPicture_Release (OH_DecodingOptionsForPicture *options) Releases the pointer to an OH_DecodingOptionsForPicture object.