harmony 鸿蒙Image

2023-06-24 浏览 (1664)

Image

Overview

The Image package provides APIs for accessing the Image module. For example, you can use the APIs to obtain image data, pixel map data, and pixel map information.

@Syscap SystemCapability.Multimedia.Image

Since

8

Summary

Files

NameDescription
image_mdk.hDeclares the functions that access the image rectangle, size, format, and component data.
File to include: <multimedia/image_framework/image_mdk.h>
Library: libimage_ndk.z.so
image_mdk_common.hDeclares the common enums and structs used by the image interface.
File to include: <multimedia/image_framework/image_mdk_common.h>
Library: libimage_ndk.z.so
image_pixel_map_mdk.hDeclares the APIs that can lock, access, and unlock a pixel map.
File to include: <multimedia/image_framework/image_pixel_map_mdk.h>
Library: libpixelmap_ndk.z.so
image_pixel_map_napi.hDeclares the APIs that can lock, access, and unlock a pixel map.
File to include: <multimedia/image_framework/image_pixel_map_napi.h>
Library: libpixelmap_ndk.z.so
image_receiver_mdk.hDeclares the APIs for obtaining image data from the native layer.
File to include: <multimedia/image_framework/image_receiver_mdk.h>
Library: libimage_receiver_ndk.z.so
image_source_mdk.hDeclares the APIs for decoding an image source into a pixel map.
File to include: <multimedia/image_framework/image_source_mdk.h>
Library: libimage_source_ndk.z.so

Structs

NameDescription
OhosImageRectDefines the information about an image rectangle.
OhosImageComponentDefines the information about an image component.
OhosImageSizeDefines the image size.
OhosPixelMapInfosDefines the information about a pixel map.
OhosPixelMapCreateOpsDefines the options for creating a pixel map.
OHOS::Media::OhosPixelMapInfoDefines the information about a pixel map.
OhosImageReceiverInfoDefines the information about an image receiver.
OhosImageRegionDefines the region of an image source to decode.
OhosImageSourceOpsDefines the image source options.
OhosImageDecodingOpsDefines the options for decoding an image source.
OhosImageSourceInfoDefines the information about an image source.
OhosImageSourceDefines the input resource of an image source. Only one type of resource is accepted at a time.
OhosImageSourceDelayTimeListDefines the delay time list of an image source.
OhosImageSourceSupportedFormatDefines the format string supported by an image source.
OhosImageSourceSupportedFormatListDefines the format string list supported by an image source.
OhosImageSourcePropertyDefines the property string (in key-value format) of an image source.
OhosImageSourceUpdateDataDefines the update data of an image source.

Types

NameDescription
ImageNativeDefines an image object at the native layer.
NativePixelMapDefines the data type name of the pixel map at the native layer.
OhosPixelMapInfosDefines the information about a pixel map.
ImageReceiverNativeDefines the data type name of the image receiver at the native layer.
(*OH_Image_Receiver_On_Callback) ()Defines the callbacks for the image interface at the native layer.
ImageSourceNativeDefines an image source object at the native layer.

Macros

NameDescription
IMAGE_RESULT_BASE 62980096Defines the basic value returned by the interface.

Enums

NameDescription
{ OHOS_IMAGE_FORMAT_YCBCR_422_SP = 1000,
OHOS_IMAGE_FORMAT_JPEG = 2000, }
Enumerates the image formats.
{ OHOS_IMAGE_COMPONENT_FORMAT_YUV_Y = 1,
OHOS_IMAGE_COMPONENT_FORMAT_YUV_U = 2,
OHOS_IMAGE_COMPONENT_FORMAT_YUV_V = 3,
OHOS_IMAGE_COMPONENT_FORMAT_JPEG = 4, }
Enumerates the image components.
IRNdkErrCode {
IMAGE_RESULT_SUCCESS = 0,
IMAGE_RESULT_BAD_PARAMETER = -1,
IMAGE_RESULT_IMAGE_RESULT_BASE = IMAGE_RESULT_BASE,
IMAGE_RESULT_ERR_IPC = IMAGE_RESULT_BASE + 1,
IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST = IMAGE_RESULT_BASE + 2,
IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL = IMAGE_RESULT_BASE + 3,
IMAGE_RESULT_DECODE_ABNORMAL = IMAGE_RESULT_BASE + 4,
IMAGE_RESULT_DATA_ABNORMAL = IMAGE_RESULT_BASE + 5,
IMAGE_RESULT_MALLOC_ABNORMAL = IMAGE_RESULT_BASE + 6,
IMAGE_RESULT_DATA_UNSUPPORT = IMAGE_RESULT_BASE + 7,
IMAGE_RESULT_INIT_ABNORMAL = IMAGE_RESULT_BASE + 8,
IMAGE_RESULT_GET_DATA_ABNORMAL = IMAGE_RESULT_BASE + 9,
IMAGE_RESULT_TOO_LARGE = IMAGE_RESULT_BASE + 10,
IMAGE_RESULT_TRANSFORM = IMAGE_RESULT_BASE + 11,
IMAGE_RESULT_COLOR_CONVERT = IMAGE_RESULT_BASE + 12,
IMAGE_RESULT_CROP = IMAGE_RESULT_BASE + 13,
IMAGE_RESULT_SOURCE_DATA = IMAGE_RESULT_BASE + 14,
IMAGE_RESULT_SOURCE_DATA_INCOMPLETE = IMAGE_RESULT_BASE + 15,
IMAGE_RESULT_MISMATCHED_FORMAT = IMAGE_RESULT_BASE + 16,
IMAGE_RESULT_UNKNOWN_FORMAT = IMAGE_RESULT_BASE + 17,
IMAGE_RESULT_SOURCE_UNRESOLVED = IMAGE_RESULT_BASE + 18,
IMAGE_RESULT_INVALID_PARAMETER = IMAGE_RESULT_BASE + 19,
IMAGE_RESULT_DECODE_FAILED = IMAGE_RESULT_BASE + 20,
IMAGE_RESULT_PLUGIN_REGISTER_FAILED = IMAGE_RESULT_BASE + 21,
IMAGE_RESULT_PLUGIN_CREATE_FAILED = IMAGE_RESULT_BASE + 22,
IMAGE_RESULT_ENCODE_FAILED = IMAGE_RESULT_BASE + 23,
IMAGE_RESULT_ADD_PIXEL_MAP_FAILED = IMAGE_RESULT_BASE + 24,
IMAGE_RESULT_HW_DECODE_UNSUPPORT = IMAGE_RESULT_BASE + 25,
IMAGE_RESULT_DECODE_HEAD_ABNORMAL = IMAGE_RESULT_BASE + 26,
IMAGE_RESULT_DECODE_EXIF_UNSUPPORT = IMAGE_RESULT_BASE + 27,
IMAGE_RESULT_PROPERTY_NOT_EXIST = IMAGE_RESULT_BASE + 28,
IMAGE_RESULT_MEDIA_DATA_UNSUPPORT = IMAGE_RESULT_BASE + 30,
IMAGE_RESULT_MEDIA_TOO_LARGE = IMAGE_RESULT_BASE + 31,
IMAGE_RESULT_MEDIA_MALLOC_FAILED = IMAGE_RESULT_BASE + 32,
IMAGE_RESULT_MEDIA_END_OF_STREAM = IMAGE_RESULT_BASE + 33,
IMAGE_RESULT_MEDIA_IO_ABNORMAL = IMAGE_RESULT_BASE + 34,
IMAGE_RESULT_MEDIA_MALFORMED = IMAGE_RESULT_BASE + 35,
IMAGE_RESULT_MEDIA_BUFFER_TOO_SMALL = IMAGE_RESULT_BASE + 36,
IMAGE_RESULT_MEDIA_OUT_OF_RANGE = IMAGE_RESULT_BASE + 37,
IMAGE_RESULT_MEDIA_STATUS_ABNORMAL = IMAGE_RESULT_BASE + 38,
IMAGE_RESULT_MEDIA_VALUE_INVALID = IMAGE_RESULT_BASE + 39,
IMAGE_RESULT_MEDIA_NULL_POINTER = IMAGE_RESULT_BASE + 40,
IMAGE_RESULT_MEDIA_INVALID_OPERATION = IMAGE_RESULT_BASE + 41,
IMAGE_RESULT_MEDIA_ERR_PLAYER_NOT_INIT = IMAGE_RESULT_BASE + 42,
IMAGE_RESULT_MEDIA_EARLY_PREPARE = IMAGE_RESULT_BASE + 43,
IMAGE_RESULT_MEDIA_SEEK_ERR = IMAGE_RESULT_BASE + 44,
IMAGE_RESULT_MEDIA_PERMISSION_DENIED = IMAGE_RESULT_BASE + 45,
IMAGE_RESULT_MEDIA_DEAD_OBJECT = IMAGE_RESULT_BASE + 46,
IMAGE_RESULT_MEDIA_TIMED_OUT = IMAGE_RESULT_BASE + 47,
IMAGE_RESULT_MEDIA_TRACK_NOT_ALL_SUPPORTED = IMAGE_RESULT_BASE + 48,
IMAGE_RESULT_MEDIA_ADAPTER_INIT_FAILED = IMAGE_RESULT_BASE + 49,
IMAGE_RESULT_MEDIA_WRITE_PARCEL_FAIL = IMAGE_RESULT_BASE + 50,
IMAGE_RESULT_MEDIA_READ_PARCEL_FAIL = IMAGE_RESULT_BASE + 51,
IMAGE_RESULT_MEDIA_NO_AVAIL_BUFFER = IMAGE_RESULT_BASE + 52,
IMAGE_RESULT_MEDIA_INVALID_PARAM = IMAGE_RESULT_BASE + 53, IMAGE_RESULT_MEDIA_CODEC_ADAPTER_NOT_EXIST = IMAGE_RESULT_BASE + 54,
IMAGE_RESULT_MEDIA_CREATE_CODEC_ADAPTER_FAILED = IMAGE_RESULT_BASE + 55,
IMAGE_RESULT_MEDIA_CODEC_ADAPTER_NOT_INIT = IMAGE_RESULT_BASE + 56,
IMAGE_RESULT_MEDIA_ZCODEC_CREATE_FAILED = IMAGE_RESULT_BASE + 57,
IMAGE_RESULT_MEDIA_ZCODEC_NOT_EXIST = IMAGE_RESULT_BASE + 58,
IMAGE_RESULT_MEDIA_JNI_CLASS_NOT_EXIST = IMAGE_RESULT_BASE + 59,
IMAGE_RESULT_MEDIA_JNI_METHOD_NOT_EXIST = IMAGE_RESULT_BASE + 60,
IMAGE_RESULT_MEDIA_JNI_NEW_OBJ_FAILED = IMAGE_RESULT_BASE + 61,
IMAGE_RESULT_MEDIA_JNI_COMMON_ERROR = IMAGE_RESULT_BASE + 62,
IMAGE_RESULT_MEDIA_DISTRIBUTE_NOT_SUPPORT = IMAGE_RESULT_BASE + 63,
IMAGE_RESULT_MEDIA_SOURCE_NOT_SET = IMAGE_RESULT_BASE + 64,
IMAGE_RESULT_MEDIA_RTSP_ADAPTER_NOT_INIT = IMAGE_RESULT_BASE + 65,
IMAGE_RESULT_MEDIA_RTSP_ADAPTER_NOT_EXIST = IMAGE_RESULT_BASE + 66,
IMAGE_RESULT_MEDIA_RTSP_SURFACE_UNSUPPORT = IMAGE_RESULT_BASE + 67,
IMAGE_RESULT_MEDIA_RTSP_CAPTURE_NOT_INIT = IMAGE_RESULT_BASE + 68,
IMAGE_RESULT_MEDIA_RTSP_SOURCE_URL_INVALID = IMAGE_RESULT_BASE + 69,
IMAGE_RESULT_MEDIA_RTSP_VIDEO_TRACK_NOT_FOUND = IMAGE_RESULT_BASE + 70,
IMAGE_RESULT_MEDIA_RTSP_CAMERA_NUM_REACH_MAX = IMAGE_RESULT_BASE + 71,
IMAGE_RESULT_MEDIA_SET_VOLUME = IMAGE_RESULT_BASE + 72,
IMAGE_RESULT_MEDIA_NUMBER_OVERFLOW = IMAGE_RESULT_BASE + 73,
IMAGE_RESULT_MEDIA_DIS_PLAYER_UNSUPPORTED = IMAGE_RESULT_BASE + 74,
IMAGE_RESULT_MEDIA_DENCODE_ICC_FAILED = IMAGE_RESULT_BASE + 75,
IMAGE_RESULT_MEDIA_ENCODE_ICC_FAILED = IMAGE_RESULT_BASE + 76,
IMAGE_RESULT_MEDIA_READ_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 150,
IMAGE_RESULT_MEDIA_WRITE_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 151,
IMAGE_RESULT_MEDIA_PIXELMAP_NOT_ALLOW_MODIFY = IMAGE_RESULT_BASE + 152,
IMAGE_RESULT_MEDIA_CONFIG_FAILED = IMAGE_RESULT_BASE + 153,
IMAGE_RESULT_JNI_ENV_ABNORMAL = IMAGE_RESULT_BASE + 154,
IMAGE_RESULT_SURFACE_GRALLOC_BUFFER_FAILED = IMAGE_RESULT_BASE + 155,
IMAGE_RESULT_CREATE_SURFACE_FAILED = IMAGE_RESULT_BASE + 156,
IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILED = IMAGE_RESULT_BASE + 157,
IMAGE_RESULT_GET_SURFACE_FAILED = IMAGE_RESULT_BASE + 158,
IMAGE_RESULT_SURFACE_ACQUIRE_BUFFER_FAILED = IMAGE_RESULT_BASE + 159,
IMAGE_RESULT_SURFACE_REQUEST_BUFFER_FAILED = IMAGE_RESULT_BASE + 160,
IMAGE_RESULT_REGISTER_LISTENER_FAILED = IMAGE_RESULT_BASE + 161,
IMAGE_RESULT_REGISTER_BUFFER_FAILED = IMAGE_RESULT_BASE + 162,
IMAGE_RESULT_FREAD_FAILED = IMAGE_RESULT_BASE + 163,
IMAGE_RESULT_PEEK_FAILED = IMAGE_RESULT_BASE + 164,
IMAGE_RESULT_SEEK_FAILED = IMAGE_RESULT_BASE + 165,
IMAGE_RESULT_STREAM_SIZE_ERROR = IMAGE_RESULT_BASE + 166,
IMAGE_RESULT_FILE_FD_ERROR = IMAGE_RESULT_BASE + 167,
IMAGE_RESULT_FILE_DAMAGED = IMAGE_RESULT_BASE + 168,
IMAGE_RESULT_CREATE_DECODER_FAILED = IMAGE_RESULT_BASE + 169,
IMAGE_RESULT_CREATE_ENCODER_FAILED = IMAGE_RESULT_BASE + 170,
IMAGE_RESULT_CHECK_FORMAT_ERROR = IMAGE_RESULT_BASE + 171,
IMAGE_RESULT_THIRDPART_SKIA_ERROR = IMAGE_RESULT_BASE + 172,
IMAGE_RESULT_HW_DECODE_FAILED = IMAGE_RESULT_BASE + 173,
IMAGE_RESULT_ALLOCATER_TYPE_ERROR = IMAGE_RESULT_BASE + 174,
IMAGE_RESULT_ALPHA_TYPE_ERROR = IMAGE_RESULT_BASE + 175,
IMAGE_RESULT_INDEX_INVALID = IMAGE_RESULT_BASE + 176,
IMAGE_RESULT_MEDIA_UNKNOWN = IMAGE_RESULT_BASE + 200
}
Enumerates the return values that may be used by the interface.
{ OHOS_PIXEL_MAP_ALPHA_TYPE_UNKNOWN = 0,
OHOS_PIXEL_MAP_ALPHA_TYPE_OPAQUE = 1,
OHOS_PIXEL_MAP_ALPHA_TYPE_PREMUL = 2,
OHOS_PIXEL_MAP_ALPHA_TYPE_UNPREMUL = 3 }
Enumerates the pixel map alpha types.
{ OHOS_PIXEL_MAP_READ_ONLY = 0,
OHOS_PIXEL_MAP_EDITABLE = 1 }
Enumerates the pixel map editing types.
{ OHOS::Media::OHOS_IMAGE_RESULT_SUCCESS = 0,
OHOS::Media::OHOS_IMAGE_RESULT_BAD_PARAMETER = -1 }
Enumerates the error codes returned by the functions.
{ OHOS::Media::OHOS_PIXEL_MAP_FORMAT_NONE = 0,
OHOS::Media::OHOS_PIXEL_MAP_FORMAT_RGBA_8888 = 3,
OHOS::Media::OHOS_PIXEL_MAP_FORMAT_RGB_565 = 2 }
Enumerates the pixel map formats.
{ OHOS::Media::OHOS_PIXEL_MAP_SCALE_MODE_FIT_TARGET_SIZE = 0,
OHOS::Media::OHOS_PIXEL_MAP_SCALE_MODE_CENTER_CROP = 1 }
Enumerates the pixel map scale modes.

Functions

NameDescription
OH_Image_InitImageNative (napi_env env, napi_value source)Parses an ImageNative object from an Image object at the JavaScript native layer.
OH_Image_ClipRect (const ImageNative *native, struct OhosImageRect *rect)Obtains OhosImageRect of an ImageNative object.
OH_Image_Size (const ImageNative *native, struct OhosImageSize *size)Obtains OhosImageSize of an ImageNative object.
OH_Image_Format (const ImageNative *native, int32_t *format)Obtains the image format of an ImageNative object.
OH_Image_GetComponent (const ImageNative *native, int32_t componentType, struct OhosImageComponent *componentNative)Obtains OhosImageComponent of an ImageNative object.
OH_Image_Release (ImageNative *native)Releases an ImageNative object.
OH_PixelMap_CreatePixelMap (napi_env env, OhosPixelMapCreateOps info, void *buf, size_t len, napi_value *res)Creates a PixelMap object.
OH_PixelMap_CreateAlphaPixelMap (napi_env env, napi_value source, napi_value *alpha)Creates a PixelMap object that contains only alpha channel information.
OH_PixelMap_InitNativePixelMap (napi_env env, napi_value source)Initializes a PixelMap object.
OH_PixelMap_GetBytesNumberPerRow (const NativePixelMap *native, int32_t *num)Obtains the number of bytes per row of a NativePixelMap object.
OH_PixelMap_GetIsEditable (const NativePixelMap *native, int32_t *editable)Checks whether a NativePixelMap object is editable.
OH_PixelMap_IsSupportAlpha (const NativePixelMap *native, int32_t *alpha)Checks whether a NativePixelMap object supports alpha channels.
OH_PixelMap_SetAlphaAble (const NativePixelMap *native, int32_t alpha)Sets an alpha channel for a NativePixelMap object.
OH_PixelMap_GetDensity (const NativePixelMap *native, int32_t *density)Obtains the pixel density of a NativePixelMap object.
OH_PixelMap_SetDensity (const NativePixelMap *native, int32_t density)Sets the pixel density for a NativePixelMap object.
OH_PixelMap_SetOpacity (const NativePixelMap *native, float opacity)Sets the opacity for a NativePixelMap object.
OH_PixelMap_Scale (const NativePixelMap *native, float x, float y)Scales a NativePixelMap object.
OH_PixelMap_Translate (const NativePixelMap *native, float x, float y)Translates a NativePixelMap object.
OH_PixelMap_Rotate (const NativePixelMap *native, float angle)Rotates a NativePixelMap object.
OH_PixelMap_Flip (const NativePixelMap *native, int32_t x, int32_t y)Flips a NativePixelMap object.
OH_PixelMap_Crop (const NativePixelMap *native, int32_t x, int32_t y, int32_t width, int32_t height)Crops a NativePixelMap object.
OH_PixelMap_GetImageInfo (const NativePixelMap *native, OhosPixelMapInfos *info)Obtains the image information of a NativePixelMap object.
OH_PixelMap_AccessPixels (const NativePixelMap *native, void **addr)Obtains the memory address of a NativePixelMap object and locks the memory.
OH_PixelMap_UnAccessPixels (const NativePixelMap *native)Unlocks the memory of a NativePixelMap object. This function is used with OH_PixelMap_AccessPixels in pairs.
OHOS::Media::OH_GetImageInfo (napi_env env, napi_value value, OhosPixelMapInfo *info)Obtains the information about a PixelMap object and stores the information to the OhosPixelMapInfo struct.
OHOS::Media::OH_AccessPixels (napi_env env, napi_value value, void **addrPtr)Obtains the memory address of a PixelMap object and locks the memory.
OHOS::Media::OH_UnAccessPixels (napi_env env, napi_value value)Unlocks the memory of a PixelMap object. This function is used with OH_AccessPixels in pairs.
OH_Image_Receiver_CreateImageReceiver (napi_env env, struct OhosImageReceiverInfo info, napi_value *res)Creates an ImageReceiver object at the application layer.
OH_Image_Receiver_InitImageReceiverNative (napi_env env, napi_value source)Initializes an ImageReceiverNative object through an ImageReceiver object.
OH_Image_Receiver_GetReceivingSurfaceId (const ImageReceiverNative *native, char *id, size_t len)Obtains the receiver ID through an ImageReceiverNative object.
OH_Image_Receiver_ReadLatestImage (const ImageReceiverNative *native, napi_value *image)Obtains the latest image through an ImageReceiverNative object.
OH_Image_Receiver_ReadNextImage (const ImageReceiverNative *native, napi_value *image)Obtains the next image through an ImageReceiverNative object.
OH_Image_Receiver_On (const ImageReceiverNative *native, OH_Image_Receiver_On_Callback callback)Registers an OH_Image_Receiver_On_Callback callback. This callback is triggered whenever a new image is received.
OH_Image_Receiver_GetSize (const ImageReceiverNative *native, struct OhosImageSize *size)Obtains the size of the image receiver through an ImageReceiverNative object.
OH_Image_Receiver_GetCapacity (const ImageReceiverNative *native, int32_t *capacity)Obtains the capacity of the image receiver through an ImageReceiverNative object.
OH_Image_Receiver_GetFormat (const ImageReceiverNative *native, int32_t *format)Obtains the format of the image receiver through an ImageReceiverNative object.
OH_Image_Receiver_Release (ImageReceiverNative *native)Releases an ImageReceiverNative object. Note: This function is not used to release an ImageReceiver object.
OH_ImageSource_Create (napi_env env, struct OhosImageSource *src, struct OhosImageSourceOps *ops, napi_value *res)Creates an ImageSource object at the JavaScript native layer based on the specified OhosImageSource and OhosImageSourceOps structs.
OH_ImageSource_CreateIncremental (napi_env env, struct OhosImageSource *source, struct OhosImageSourceOps *ops, napi_value *res)Creates an ImageSource object at the JavaScript native layer based on the specified OhosImageSource and OhosImageSourceOps structs. The image source data will be updated through OH_ImageSource_UpdateData.
OH_ImageSource_GetSupportedFormats (struct OhosImageSourceSupportedFormatList *res)Obtains all supported decoding formats.
OH_ImageSource_InitNative (napi_env env, napi_value source)Converts an ImageSource object at the JavaScript native layer to an ImageSourceNative object.
OH_ImageSource_CreatePixelMap (const ImageSourceNative *native, struct OhosImageDecodingOps *ops, napi_value *res)Decodes an ImageSourceNative object to obtain a PixelMap object at the JavaScript native layer based on the specified OhosImageDecodingOps struct.
OH_ImageSource_CreatePixelMapList (const ImageSourceNative *native, struct OhosImageDecodingOps *ops, napi_value *res)Decodes an ImageSourceNative object to obtain all PixelMap objects at the JavaScript native layer based on the specified OhosImageDecodingOps struct.
OH_ImageSource_GetDelayTime (const ImageSourceNative *native, struct OhosImageSourceDelayTimeList *res)Obtains the delay time list from an ImageSourceNative object (such as GIF image source).
OH_ImageSource_GetFrameCount (const ImageSourceNative *native, uint32_t *res)Obtains the number of frames from an ImageSourceNative object.
OH_ImageSource_GetImageInfo (const ImageSourceNative *native, int32_t index, struct OhosImageSourceInfo *info)Obtains image source information from an ImageSourceNative object by index.
OH_ImageSource_GetImageProperty (const ImageSourceNative *native, struct OhosImageSourceProperty *key, struct OhosImageSourceProperty *value)Obtains the value of an image property from an ImageSourceNative object.
OH_ImageSource_ModifyImageProperty (const ImageSourceNative *native, struct OhosImageSourceProperty *key, struct OhosImageSourceProperty *value)Modifies the value of an image property of an ImageSourceNative object.
OH_ImageSource_UpdateData (const ImageSourceNative *native, struct OhosImageSourceUpdateData *data)Updates the data of an ImageSourceNative object.
OH_ImageSource_Release (ImageSourceNative *native)Releases an ImageSourceNative object.

Variables

NameDescription
OHOS_IMAGE_PROPERTY_BITS_PER_SAMPLE = "BitsPerSample"Defines a pointer to bits per sample, one of the image properties.
OHOS_IMAGE_PROPERTY_ORIENTATION = "Orientation"Defines a pointer to the orientation, one of the image properties.
OHOS_IMAGE_PROPERTY_IMAGE_LENGTH = "ImageLength"Defines a pointer to the image length, one of the image properties.
OHOS_IMAGE_PROPERTY_IMAGE_WIDTH = "ImageWidth"Defines a pointer to the image width, one of the image properties.
OHOS_IMAGE_PROPERTY_GPS_LATITUDE = "GPSLatitude"Defines a pointer to the GPS latitude, one of the image properties.
OHOS_IMAGE_PROPERTY_GPS_LONGITUDE = "GPSLongitude"Defines a pointer to the GPS longitude, one of the image properties.
OHOS_IMAGE_PROPERTY_GPS_LATITUDE_REF = "GPSLatitudeRef"Defines a pointer to the GPS latitude reference information, one of the image properties.
OHOS_IMAGE_PROPERTY_GPS_LONGITUDE_REF = "GPSLongitudeRef"Defines a pointer to the GPS longitude reference information, one of the image properties.
OHOS_IMAGE_PROPERTY_DATE_TIME_ORIGINAL = "DateTimeOriginal"Defines a pointer to the created date and time, one of the image properties.
OHOS_IMAGE_PROPERTY_EXPOSURE_TIME = "ExposureTime"Defines a pointer to the exposure time, one of the image properties.
OHOS_IMAGE_PROPERTY_SCENE_TYPE = "SceneType"Defines a pointer to the scene type, one of the image properties.
OHOS_IMAGE_PROPERTY_ISO_SPEED_RATINGS = "ISOSpeedRatings"Defines a pointer to the ISO speed ratings, one of the image properties.
OHOS_IMAGE_PROPERTY_F_NUMBER = "FNumber"Defines a pointer to the f-number of the image, one of the image properties.
OHOS_IMAGE_PROPERTY_COMPRESSED_BITS_PER_PIXEL = "CompressedBitsPerPixel"Defines a pointer to the compressed bits per pixel, one of the image properties.
OhosImageRegion::xDefines the X coordinate of the start point, in pixels.
OhosImageRegion::yDefines the Y coordinate of the start point, in pixels.
OhosImageRegion::widthDefines the width of the region, in pixels.
OhosImageRegion::heightDefines the height of the region, in pixels.
OhosImageSourceOps::densityDefines the pixel density of the image source.
OhosImageSourceOps::pixelFormatDefines the pixel format of the image source. It is usually used to describe the YUV buffer.
OhosImageSourceOps::sizeDefines the pixel width and height of the image source.
OhosImageDecodingOps::editableDefines whether the output pixel map is editable.
OhosImageDecodingOps::pixelFormatDefines the pixel format of the output pixel map.
OhosImageDecodingOps::fitDensityDefines the pixel density of the output pixel map.
OhosImageDecodingOps::indexDefines the index of the output pixel map.
OhosImageDecodingOps::sampleSizeDefines the size of the sample.
OhosImageDecodingOps::rotateDefines the decoding rotation option.
OhosImageDecodingOps::sizeDefines the pixel width and height of the output pixel map.
OhosImageDecodingOps::regionDefines the region of the output pixel map.
OhosImageSourceInfo::pixelFormatDefines the pixel format of the image source. It is set in OH_ImageSource_Create.
OhosImageSourceInfo::colorSpaceDefines the color space of the image source.
OhosImageSourceInfo::alphaTypeDefines the alpha type of the image source.
OhosImageSourceInfo::densityDefines the image density of the image source. It is set in OH_ImageSource_Create.
OhosImageSourceInfo::sizeDefines the pixel width and height of the image source.
OhosImageSource::uri = nullptrDefines a pointer to the image source URI. Only a file URI or Base64 URI is accepted.
OhosImageSource::uriSize = 0Defines the length of the image source URI.
OhosImageSource::fd = -1Defines the descriptor of the image source.
OhosImageSource::buffer = nullptrDefines a pointer to the image source buffer. Only a formatted packet buffer or Base64 buffer is accepted.
OhosImageSource::bufferSize = 0Defines the size of the image source buffer.
OhosImageSourceDelayTimeList::delayTimeListDefines a pointer to the head of the image source delay time list.
OhosImageSourceDelayTimeList::size = 0Defines the size of the image source delay time list.
OhosImageSourceSupportedFormat::format = nullptrDefines a pointer to the head of the format string.
OhosImageSourceSupportedFormat::size = 0Defines the size of the format string.
OhosImageSourceSupportedFormatList::supportedFormatList = nullptrDefines a double pointer to the head of the format string list.
OhosImageSourceSupportedFormatList::size = 0Defines the size of the format string list.
OhosImageSourceProperty::value = nullptrDefines a pointer to the head of the property string.
OhosImageSourceProperty::size = 0Defines the size of the property string.
OhosImageSourceUpdateData::buffer = nullptrDefines a pointer to the buffer for storing the update data.
OhosImageSourceUpdateData::bufferSize = 0Defines the size of the buffer.
OhosImageSourceUpdateData::offset = 0Defines the offset of the update data in the buffer.
OhosImageSourceUpdateData::updateLength = 0Defines the length of the update data in the buffer.
OhosImageSourceUpdateData::isCompleted = 0Defines whether the image source data update is completed.

Type Description

ImageNative

typedef struct ImageNative_ ImageNative

Description

Defines an image object at the native layer.

Since

10

ImageReceiverNative

typedef struct ImageReceiverNative_ ImageReceiverNative

Description

Defines the data type name of the image receiver at the native layer.

Since

10

ImageSourceNative

typedef struct ImageSourceNative_ ImageSourceNative

Description

Defines an image source object at the native layer.

@Syscap SystemCapability.Multimedia.Image

Since

10

NativePixelMap

typedef struct NativePixelMap_ NativePixelMap

Description

Defines the data type name of the pixel map at the native layer.

Since

10

OH_Image_Receiver_On_Callback

typedef void(* OH_Image_Receiver_On_Callback) ()

Description

Defines the callbacks for the image interface at the native layer.

Since

10

OhosPixelMapInfos

typedef struct OhosPixelMapInfosOhosPixelMapInfos

Description

Defines the information about a pixel map.

Since

10

Enum Description

anonymous enum [1/3]

anonymous enum

Description

Enumerates the image formats.

Since

10

ValueDescription
OHOS_IMAGE_FORMAT_YCBCR_422_SPYCbCr422 semi-planar format.
OHOS_IMAGE_FORMAT_JPEGJPEG encoding format.

anonymous enum [2/3]

anonymous enum

Description

Enumerates the pixel map alpha types.

Since

10

ValueDescription
OHOS_PIXEL_MAP_ALPHA_TYPE_UNKNOWNUnknown format.
OHOS_PIXEL_MAP_ALPHA_TYPE_OPAQUEOpaque format.
OHOS_PIXEL_MAP_ALPHA_TYPE_PREMULPremultiplied format.
OHOS_PIXEL_MAP_ALPHA_TYPE_UNPREMULUnpremultiplied format.

anonymous enum [3/3]

anonymous enum

Description

Enumerates the error codes returned by the functions.

Since

8

Deprecated from

10

ValueDescription
OHOS_IMAGE_RESULT_SUCCESSOperation success.
OHOS_IMAGE_RESULT_BAD_PARAMETERInvalid parameter.

anonymous enum [1/3]

anonymous enum

Description

Enumerates the image components.

Since

10

ValueDescription
OHOS_IMAGE_COMPONENT_FORMAT_YUV_YLuminance component.
OHOS_IMAGE_COMPONENT_FORMAT_YUV_UChrominance component - blue projection.
OHOS_IMAGE_COMPONENT_FORMAT_YUV_VChrominance component - red projection.
OHOS_IMAGE_COMPONENT_FORMAT_JPEGJPEG format.

anonymous enum [2/3]

anonymous enum

Description

Enumerates the pixel map editing types.

Since

10

ValueDescription
OHOS_PIXEL_MAP_READ_ONLYRead-only.
OHOS_PIXEL_MAP_EDITABLEEditable.

anonymous enum [3/3]

anonymous enum

Description

Enumerates the pixel map formats.

Since

8

Deprecated from

10

ValueDescription
OHOS_PIXEL_MAP_FORMAT_NONEUnknown format.
OHOS_PIXEL_MAP_FORMAT_RGBA_888832-bit RGBA, with 8 bits each for R (red), G (green), B (blue), and A (alpha). The data is stored from the most significant bit to the least significant bit.
OHOS_PIXEL_MAP_FORMAT_RGB_56516-bit RGB, with 5, 6, and 5 bits for R, G, and B, respectively. The storage sequence is from the most significant bit to the least significant bit.

anonymous enum

anonymous enum

Description

Enumerates the pixel map scale modes.

Since

10

ValueDescription
OHOS_PIXEL_MAP_SCALE_MODE_FIT_TARGET_SIZEAdapting to the target image size.
OHOS_PIXEL_MAP_SCALE_MODE_CENTER_CROPCropping the center portion of an image to the target size.

IRNdkErrCode

enum IRNdkErrCode

Description

Enumerates the return values that may be used by the interface.

Since

10

ValueDescription
IMAGE_RESULT_SUCCESSOperation success.
IMAGE_RESULT_BAD_PARAMETERInvalid parameter.
IMAGE_RESULT_IMAGE_RESULT_BASEOperation failed.
IMAGE_RESULT_ERR_IPCIPC error.
IMAGE_RESULT_ERR_SHAMEM_NOT_EXISTFailed to share the memory.
IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMALAbnormal data in the shared memory.
IMAGE_RESULT_DECODE_ABNORMALFailed to decode the image.
IMAGE_RESULT_DATA_ABNORMALAbnormal input data.
IMAGE_RESULT_MALLOC_ABNORMALan error occurs during memory allocation.
IMAGE_RESULT_DATA_UNSUPPORTThe image type is not supported.
IMAGE_RESULT_INIT_ABNORMALFailed to initialize the image.
IMAGE_RESULT_GET_DATA_ABNORMALAn error occurs during image data retrieval.
IMAGE_RESULT_TOO_LARGEThe image is too large.
IMAGE_RESULT_TRANSFORMAn error occurs during image transformation.
IMAGE_RESULT_COLOR_CONVERTAn error occurs during image color conversion.
IMAGE_RESULT_CROPAn error occurs during image cropping.
IMAGE_RESULT_SOURCE_DATAThe image source data is incorrect.
IMAGE_RESULT_SOURCE_DATA_INCOMPLETEThe image source data is incomplete.
IMAGE_RESULT_MISMATCHED_FORMATThe image format does not match.
IMAGE_RESULT_UNKNOWN_FORMATUnknown image format.
IMAGE_RESULT_SOURCE_UNRESOLVEDThe image source is not parsed.
IMAGE_RESULT_INVALID_PARAMETERInvalid image parameter.
IMAGE_RESULT_DECODE_FAILEDFailed to decode the image.
IMAGE_RESULT_PLUGIN_REGISTER_FAILEDFailed to register the plug-in.
IMAGE_RESULT_PLUGIN_CREATE_FAILEDFailed to create the plug-in.
IMAGE_RESULT_ENCODE_FAILEDFailed to encode the image.
IMAGE_RESULT_ADD_PIXEL_MAP_FAILEDFailed to add the pixel map.
IMAGE_RESULT_HW_DECODE_UNSUPPORTHardware decoding is not supported.
IMAGE_RESULT_DECODE_HEAD_ABNORMALFailed to decode the image header.
IMAGE_RESULT_DECODE_EXIF_UNSUPPORTExchangeable Image File (EXIF) is not supported for image decoding.
IMAGE_RESULT_PROPERTY_NOT_EXISTThe image property does not exist.
IMAGE_RESULT_MEDIA_DATA_UNSUPPORTThe media type is not supported.
IMAGE_RESULT_MEDIA_TOO_LARGEThe media is too large.
IMAGE_RESULT_MEDIA_MALLOC_FAILEDMemory allocation failed.
IMAGE_RESULT_MEDIA_END_OF_STREAMFailed to end the media data stream.
IMAGE_RESULT_MEDIA_IO_ABNORMALAbnormal input and output streams.
IMAGE_RESULT_MEDIA_MALFORMEDThe media service functions abnormally.
IMAGE_RESULT_MEDIA_BUFFER_TOO_SMALLThe media data is too small.
IMAGE_RESULT_MEDIA_OUT_OF_RANGEThe media is out of range.
IMAGE_RESULT_MEDIA_STATUS_ABNORMALAbnormal media status.
IMAGE_RESULT_MEDIA_VALUE_INVALIDInvalid media value.
IMAGE_RESULT_MEDIA_NULL_POINTERMedia operation failed.
IMAGE_RESULT_MEDIA_INVALID_OPERATIONInvalid media operation.
IMAGE_RESULT_MEDIA_ERR_PLAYER_NOT_INITan error occurs during media initialization.
IMAGE_RESULT_MEDIA_EARLY_PREPAREMedia preprocessing is carried out too early.
IMAGE_RESULT_MEDIA_SEEK_ERRThe seek operation failed.
IMAGE_RESULT_MEDIA_PERMISSION_DENIEDPermission denied.
IMAGE_RESULT_MEDIA_DEAD_OBJECTThe media object is deregistered.
IMAGE_RESULT_MEDIA_TIMED_OUTA timeout occurs.
IMAGE_RESULT_MEDIA_TRACK_NOT_ALL_SUPPORTEDThe media capability is not supported.
IMAGE_RESULT_MEDIA_ADAPTER_INIT_FAILEDFailed to initialize the media adapter.
IMAGE_RESULT_MEDIA_WRITE_PARCEL_FAILFailed to write data to the parcel.
IMAGE_RESULT_MEDIA_READ_PARCEL_FAILFailed to read data from the parcel.
IMAGE_RESULT_MEDIA_NO_AVAIL_BUFFERInvalid data.
IMAGE_RESULT_MEDIA_INVALID_PARAMInvalid parameters.
IMAGE_RESULT_MEDIA_CODEC_ADAPTER_NOT_EXISTThe media codec adapter does not exist.
IMAGE_RESULT_MEDIA_CREATE_CODEC_ADAPTER_FAILEDFailed to create the media codec adapter.
IMAGE_RESULT_MEDIA_CODEC_ADAPTER_NOT_INITThe media codec adapter is not initialized.
IMAGE_RESULT_MEDIA_ZCODEC_CREATE_FAILEDFailed to create the media codec.
IMAGE_RESULT_MEDIA_ZCODEC_NOT_EXISTThe media codec does not exist.
IMAGE_RESULT_MEDIA_JNI_CLASS_NOT_EXISTThe media JNI layer class does not exist.
IMAGE_RESULT_MEDIA_JNI_METHOD_NOT_EXISTThe media JNI layer method does not exist.
IMAGE_RESULT_MEDIA_JNI_NEW_OBJ_FAILEDFailed to create the object at the media JNI layer.
IMAGE_RESULT_MEDIA_JNI_COMMON_ERRORThe media JNI layer is abnormal.
IMAGE_RESULT_MEDIA_DISTRIBUTE_NOT_SUPPORTThe distributed feature is not supported.
IMAGE_RESULT_MEDIA_SOURCE_NOT_SETThe media source is not set.
IMAGE_RESULT_MEDIA_RTSP_ADAPTER_NOT_INITThe media RTSP adapter is not initialized.
IMAGE_RESULT_MEDIA_RTSP_ADAPTER_NOT_EXISTThe media RTSP adapter does not exist.
IMAGE_RESULT_MEDIA_RTSP_SURFACE_UNSUPPORTThe media does not support the RTSP surface.
IMAGE_RESULT_MEDIA_RTSP_CAPTURE_NOT_INITFailed to initialize the media RTSP capturer.
IMAGE_RESULT_MEDIA_RTSP_SOURCE_URL_INVALIDInvalid media RTSP source path.
IMAGE_RESULT_MEDIA_RTSP_VIDEO_TRACK_NOT_FOUNDNo video capability is found in the media RTSP.
IMAGE_RESULT_MEDIA_RTSP_CAMERA_NUM_REACH_MAXThe maximum number of RTSP cameras has been reached.
IMAGE_RESULT_MEDIA_SET_VOLUMEFailed to set the volume.
IMAGE_RESULT_MEDIA_NUMBER_OVERFLOWThe number of operations overflows.
IMAGE_RESULT_MEDIA_DIS_PLAYER_UNSUPPORTEDThe distributed media player is not supported.
IMAGE_RESULT_MEDIA_DENCODE_ICC_FAILEDFailed to decode the ICC.
IMAGE_RESULT_MEDIA_ENCODE_ICC_FAILEDFailed to encode the ICC.
IMAGE_RESULT_MEDIA_READ_PIXELMAP_FAILEDFailed to read the pixel map.
IMAGE_RESULT_MEDIA_WRITE_PIXELMAP_FAILEDFailed to write the pixel map.
IMAGE_RESULT_MEDIA_PIXELMAP_NOT_ALLOW_MODIFYThe pixel map cannot be modified.
IMAGE_RESULT_MEDIA_CONFIG_FAILEDConfiguration failed.
IMAGE_RESULT_JNI_ENV_ABNORMALThe JNI environment is abnormal.
IMAGE_RESULT_SURFACE_GRALLOC_BUFFER_FAILEDFailed to allocate memory for the surface.
IMAGE_RESULT_CREATE_SURFACE_FAILEDFailed to create the surface.
IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILEDFailed to obtain parameters from the surface.
IMAGE_RESULT_GET_SURFACE_FAILEDFailed to obtain the surface.
IMAGE_RESULT_SURFACE_ACQUIRE_BUFFER_FAILEDFailed to apply for a buffer.
IMAGE_RESULT_SURFACE_REQUEST_BUFFER_FAILEDFailed to request a buffer.
IMAGE_RESULT_REGISTER_LISTENER_FAILEDFailed to register the listener.
IMAGE_RESULT_REGISTER_BUFFER_FAILEDFailed to register the buffer.
IMAGE_RESULT_FREAD_FAILEDFailed to read the file.
IMAGE_RESULT_PEEK_FAILEDFailed to peek the file.
IMAGE_RESULT_SEEK_FAILEDFailed to seek the file.
IMAGE_RESULT_STREAM_SIZE_ERRORThe data stream is damaged.
IMAGE_RESULT_FILE_FD_ERRORThe file descriptor is damaged.
IMAGE_RESULT_FILE_DAMAGEDThe file is damaged.
IMAGE_RESULT_CREATE_DECODER_FAILEDFailed to create a decoder.
IMAGE_RESULT_CREATE_ENCODER_FAILEDFailed to create an encoder.
IMAGE_RESULT_CHECK_FORMAT_ERRORFailed to check the format.
IMAGE_RESULT_THIRDPART_SKIA_ERRORSkia decoding failed.
IMAGE_RESULT_HW_DECODE_FAILEDHardware decoding failed.
IMAGE_RESULT_ALLOCATER_TYPE_ERRORFailed to verify the memory type.
IMAGE_RESULT_ALPHA_TYPE_ERRORFailed to verify the alpha type.
IMAGE_RESULT_INDEX_INVALIDInvalid parameter.
IMAGE_RESULT_MEDIA_UNKNOWNUnknown error.

Function Description

OH_AccessPixels()

int32_t OHOS::Media::OH_AccessPixels (napi_env env, napi_value value, void ** addrPtr )

Description

Obtains the memory address of a PixelMap object and locks the memory.

*addrPtr is the memory address obtained. After finishing the access, you must use OH_UnAccessPixels to unlock the memory. Then the memory cannot be accessed or operated.

Parameters

NameDescription
envPointer to the NAPI environment.
valuePixelMap object at the application layer.
addrPtrDouble pointer to the memory address.

Returns

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful; returns an error code otherwise.

Since

8

Deprecated from

10

See

UnAccessPixels

OH_GetImageInfo()

int32_t OHOS::Media::OH_GetImageInfo (napi_env env, napi_value value, OhosPixelMapInfo * info )

Description

Obtains the information about a PixelMap object and stores the information to the OhosPixelMapInfo struct.

Parameters

NameDescription
envPointer to the NAPI environment.
valuePixelMap object at the application layer.
infoPointer to the object that stores the information obtained. For details, see OhosPixelMapInfo.

Returns

Returns 0 if the information is obtained and stored successfully; returns an error code otherwise.

Since

8

Deprecated from

10

See

OhosPixelMapInfo

OH_Image_ClipRect()

int32_t OH_Image_ClipRect (const ImageNative * native, struct OhosImageRect * rect )

Description

Obtains OhosImageRect of an ImageNative object.

Parameters

NameDescription
nativePointer to an ImageNative object.
rectPointer to the OhosImageRect object obtained.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILED if parameters fail to be obtained from the surface.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Since

10

See

ImageNative, OhosImageRect

OH_Image_Format()

int32_t OH_Image_Format (const ImageNative * native, int32_t * format )

Description

Obtains the image format of an ImageNative object.

Parameters

NameDescription
nativePointer to an ImageNative object.
formatPointer to the image format obtained.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILED if parameters fail to be obtained from the surface.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Since

10

See

ImageNative

OH_Image_GetComponent()

int32_t OH_Image_GetComponent (const ImageNative * native, int32_t componentType, struct OhosImageComponent * componentNative )

Description

Obtains OhosImageComponent of an ImageNative object.

Parameters

NameDescription
nativePointer to an ImageNative object.
componentTypeType of the component.
componentNativePointer to the OhosImageComponent object obtained.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILED if parameters fail to be obtained from the surface.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Since

10

See

ImageNative, OhosImageComponent

OH_Image_InitImageNative()

ImageNative* OH_Image_InitImageNative (napi_env env, napi_value source )

Description

Parses an ImageNative object from an Image object at the JavaScript native layer.

Parameters

NameDescription
envPointer to the JNI environment.
sourceImage object at the JavaScript native layer.

Returns

Returns a pointer to the ImageNative object if the operation is successful; returns a null pointer otherwise.

Since

10

See

ImageNative, OH_Image_Release

OH_Image_Receiver_CreateImageReceiver()

int32_t OH_Image_Receiver_CreateImageReceiver (napi_env env, struct OhosImageReceiverInfo info, napi_value * res )

Description

Creates an ImageReceiver object at the application layer.

Parameters

NameDescription
envPointer to the NAPI environment.
infoOptions for setting the ImageReceiver object.
resPointer to the ImageReceiver object at the application layer.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_INVALID_PARAMETER if parameters fail to be obtained from the surface.

Returns IMAGE_RESULT_CREATE_SURFACE_FAILED if the surface fails to be created.

Returns IMAGE_RESULT_SURFACE_GRALLOC_BUFFER_FAILED if the buffer fails to be allocated to the surface.

Returns IMAGE_RESULT_GET_SURFACE_FAILED if the surface fails to be obtained.

Returns IMAGE_RESULT_MEDIA_RTSP_SURFACE_UNSUPPORT if the media RTSP surface is not supported.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_MEDIA_DATA_UNSUPPORT if the media type is not supported.

Since

10

See

OhosImageReceiverInfo

OH_Image_Receiver_GetCapacity()

int32_t OH_Image_Receiver_GetCapacity (const ImageReceiverNative * native, int32_t * capacity )

Description

Obtains the capacity of the image receiver through an ImageReceiverNative object.

Parameters

NameDescription
nativePointer to an ImageReceiverNative object.
capacityPointer to the capacity obtained.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Since

10

See

ImageReceiverNative, OhosImageSize

OH_Image_Receiver_GetFormat()

int32_t OH_Image_Receiver_GetFormat (const ImageReceiverNative * native, int32_t * format )

Description

Obtains the format of the image receiver through an ImageReceiverNative object.

Parameters

NameDescription
nativePointer to an ImageReceiverNative object.
formatPointer to the format obtained.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Since

10

See

ImageReceiverNative

OH_Image_Receiver_GetReceivingSurfaceId()

int32_t OH_Image_Receiver_GetReceivingSurfaceId (const ImageReceiverNative * native, char * id, size_t len )

Description

Obtains the receiver ID through an ImageReceiverNative object.

Parameters

NameDescription
nativePointer to an ImageReceiverNative object.
idPointer to the buffer that stores the ID string obtained.
lenSize of the buffer.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_INVALID_PARAMETER if parameters fail to be obtained from the surface.

Returns IMAGE_RESULT_GET_SURFACE_FAILED if the surface fails to be obtained.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_MEDIA_DATA_UNSUPPORT if the media type is not supported.

Since

10

See

ImageReceiverNative

OH_Image_Receiver_GetSize()

int32_t OH_Image_Receiver_GetSize (const ImageReceiverNative * native, struct OhosImageSize * size )

Description

Obtains the size of the image receiver through an ImageReceiverNative object.

Parameters

NameDescription
nativePointer to an ImageReceiverNative object.
sizePointer to the OhosImageSize object obtained.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Since

10

See

ImageReceiverNative, OH_Image_Receiver_On_Callback

OH_Image_Receiver_InitImageReceiverNative()

ImageReceiverNative* OH_Image_Receiver_InitImageReceiverNative (napi_env env, napi_value source )

Description

Initializes an ImageReceiverNative object through an ImageReceiver object.

Parameters

NameDescription
envPointer to the NAPI environment.
sourceImageReceiver object.

Returns

Returns a pointer to the ImageReceiverNative object obtained if the operation is successful; returns a null pointer otherwise.

Since

10

See

ImageReceiverNative, OH_Image_Receiver_Release

OH_Image_Receiver_On()

int32_t OH_Image_Receiver_On (const ImageReceiverNative * native, OH_Image_Receiver_On_Callback callback )

Description

Registers an OH_Image_Receiver_On_Callback callback. This callback is triggered whenever a new image is received.

Parameters

NameDescription
nativePointer to an ImageReceiverNative object.
callbackOH_Image_Receiver_On_Callback callback to register.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_INVALID_PARAMETER if parameters fail to be obtained from the surface.

Returns IMAGE_RESULT_GET_SURFACE_FAILED if the surface fails to be obtained.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_MEDIA_DATA_UNSUPPORT if the media type is not supported.

Since

10

See

ImageReceiverNative

OH_Image_Receiver_ReadLatestImage()

int32_t OH_Image_Receiver_ReadLatestImage (const ImageReceiverNative * native, napi_value * image )

Description

Obtains the latest image through an ImageReceiverNative object.

Parameters

NameDescription
nativePointer to an ImageReceiverNative object.
imagePointer to an Image object at the application layer.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_INVALID_PARAMETER if parameters fail to be obtained from the surface.

Returns IMAGE_RESULT_CREATE_SURFACE_FAILED if the surface fails to be created.

Returns IMAGE_RESULT_SURFACE_GRALLOC_BUFFER_FAILED if the buffer fails to be allocated to the surface.

Returns IMAGE_RESULT_GET_SURFACE_FAILED if the surface fails to be obtained.

Returns IMAGE_RESULT_MEDIA_RTSP_SURFACE_UNSUPPORT if the media RTSP surface is not supported.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_MEDIA_DATA_UNSUPPORT if the media type is not supported.

Since

10

See

ImageReceiverNative

OH_Image_Receiver_ReadNextImage()

int32_t OH_Image_Receiver_ReadNextImage (const ImageReceiverNative * native, napi_value * image )

Description

Obtains the next image through an ImageReceiverNative object.

Parameters

NameDescription
nativePointer to an ImageReceiverNative object.
imagePointer to an Image object at the application layer.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_INVALID_PARAMETER if parameters fail to be obtained from the surface.

Returns IMAGE_RESULT_CREATE_SURFACE_FAILED if the surface fails to be created.

Returns IMAGE_RESULT_SURFACE_GRALLOC_BUFFER_FAILED if the buffer fails to be allocated to the surface.

Returns IMAGE_RESULT_GET_SURFACE_FAILED if the surface fails to be obtained.

Returns IMAGE_RESULT_MEDIA_RTSP_SURFACE_UNSUPPORT if the media RTSP surface is not supported.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_MEDIA_DATA_UNSUPPORT if the media type is not supported.

Since

10

See

ImageReceiverNative

OH_Image_Receiver_Release()

int32_t OH_Image_Receiver_Release (ImageReceiverNative * native)

Description

Releases an ImageReceiverNative object. Note: This function is not used to release an ImageReceiver object.

Parameters

NameDescription
nativePointer to an ImageReceiverNative object.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Since

10

See

ImageReceiverNative

OH_Image_Release()

int32_t OH_Image_Release (ImageNative * native)

Description

Releases an ImageNative object. Note: This function is not used to release an Image object at the JavaScript native API. It is used to release an ImageNative object parsed by calling OH_Image_InitImageNative.

Parameters

NameDescription
nativePointer to an ImageNative object.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Since

10

See

ImageNative, OH_Image_InitImageNative

OH_Image_Size()

int32_t OH_Image_Size (const ImageNative * native, struct OhosImageSize * size )

Description

Obtains OhosImageSize of an ImageNative object.

Parameters

NameDescription
nativePointer to an ImageNative object.
sizePointer to the OhosImageSize object obtained.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILED if parameters fail to be obtained from the surface.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Since

10

See

ImageNative, OhosImageSize

OH_ImageSource_Create()

int32_t OH_ImageSource_Create (napi_env env, struct OhosImageSource * src, struct OhosImageSourceOps * ops, napi_value * res )

Description

Creates an ImageSource object at the JavaScript native layer based on the specified OhosImageSource and OhosImageSourceOps structs.

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
envPointer to the JNI environment.
srcPointer to the input resource of the image source. For details, see OhosImageSource.
opsPointer to the options for creating the image source. For details, see OhosImageSourceOps.
resPointer to an ImageSource object at the JavaScript native layer.

Returns

For details, see IRNdkErrCode.

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_SOURCE_DATA_INCOMPLETE if the image source data is incomplete.

Returns IMAGE_RESULT_SOURCE_DATA if the image source data is incorrect.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_TOO_LARGE if the image is too large.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_DECODE_HEAD_ABNORMAL if an error occurs during decoding of the image header.

Returns IMAGE_RESULT_DECODE_EXIF_UNSUPPORT if EXIF is not supported for image decoding.

Returns IMAGE_RESULT_PROPERTY_NOT_EXIST if the image property does not exist.

Returns IMAGE_RESULT_FILE_DAMAGED if the file is damaged.

Returns IMAGE_RESULT_FILE_FD_ERROR if the file descriptor is incorrect.

Returns IMAGE_RESULT_STREAM_SIZE_ERROR if the data stream is incorrect.

Returns IMAGE_RESULT_SEEK_FAILED if seeking the file fails.

Returns IMAGE_RESULT_PEEK_FAILED if peeking the file fails.

Returns IMAGE_RESULT_FREAD_FAILED if reading the file fails.

Since

10

See

OhosImageSource, OhosImageSourceOps

OH_ImageSource_CreateIncremental()

int32_t OH_ImageSource_CreateIncremental (napi_env env, struct OhosImageSource * source, struct OhosImageSourceOps * ops, napi_value * res )

Description

Creates an ImageSource object at the JavaScript native layer based on the specified OhosImageSource and OhosImageSourceOps structs. The image source data will be updated through OH_ImageSource_UpdateData.

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
envPointer to the JNI environment.
srcPointer to the input resource of the image source. Only the buffer type is accepted. For details, see OhosImageSource.
opsPointer to the options for creating the image source. For details, see OhosImageSourceOps.
resPointer to an ImageSource object at the JavaScript native layer.

Returns

For details, see IRNdkErrCode.

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_SOURCE_DATA_INCOMPLETE if the image source data is incomplete.

Returns IMAGE_RESULT_SOURCE_DATA if the image source data is incorrect.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_TOO_LARGE if the image is too large.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_DECODE_HEAD_ABNORMAL if an error occurs during decoding of the image header.

Returns IMAGE_RESULT_DECODE_EXIF_UNSUPPORT if EXIF is not supported for image decoding.

Returns IMAGE_RESULT_PROPERTY_NOT_EXIST if the image property does not exist.

Returns IMAGE_RESULT_FILE_DAMAGED if the file is damaged.

Returns IMAGE_RESULT_FILE_FD_ERROR if the file descriptor is incorrect.

Returns IMAGE_RESULT_STREAM_SIZE_ERROR if the data stream is incorrect.

Returns IMAGE_RESULT_SEEK_FAILED if seeking the file fails.

Returns IMAGE_RESULT_PEEK_FAILED if peeking the file fails.

Returns IMAGE_RESULT_FREAD_FAILED if reading the file fails.

Since

10

See

OhosImageSource, OhosImageSourceOps, OH_ImageSource_UpdateData

OH_ImageSource_CreatePixelMap()

int32_t OH_ImageSource_CreatePixelMap (const ImageSourceNative * native, struct OhosImageDecodingOps * ops, napi_value * res )

Description

Decodes an ImageSourceNative object to obtain a PixelMap object at the JavaScript native layer based on the specified OhosImageDecodingOps struct.

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
nativePointer to an ImageSourceNative object.
opsPointer to the options for decoding the image source. For details, see OhosImageDecodingOps.
resPointer to a PixelMap object at the JavaScript native layer.

Returns

For details, see IRNdkErrCode.

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_DECODE_HEAD_ABNORMAL if an error occurs during decoding of the image header.

Returns IMAGE_RESULT_CREATE_DECODER_FAILED if the decoder fails to be created.

Returns IMAGE_RESULT_CREATE_ENCODER_FAILED if the encoder fails to be created.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_DECODE_ABNORMAL if image decoding fails.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if the image is incorrect.

Returns IMAGE_RESULT_DATA_UNSUPPORT if an error occurs during image initialization.

Returns IMAGE_RESULT_INIT_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_ENCODE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_ENCODE_FAILED if the pixel map fails to be added.

Returns IMAGE_RESULT_HW_DECODE_UNSUPPORT if hardware decoding is not supported.

Returns IMAGE_RESULT_HW_DECODE_FAILED if hardware decoding fails.

Returns IMAGE_RESULT_ERR_IPC if IPC fails.

Returns IMAGE_RESULT_INDEX_INVALID if the index is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Since

10

See

ImageSourceNative, OhosImageDecodingOps

OH_ImageSource_CreatePixelMapList()

int32_t OH_ImageSource_CreatePixelMapList (const ImageSourceNative * native, struct OhosImageDecodingOps * ops, napi_value * res )

Description

Decodes an ImageSourceNative object to obtain all PixelMap objects at the JavaScript native layer based on the specified OhosImageDecodingOps struct.

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
nativePointer to an ImageSourceNative object.
opsPointer to the options for decoding the image source. For details, see OhosImageDecodingOps.
resPointer to PixelMap objects at the JavaScript native layer.

Returns

For details, see IRNdkErrCode.

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_DECODE_HEAD_ABNORMAL if an error occurs during decoding of the image header.

Returns IMAGE_RESULT_CREATE_DECODER_FAILED if the decoder fails to be created.

Returns IMAGE_RESULT_CREATE_ENCODER_FAILED if the encoder fails to be created.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_DECODE_ABNORMAL if image decoding fails.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if the image is incorrect.

Returns IMAGE_RESULT_DATA_UNSUPPORT if an error occurs during image initialization.

Returns IMAGE_RESULT_INIT_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_ENCODE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_ENCODE_FAILED if the pixel map fails to be added.

Returns IMAGE_RESULT_HW_DECODE_UNSUPPORT if hardware decoding is not supported.

Returns IMAGE_RESULT_HW_DECODE_FAILED if hardware decoding fails.

Returns IMAGE_RESULT_ERR_IPC if IPC fails.

Returns IMAGE_RESULT_INDEX_INVALID if the index is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Returns IMAGE_RESULT_DECODE_EXIF_UNSUPPORT if EXIF is not supported for image decoding.

Returns IMAGE_RESULT_PROPERTY_NOT_EXIST if the image property does not exist.

Since

10

See

ImageSourceNative, OhosImageDecodingOps

OH_ImageSource_GetDelayTime()

int32_t OH_ImageSource_GetDelayTime (const ImageSourceNative * native, struct OhosImageSourceDelayTimeList * res )

Description

Obtains the delay time list from an ImageSourceNative object (such as GIF image source).

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
nativePointer to an ImageSourceNative object.
resPointer to the OhosImageSourceDelayTimeList object obtained. When the input delayTimeList is a null pointer and size is 0, the size of the delay time list is returned through size in res. To obtain the complete delay time list, a space greater than size is required.

Returns

For details, see IRNdkErrCode.

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_DECODE_HEAD_ABNORMAL if an error occurs during decoding of the image header.

Returns IMAGE_RESULT_CREATE_DECODER_FAILED if the decoder fails to be created.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_DECODE_ABNORMAL if image decoding fails.

Returns IMAGE_RESULT_DATA_UNSUPPORT if an error occurs during image initialization.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_ENCODE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_INDEX_INVALID if the index is invalid.

Returns IMAGE_RESULT_DECODE_EXIF_UNSUPPORT if EXIF is not supported for image decoding.

Returns IMAGE_RESULT_PROPERTY_NOT_EXIST if the image property does not exist.

Since

10

See

ImageSourceNative, OhosImageSourceDelayTimeList

OH_ImageSource_GetFrameCount()

int32_t OH_ImageSource_GetFrameCount (const ImageSourceNative * native, uint32_t * res )

Description

Obtains the number of frames from an ImageSourceNative object.

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
nativePointer to an ImageSourceNative object.
resPointer to the frame count.

Returns

For details, see IRNdkErrCode.

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_DECODE_HEAD_ABNORMAL if an error occurs during decoding of the image header.

Returns IMAGE_RESULT_CREATE_DECODER_FAILED if the decoder fails to be created.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_DECODE_ABNORMAL if image decoding fails.

Returns IMAGE_RESULT_DATA_UNSUPPORT if an error occurs during image initialization.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_ENCODE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_INDEX_INVALID if the index is invalid.

Returns IMAGE_RESULT_DECODE_EXIF_UNSUPPORT if EXIF is not supported for image decoding.

Returns IMAGE_RESULT_PROPERTY_NOT_EXIST if the image property does not exist.

Since

10

See

ImageSourceNative

OH_ImageSource_GetImageInfo()

int32_t OH_ImageSource_GetImageInfo (const ImageSourceNative * native, int32_t index, struct OhosImageSourceInfo * info )

Description

Obtains image source information from an ImageSourceNative object by index.

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
nativePointer to an ImageSourceNative object.
indexIndex.
infoPointer to the OhosImageSourceInfo object obtained.

Returns

For details, see IRNdkErrCode.

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_DECODE_HEAD_ABNORMAL if an error occurs during decoding of the image header.

Returns IMAGE_RESULT_CREATE_DECODER_FAILED if the decoder fails to be created.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_DECODE_ABNORMAL if image decoding fails.

Returns IMAGE_RESULT_DATA_UNSUPPORT if an error occurs during image initialization.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_ENCODE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_INDEX_INVALID if the index is invalid.

Returns IMAGE_RESULT_DECODE_EXIF_UNSUPPORT if EXIF is not supported for image decoding.

Returns IMAGE_RESULT_PROPERTY_NOT_EXIST if the image property does not exist.

Since

10

See

ImageSourceNative, OhosImageSourceInfo

OH_ImageSource_GetImageProperty()

int32_t OH_ImageSource_GetImageProperty (const ImageSourceNative * native, struct OhosImageSourceProperty * key, struct OhosImageSourceProperty * value )

Description

Obtains the value of an image property from an ImageSourceNative object.

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
nativePointer to an ImageSourceNative object.
keyPointer to the property. For details, see OhosImageSourceProperty.
valuePointer to the OhosImageSourceProperty object obtained. If the input value is a null pointer and size is 0, the size of the property value is returned through size in value. To obtain the complete property value, a space greater than size is required.

Returns

For details, see IRNdkErrCode.

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_DECODE_HEAD_ABNORMAL if an error occurs during decoding of the image header.

Returns IMAGE_RESULT_CREATE_DECODER_FAILED if the decoder fails to be created.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_DECODE_ABNORMAL if image decoding fails.

Returns IMAGE_RESULT_DATA_UNSUPPORT if an error occurs during image initialization.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_ENCODE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_INDEX_INVALID if the index is invalid.

Returns IMAGE_RESULT_DECODE_EXIF_UNSUPPORT if EXIF is not supported for image decoding.

Returns IMAGE_RESULT_PROPERTY_NOT_EXIST if the image property does not exist.

Since

10

See

ImageSourceNative, OhosImageSourceProperty

OH_ImageSource_GetSupportedFormats()

int32_t OH_ImageSource_GetSupportedFormats (struct OhosImageSourceSupportedFormatList * res)

Description

Obtains all supported decoding formats.

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
resPointer to the OhosImageSourceSupportedFormatList struct. If the input supportedFormatList is a null pointer and size is 0, the size of the supported formats is returned through size in res.
To obtain all formats, a space larger than size is required. In addition, sufficient space must be reserved for each format supported.

Returns

For details, see IRNdkErrCode.

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Since

10

See

OhosImageSourceSupportedFormatList, OhosImageSourceSupportedFormat

OH_ImageSource_InitNative()

ImageSourceNative* OH_ImageSource_InitNative (napi_env env, napi_value source )

Description

Converts an ImageSource object at the JavaScript native layer to an ImageSourceNative object.

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
envPointer to the JNI environment.
sourcePointer to an ImageSource object at the JavaScript native layer.

Returns

Returns a pointer to the ImageSourceNative object if the operation is successful; returns a null pointer otherwise.

Since

10

See

ImageSourceNative, OH_ImageSource_Release

OH_ImageSource_ModifyImageProperty()

int32_t OH_ImageSource_ModifyImageProperty (const ImageSourceNative * native, struct OhosImageSourceProperty * key, struct OhosImageSourceProperty * value )

Description

Modifies the value of an image property of an ImageSourceNative object.

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
nativePointer to an ImageSourceNative object.
keyPointer to the property. For details, see OhosImageSourceProperty.
valuePointer to the new value of the property.

Returns

For details, see IRNdkErrCode.

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_DECODE_HEAD_ABNORMAL if an error occurs during decoding of the image header.

Returns IMAGE_RESULT_CREATE_DECODER_FAILED if the decoder fails to be created.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_DECODE_ABNORMAL if image decoding fails.

Returns IMAGE_RESULT_DATA_UNSUPPORT if an error occurs during image initialization.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_ENCODE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_INDEX_INVALID if the index is invalid.

Returns IMAGE_RESULT_DECODE_EXIF_UNSUPPORT if EXIF is not supported for image decoding.

Returns IMAGE_RESULT_PROPERTY_NOT_EXIST if the image property does not exist.

Since

10

See

ImageSourceNative, OhosImageSourceProperty

OH_ImageSource_Release()

int32_t OH_ImageSource_Release (ImageSourceNative * native)

Description

Releases an ImageSourceNative object.

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
nativePointer to an ImageSourceNative object.

Returns

For details, see IRNdkErrCode.

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Since

10

See

ImageSourceNative, OH_ImageSource_Create, OH_ImageSource_CreateIncremental

OH_ImageSource_UpdateData()

int32_t OH_ImageSource_UpdateData (const ImageSourceNative * native, struct OhosImageSourceUpdateData * data )

Description

Updates the data of an ImageSourceNative object.

@Syscap SystemCapability.Multimedia.Image

Parameters

NameDescription
nativePointer to an ImageSourceNative object.
dataPointer to the update data. For details, see OhosImageSourceUpdateData.

Returns

For details, see IRNdkErrCode.

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_DECODE_HEAD_ABNORMAL if an error occurs during decoding of the image header.

Returns IMAGE_RESULT_CREATE_DECODER_FAILED if the decoder fails to be created.

Returns IMAGE_RESULT_CREATE_ENCODER_FAILED if the encoder fails to be created.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_DECODE_ABNORMAL if image decoding fails.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if the image is incorrect.

Returns IMAGE_RESULT_DATA_UNSUPPORT if an error occurs during image initialization.

Returns IMAGE_RESULT_INIT_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_ENCODE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_ENCODE_FAILED if the pixel map fails to be added.

Returns IMAGE_RESULT_HW_DECODE_UNSUPPORT if hardware decoding is not supported.

Returns IMAGE_RESULT_HW_DECODE_FAILED if hardware decoding fails.

Returns IMAGE_RESULT_ERR_IPC if IPC fails.

Returns IMAGE_RESULT_INDEX_INVALID if the index is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Since

10

See

ImageSourceNative, OhosImageSourceUpdateData

OH_PixelMap_AccessPixels()

int32_t OH_PixelMap_AccessPixels (const NativePixelMap * native, void ** addr )

Description

Obtains the memory address of a NativePixelMap object and locks the memory.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
addrDouble pointer to the memory address.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if an error occurs during memory allocation.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_PLUGIN_CREATE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Since

10

See

AccessPixels

OH_PixelMap_CreateAlphaPixelMap()

int32_t OH_PixelMap_CreateAlphaPixelMap (napi_env env, napi_value source, napi_value * alpha )

Description

Creates a PixelMap object that contains only alpha channel information.

Parameters

NameDescription
envPointer to the NAPI environment.
sourceOptions for setting the PixelMap object.
alphaPointer to the alpha channel.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_DECODE_HEAD_ABNORMAL if an error occurs during decoding of the image header.

Returns IMAGE_RESULT_CREATE_DECODER_FAILED if the decoder fails to be created.

Returns IMAGE_RESULT_CREATE_ENCODER_FAILED if the encoder fails to be created.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_DECODE_ABNORMAL if image decoding fails.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if an error occurs during memory allocation.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_INIT_ABNORMAL if the image fails to be initialized.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_PLUGIN_CREATE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_ENCODE_FAILED if the pixel map fails to be added to the image.

Returns IMAGE_RESULT_HW_DECODE_UNSUPPORT if hardware decoding is not supported.

Returns IMAGE_RESULT_HW_DECODE_FAILED if hardware decoding fails.

Returns IMAGE_RESULT_INDEX_INVALID if IPC fails.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Since

10

See

CreateAlphaPixelMap

OH_PixelMap_CreatePixelMap()

int32_t OH_PixelMap_CreatePixelMap (napi_env env, OhosPixelMapCreateOps info, void * buf, size_t len, napi_value * res )

Description

Creates a PixelMap object.

Parameters

NameDescription
envPointer to the NAPI environment.
infoOptions for setting the PixelMap object.
bufPointer to the buffer of the image.
lenImage size.
resPointer to the PixelMap object at the application layer.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_DECODE_HEAD_ABNORMAL if an error occurs during decoding of the image header.

Returns IMAGE_RESULT_CREATE_DECODER_FAILED if the decoder fails to be created.

Returns IMAGE_RESULT_CREATE_ENCODER_FAILED if the encoder fails to be created.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_DECODE_ABNORMAL if image decoding fails.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if an error occurs during memory allocation.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_INIT_ABNORMAL if the image fails to be initialized.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_PLUGIN_CREATE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_ENCODE_FAILED if the pixel map fails to be added to the image.

Returns IMAGE_RESULT_HW_DECODE_UNSUPPORT if hardware decoding is not supported.

Returns IMAGE_RESULT_HW_DECODE_FAILED if hardware decoding fails.

Returns IMAGE_RESULT_INDEX_INVALID if IPC fails.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Since

10

See

CreatePixelMap

OH_PixelMap_Crop()

int32_t OH_PixelMap_Crop (const NativePixelMap * native, int32_t x, int32_t y, int32_t width, int32_t height )

Description

Crops a NativePixelMap object.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
xX-coordinate of the upper left corner of the target image.
yY-coordinate of the upper left corner of the target image.
widthWidth of the cropped region.
heightHeight of the cropped region.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if an error occurs during memory allocation.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_PLUGIN_CREATE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Since

10

See

Crop

OH_PixelMap_Flip()

int32_t OH_PixelMap_Flip (const NativePixelMap * native, int32_t x, int32_t y )

Description

Flips a NativePixelMap object.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
xWhether to flip around the x axis.
yWhether to flip around the y axis.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if an error occurs during memory allocation.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_PLUGIN_CREATE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Since

10

See

Flip

OH_PixelMap_GetBytesNumberPerRow()

int32_t OH_PixelMap_GetBytesNumberPerRow (const NativePixelMap * native, int32_t * num )

Description

Obtains the number of bytes per row of a NativePixelMap object.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
numPointer to the number of bytes per row.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Since

10

See

GetBytesNumberPerRow

OH_PixelMap_GetDensity()

int32_t OH_PixelMap_GetDensity (const NativePixelMap * native, int32_t * density )

Description

Obtains the pixel density of a NativePixelMap object.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
densityPointer to the pixel density.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Since

10

See

GetDensity

OH_PixelMap_GetImageInfo()

int32_t OH_PixelMap_GetImageInfo (const NativePixelMap * native, OhosPixelMapInfos * info )

Description

Obtains the image information of a NativePixelMap object.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
infoPointer to the image information.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if an error occurs during memory allocation.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_PLUGIN_CREATE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Since

10

See

OhosPixelMapInfos

OH_PixelMap_GetIsEditable()

int32_t OH_PixelMap_GetIsEditable (const NativePixelMap * native, int32_t * editable )

Description

Checks whether a NativePixelMap object is editable.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
editablePointer to the editing type of the NativePixelMap object.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Since

10

See

GetIsEditable

OH_PixelMap_InitNativePixelMap()

NativePixelMap* OH_PixelMap_InitNativePixelMap (napi_env env, napi_value source )

Description

Initializes a PixelMap object.

Parameters

NameDescription
envPointer to the NAPI environment.
sourceOptions for setting the PixelMap object.

Returns

Returns a pointer to the NativePixelMap object if the operation is successful; returns an error code otherwise.

Since

10

See

InitNativePixelMap

OH_PixelMap_IsSupportAlpha()

int32_t OH_PixelMap_IsSupportAlpha (const NativePixelMap * native, int32_t * alpha )

Description

Checks whether a NativePixelMap object supports alpha channels.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
alphaPointer to the support for alpha channels.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Since

10

See

IsSupportAlpha

OH_PixelMap_Rotate()

int32_t OH_PixelMap_Rotate (const NativePixelMap * native, float angle )

Description

Rotates a NativePixelMap object.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
angleAngle to rotate.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if an error occurs during memory allocation.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_PLUGIN_CREATE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Since

10

See

Rotate

OH_PixelMap_Scale()

int32_t OH_PixelMap_Scale (const NativePixelMap * native, float x, float y )

Description

Scales a NativePixelMap object.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
xScaling ratio of the width.
yScaling ratio of the height.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if an error occurs during memory allocation.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_INIT_ABNORMAL if the image fails to be initialized.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_PLUGIN_CREATE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Since

10

See

Scale

OH_PixelMap_SetAlphaAble()

int32_t OH_PixelMap_SetAlphaAble (const NativePixelMap * native, int32_t alpha )

Description

Sets an alpha channel for a NativePixelMap object.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
alphaAlpha channel to set.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Since

10

See

SetAlphaAble

OH_PixelMap_SetDensity()

int32_t OH_PixelMap_SetDensity (const NativePixelMap * native, int32_t density )

Description

Sets the pixel density for a NativePixelMap object.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
densityPixel density to set.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Since

10

See

GetDensity

OH_PixelMap_SetOpacity()

int32_t OH_PixelMap_SetOpacity (const NativePixelMap * native, float opacity )

Description

Sets the opacity for a NativePixelMap object.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
opacityOpacity to set.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Since

10

See

SetOpacity

OH_PixelMap_Translate()

int32_t OH_PixelMap_Translate (const NativePixelMap * native, float x, float y )

Description

Translates a NativePixelMap object.

Parameters

NameDescription
nativePointer to a NativePixelMap object.
xHorizontal distance to translate.
yVertical distance to translate.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if an error occurs during memory allocation.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_PLUGIN_CREATE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Since

10

See

Translate

OH_PixelMap_UnAccessPixels()

int32_t OH_PixelMap_UnAccessPixels (const NativePixelMap * native)

Description

Unlocks the memory of a NativePixelMap object. This function is used with OH_PixelMap_AccessPixels in pairs.

Parameters

NameDescription
nativePointer to a NativePixelMap object.

Returns

For details, see IRNdkErrCode.

Returns IMAGE_RESULT_SUCCESS if the operation is successful.

Returns IMAGE_RESULT_BAD_PARAMETER if a parameter is incorrect.

Returns IMAGE_RESULT_JNI_ENV_ABNORMAL if the JNI environment is abnormal.

Returns IMAGE_RESULT_INVALID_PARAMETER if a parameter is invalid.

Returns IMAGE_RESULT_GET_DATA_ABNORMAL if an error occurs during image data retrieval.

Returns IMAGE_RESULT_DECODE_FAILED if decoding fails.

Returns IMAGE_RESULT_CHECK_FORMAT_ERROR if the format check fails.

Returns IMAGE_RESULT_THIRDPART_SKIA_ERROR if skia decoding fails.

Returns IMAGE_RESULT_DATA_ABNORMAL if the input image data is incorrect.

Returns IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST if sharing the memory fails.

Returns IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL if the data in the shared memory is abnormal.

Returns IMAGE_RESULT_MALLOC_ABNORMAL if an error occurs during memory allocation.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the image type is not supported.

Returns IMAGE_RESULT_CROP if cropping fails.

Returns IMAGE_RESULT_UNKNOWN_FORMAT if the image format is unknown.

Returns IMAGE_RESULT_PLUGIN_REGISTER_FAILED if the plug-in fails to be registered.

Returns IMAGE_RESULT_PLUGIN_CREATE_FAILED if the plug-in fails to be created.

Returns IMAGE_RESULT_DATA_UNSUPPORT if the property is invalid.

Returns IMAGE_RESULT_ALPHA_TYPE_ERROR if the alpha type is incorrect.

Returns IMAGE_RESULT_ALLOCATER_TYPE_ERROR if the memory allocation type is incorrect.

Since

10

See

UnAccessPixels

OH_UnAccessPixels()

int32_t OHOS::Media::OH_UnAccessPixels (napi_env env, napi_value value )

Description

Unlocks the memory of a PixelMap object. This function is used with OH_AccessPixels in pairs.

Parameters

NameDescription
envPointer to the NAPI environment.
valuePixelMap object at the application layer.

Returns

Returns OHOS_IMAGE_RESULT_SUCCESS if the operation is successful; returns an error code otherwise.

Since

8

Deprecated from

10

See

AccessPixels

Variable Description

alphaType

int32_t OhosImageSourceInfo::alphaType

Description

Defines the alpha type of the image source.

Since

10

buffer [1/2]

uint8_t* OhosImageSource::buffer = nullptr

Description

Defines a pointer to the image source buffer. Only a formatted packet buffer or Base64 buffer is accepted.

Since

10

buffer [2/2]

uint8_t* OhosImageSourceUpdateData::buffer = nullptr

Description

Defines a pointer to the buffer for storing the update data.

Since

10

bufferSize [1/2]

size_t OhosImageSource::bufferSize = 0

Description

Defines the size of the image source buffer.

Since

10

bufferSize [2/2]

size_t OhosImageSourceUpdateData::bufferSize = 0

Description

Defines the size of the buffer.

Since

10

colorSpace

int32_t OhosImageSourceInfo::colorSpace

Description

Defines the color space of the image source.

Since

10

delayTimeList

int32_t* OhosImageSourceDelayTimeList::delayTimeList

Description

Defines a pointer to the head of the image source delay time list.

Since

10

density [1/2]

int32_t OhosImageSourceOps::density

Description

Defines the pixel density of the image source.

Since

10

density [2/2]

int32_t OhosImageSourceInfo::density

Description

Defines the image density of the image source. It is set in OH_ImageSource_Create.

Since

10

editable

int8_t OhosImageDecodingOps::editable

Description

Defines whether the output pixel map is editable.

Since

10

fd

int32_t OhosImageSource::fd = -1

Description

Defines the descriptor of the image source.

Since

10

fitDensity

int32_t OhosImageDecodingOps::fitDensity

Description

Defines the pixel density of the output pixel map.

Since

10

format

char* OhosImageSourceSupportedFormat::format = nullptr

Description

Defines a pointer to the head of the format string.

Since

10

height

int32_t OhosImageRegion::height

Description

Defines the height of the region, in pixels.

Since

10

index

uint32_t OhosImageDecodingOps::index

Description

Defines the index of the output pixel map.

Since

10

isCompleted

int8_t OhosImageSourceUpdateData::isCompleted = 0

Description

Defines whether the image source data update is completed.

Since

10

offset

uint32_t OhosImageSourceUpdateData::offset = 0

Description

Defines the offset of the update data in the buffer.

Since

10

OHOS_IMAGE_PROPERTY_BITS_PER_SAMPLE

const char* OHOS_IMAGE_PROPERTY_BITS_PER_SAMPLE = "BitsPerSample"

Description

Defines a pointer to bits per sample, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_COMPRESSED_BITS_PER_PIXEL

const char* OHOS_IMAGE_PROPERTY_COMPRESSED_BITS_PER_PIXEL = "CompressedBitsPerPixel"

Description

Defines a pointer to the compressed bits per pixel, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_DATE_TIME_ORIGINAL

const char* OHOS_IMAGE_PROPERTY_DATE_TIME_ORIGINAL = "DateTimeOriginal"

Description

Defines a pointer to the created date and time, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_EXPOSURE_TIME

const char* OHOS_IMAGE_PROPERTY_EXPOSURE_TIME = "ExposureTime"

Description

Defines a pointer to the exposure time, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_F_NUMBER

const char* OHOS_IMAGE_PROPERTY_F_NUMBER = "FNumber"

Description

Defines a pointer to the f-number of the image, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_GPS_LATITUDE

const char* OHOS_IMAGE_PROPERTY_GPS_LATITUDE = "GPSLatitude"

Description

Defines a pointer to the GPS latitude, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_GPS_LATITUDE_REF

const char* OHOS_IMAGE_PROPERTY_GPS_LATITUDE_REF = "GPSLatitudeRef"

Description

Defines a pointer to the GPS latitude reference information, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_GPS_LONGITUDE

const char* OHOS_IMAGE_PROPERTY_GPS_LONGITUDE = "GPSLongitude"

Description

Defines a pointer to the GPS longitude, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_GPS_LONGITUDE_REF

const char* OHOS_IMAGE_PROPERTY_GPS_LONGITUDE_REF = "GPSLongitudeRef"

Description

Defines a pointer to the GPS longitude reference information, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_IMAGE_LENGTH

const char* OHOS_IMAGE_PROPERTY_IMAGE_LENGTH = "ImageLength"

Description

Defines a pointer to the image length, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_IMAGE_WIDTH

const char* OHOS_IMAGE_PROPERTY_IMAGE_WIDTH = "ImageWidth"

Description

Defines a pointer to the image width, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_ISO_SPEED_RATINGS

const char* OHOS_IMAGE_PROPERTY_ISO_SPEED_RATINGS = "ISOSpeedRatings"

Description

Defines a pointer to the ISO speed ratings, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_ORIENTATION

const char* OHOS_IMAGE_PROPERTY_ORIENTATION = "Orientation"

Description

Defines a pointer to the orientation, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

OHOS_IMAGE_PROPERTY_SCENE_TYPE

const char* OHOS_IMAGE_PROPERTY_SCENE_TYPE = "SceneType"

Description

Defines a pointer to the scene type, one of the image properties. It is used in OH_ImageSource_GetImageProperty and OH_ImageSource_ModifyImageProperty.

@Syscap SystemCapability.Multimedia.Image

Since

10

pixelFormat [1/3]

int32_t OhosImageSourceOps::pixelFormat

Description

Defines the pixel format of the image source. It is usually used to describe the YUV buffer.

Since

10

pixelFormat [2/3]

int32_t OhosImageDecodingOps::pixelFormat

Description

Defines the pixel format of the output pixel map.

Since

10

pixelFormat [3/3]

int32_t OhosImageSourceInfo::pixelFormat

Description

Defines the pixel format of the image source. It is set in OH_ImageSource_Create.

Since

10

region

struct OhosImageRegion OhosImageDecodingOps::region

Description

Defines the region of the output pixel map.

Since

10

rotate

uint32_t OhosImageDecodingOps::rotate

Description

Defines the decoding rotation.

Since

10

sampleSize

uint32_t OhosImageDecodingOps::sampleSize

Description

Defines the size of the sample.

Since

10

size [1/7]

struct OhosImageSize OhosImageSourceOps::size

Description

Defines the pixel width and height of the image source.

Since

10

size [2/7]

struct OhosImageSize OhosImageDecodingOps::size

Description

Defines the pixel width and height of the output pixel map.

Since

10

size [3/7]

struct OhosImageSize OhosImageSourceInfo::size

Description

Defines the pixel width and height of the image source.

Since

10

size [4/7]

size_t OhosImageSourceDelayTimeList::size = 0

Description

Defines the size of the image source delay time list.

Since

10

size [5/7]

size_t OhosImageSourceSupportedFormat::size = 0

Description

Defines the size of the format string.

Since

10

size [6/7]

size_t OhosImageSourceSupportedFormatList::size = 0

Description

Defines the size of the format string list.

Since

10

size [7/7]

size_t OhosImageSourceProperty::size = 0

Description

Defines the size of the property string.

Since

10

supportedFormatList

struct OhosImageSourceSupportedFormat** OhosImageSourceSupportedFormatList::supportedFormatList = nullptr

Description

Defines a double pointer to the head of the format string list.

Since

10

updateLength

uint32_t OhosImageSourceUpdateData::updateLength = 0

Description

Defines the length of the update data in the buffer.

Since

10

uri

char* OhosImageSource::uri = nullptr

Description

Defines a pointer to the image source URI. Only a file URI or Base64 URI is accepted.

Since

10

uriSize

size_t OhosImageSource::uriSize = 0

Description

Defines the length of the image source URI.

Since

10

value

char* OhosImageSourceProperty::value = nullptr

Description

Defines a pointer to the head of the property string.

Since

10

width

int32_t OhosImageRegion::width

Description

Defines the width of the region, in pixels.

Since

10

x

int32_t OhosImageRegion::x

Description

Defines the X coordinate of the start point, in pixels.

Since

10

y

int32_t OhosImageRegion::y

Description

Defines the Y coordinate of the start point, in pixels.

Since

10

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Native APIs

harmony 鸿蒙AVCapability

harmony 鸿蒙AVDemuxer

harmony 鸿蒙AVMuxer

harmony 鸿蒙AVScreenCapture

harmony 鸿蒙AVSource

harmony 鸿蒙AudioDecoder

harmony 鸿蒙AudioEncoder

harmony 鸿蒙CodecBase

harmony 鸿蒙Core

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/8fda963bf39f4777b06a13306cc33be2