Skip to main content Crate ohos_image_native_sys Copy item path Source Image_Region @brief Defines the region of the image source to decode. Image_Size @brief Defines the image size. Image_String @brief The struct describes an image string, which is a carrier for string data. OHExtDataHandle @brief Defines the ExtData Handle
@since 9
@deprecated since 10 OHHDRMetaData @brief Defines the HDR metadata.
@since 9
@deprecated since 10 OHIPCParcel OH_DecodingOptions @brief The OH_DecodingOptions struct describes the decoding options encapsulated at the native layer. The struct is
used to set decoding options and is passed in as an input parameter for creating a PixelMap. For details, see
{@link OH_ImageSourceNative_CreatePixelmap}. OH_ImageNative @brief The struct describes the alias for an image object at the native layer. OH_ImagePackerNative @brief The struct describes the image packer, which is used to perform operations related to an image packer. OH_ImageReceiverNative /**
@brief The OH_ImageReceiverNative struct describes the image receiver, which is encapsulated at the native layer.
The struct cannot be directly operated. Instead, functions must be called to create and release the struct and
operate the fields in the struct. OH_ImageReceiverOptions @brief The struct describes the data type name of the image receiver options. OH_ImageSourceNative @brief The struct describes the image source, which is encapsulated at the native layer and is used to create image
data. The struct cannot be directly operated. Instead, functions must be called to create and release the struct and
operate the fields in the struct. OH_ImageSource_Info @brief The OH_ImageSource_Info struct describes the image source information encapsulated at the native layer. The
struct cannot be directly operated. Instead, functions must be called to create and release the struct and operate
the fields in the struct. OH_PackingOptions @brief OH_PackingOptions is an image encoding option struct encapsulated at the native layer. It cannot be
manipulated directly; instead, functions shall be called to create and release the struct, and operate on its
specific fields. OH_PixelmapNative @brief Define a Pixelmap struct type, used for pixelmap pointer controls. OH_Pixelmap_HdrDynamicMetadata @brief Value for HDR_DYNAMIC_METADATA. OH_Pixelmap_HdrGainmapMetadata @brief Value for HDR_GAINMAP_METADATA. OH_Pixelmap_HdrMetadataValue @brief Value for HDR_METADATA_KEY. Corresponding relationship with HDR_METADATA_KEY. OH_Pixelmap_HdrStaticMetadata @brief Value for HDR_STATIC_METADATA. OH_Pixelmap_ImageInfo @brief Defines the pixel map information. OH_Pixelmap_InitializationOptions @brief Defines the options used for creating a pixel map. Region_Rect if rects is nullptr, fill the Buffer dirty size by default __IncompleteArrayField Image_ErrorCode_IMAGE_ALLOC_FAILED failed to allocate memory Image_ErrorCode_IMAGE_BAD_PARAMETER invalid parameter Image_ErrorCode_IMAGE_BAD_SOURCE decode data source exception Image_ErrorCode_IMAGE_COPY_FAILED memory copy failed Image_ErrorCode_IMAGE_DECODE_FAILED decode failed Image_ErrorCode_IMAGE_DMA_NOT_EXIST @error DMA memory does not exist Image_ErrorCode_IMAGE_DMA_OPERATION_FAILED @error DMA operation failed Image_ErrorCode_IMAGE_ENCODE_FAILED encode failed Image_ErrorCode_IMAGE_INVALID_REGION invalid region Image_ErrorCode_IMAGE_SUCCESS operation success Image_ErrorCode_IMAGE_TOO_LARGE too large data or image Image_ErrorCode_IMAGE_UNKNOWN_ERROR unknown error Image_ErrorCode_IMAGE_UNKNOWN_MIME_TYPE unknown mime type Image_ErrorCode_IMAGE_UNSUPPORTED_CONVERSION unsupported conversion Image_ErrorCode_IMAGE_UNSUPPORTED_METADATA unsupported metadata Image_ErrorCode_IMAGE_UNSUPPORTED_MIME_TYPE unsupported mime type Image_ErrorCode_IMAGE_UNSUPPORTED_OPERATION unsupported operations OHHDRMetadataKey_OH_METAKEY_BLUE_PRIMARY_X OHHDRMetadataKey_OH_METAKEY_BLUE_PRIMARY_Y OHHDRMetadataKey_OH_METAKEY_GREEN_PRIMARY_X OHHDRMetadataKey_OH_METAKEY_GREEN_PRIMARY_Y OHHDRMetadataKey_OH_METAKEY_HDR10_PLUS OHHDRMetadataKey_OH_METAKEY_HDR_VIVID OHHDRMetadataKey_OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL OHHDRMetadataKey_OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL OHHDRMetadataKey_OH_METAKEY_MAX_LUMINANCE OHHDRMetadataKey_OH_METAKEY_MIN_LUMINANCE OHHDRMetadataKey_OH_METAKEY_RED_PRIMARY_X OHHDRMetadataKey_OH_METAKEY_RED_PRIMARY_Y OHHDRMetadataKey_OH_METAKEY_WHITE_PRIMARY_X OHHDRMetadataKey_OH_METAKEY_WHITE_PRIMARY_Y OHScalingModeV2_OH_SCALING_MODE_FREEZE_V2 the window content is not updated until a buffer of
the window size is received OHScalingModeV2_OH_SCALING_MODE_NO_SCALE_CROP_V2 the window is clipped to the size of the buffer’s clipping rectangle
pixels outside the clipping rectangle are considered fully transparent. OHScalingModeV2_OH_SCALING_MODE_SCALE_CROP_V2 the buffer is uniformly scaled so that the smaller size of
the buffer matches the window size OHScalingModeV2_OH_SCALING_MODE_SCALE_FIT_V2 Adapt to the buffer and scale proportionally to the buffer size. Prioritize displaying all buffer content.
If the size is not the same as the window size, fill the unfilled area of the window with a background color. OHScalingModeV2_OH_SCALING_MODE_SCALE_TO_WINDOW_V2 the buffer is scaled in two dimensions to match the window size OHScalingMode_OH_SCALING_MODE_FREEZE the window content is not updated until a buffer of
the window size is received OHScalingMode_OH_SCALING_MODE_NO_SCALE_CROP the window is clipped to the size of the buffer’s clipping rectangle
pixels outside the clipping rectangle are considered fully transparent. OHScalingMode_OH_SCALING_MODE_SCALE_CROP the buffer is uniformly scaled so that the smaller size of
the buffer matches the window size OHScalingMode_OH_SCALING_MODE_SCALE_TO_WINDOW the buffer is scaled in two dimensions to match the window size OH_PixelmapNative_AntiAliasingLevel_OH_PixelmapNative_AntiAliasing_HIGH Cubic interpolation algorithm OH_PixelmapNative_AntiAliasingLevel_OH_PixelmapNative_AntiAliasing_LOW Bilinear interpolation algorithm OH_PixelmapNative_AntiAliasingLevel_OH_PixelmapNative_AntiAliasing_MEDIUM Bilinear interpolation algorithm with mipmap linear filtering OH_PixelmapNative_AntiAliasingLevel_OH_PixelmapNative_AntiAliasing_NONE Nearest-neighbor interpolation algorithm OH_Pixelmap_HdrMetadataKey_HDR_DYNAMIC_METADATA Dynamic metadata key. OH_Pixelmap_HdrMetadataKey_HDR_GAINMAP_METADATA Gainmap metadata key. OH_Pixelmap_HdrMetadataKey_HDR_METADATA_TYPE Indicate the types of metadata that image needs to use. OH_Pixelmap_HdrMetadataKey_HDR_STATIC_METADATA Static metadata key. OH_Pixelmap_HdrMetadataType_HDR_METADATA_TYPE_ALTERNATE Indicates that metadata will be used for the alternate image. OH_Pixelmap_HdrMetadataType_HDR_METADATA_TYPE_BASE Indicates that metadata will be used for the base image. OH_Pixelmap_HdrMetadataType_HDR_METADATA_TYPE_GAINMAP Indicates that metadata will be used for the gainmap image. OH_Pixelmap_HdrMetadataType_HDR_METADATA_TYPE_NONE No metadata. PIXELMAP_ALPHA_TYPE_PIXELMAP_ALPHA_TYPE_OPAQUE PIXELMAP_ALPHA_TYPE_PIXELMAP_ALPHA_TYPE_PREMULTIPLIED PIXELMAP_ALPHA_TYPE_PIXELMAP_ALPHA_TYPE_UNKNOWN PIXELMAP_ALPHA_TYPE_PIXELMAP_ALPHA_TYPE_UNPREMULTIPLIED PIXEL_FORMAT_PIXEL_FORMAT_ALPHA_8 PIXEL_FORMAT_PIXEL_FORMAT_BGRA_8888 PIXEL_FORMAT_PIXEL_FORMAT_NV12 PIXEL_FORMAT_PIXEL_FORMAT_NV21 PIXEL_FORMAT_PIXEL_FORMAT_RGBA_8888 PIXEL_FORMAT_PIXEL_FORMAT_RGBA_1010102 PIXEL_FORMAT_PIXEL_FORMAT_RGBA_F16 PIXEL_FORMAT_PIXEL_FORMAT_RGB_565 PIXEL_FORMAT_PIXEL_FORMAT_RGB_888 PIXEL_FORMAT_PIXEL_FORMAT_UNKNOWN PIXEL_FORMAT_PIXEL_FORMAT_YCBCR_P010 PIXEL_FORMAT_PIXEL_FORMAT_YCRCB_P010 OH_DecodingOptions_Create ⚠ @brief Creates the pointer to an OH_DecodingOptions object. OH_DecodingOptions_GetDesiredDynamicRange ⚠ @brief Obtains the desired dynamic range configured during decoding. OH_DecodingOptions_GetDesiredRegion ⚠ @brief Obtains the region to decode.
Since the corresponding SetDesiredRegion function cannot meet the regional decoding requirements, starting from
API version 19, you are advised to use {@link OH_DecodingOptions_GetCropRegion} instead. OH_DecodingOptions_GetDesiredSize ⚠ @brief Obtains the desired output size. OH_DecodingOptions_GetIndex ⚠ @brief Obtains the index of an image. OH_DecodingOptions_GetPixelFormat ⚠ @brief Obtains the pixel format. OH_DecodingOptions_GetRotate ⚠ @brief Obtains the rotation degree. OH_DecodingOptions_Release ⚠ @brief Releases the pointer to an OH_DecodingOptions object. OH_DecodingOptions_SetDesiredDynamicRange ⚠ @brief Sets the desired dynamic range during decoding. OH_DecodingOptions_SetDesiredRegion ⚠ @brief Sets the region to decode.
The actual decoding will process the entire original image, without any regional decoding effect. Starting from API
version 19, you are advised to use {@link OH_DecodingOptions_SetCropRegion} instead. OH_DecodingOptions_SetDesiredSize ⚠ @brief Sets the desired output size. OH_DecodingOptions_SetIndex ⚠ @brief Sets the index for an image. OH_DecodingOptions_SetPixelFormat ⚠ @brief Sets the pixel format. OH_DecodingOptions_SetRotate ⚠ @brief Sets the rotation angle. OH_ImageNative_GetBufferSize ⚠ @brief Obtains the size of the buffer corresponding to a component type in an {@link OH_ImageNative} object. OH_ImageNative_GetByteBuffer ⚠ @brief Obtains the buffer corresponding to a component type in an {@link OH_ImageNative} object. OH_ImageNative_GetComponentTypes ⚠ @brief Obtains the component types of an {@link OH_ImageNative} object. OH_ImageNative_GetImageSize ⚠ @brief Obtains {@link Image_Size} of an {@link OH_ImageNative} object. OH_ImageNative_GetPixelStride ⚠ @brief Obtains the pixel stride corresponding to a component type in an {@link OH_ImageNative} object. OH_ImageNative_GetRowStride ⚠ @brief Obtains the row stride corresponding to a component type in an {@link OH_ImageNative} object. OH_ImageNative_GetTimestamp ⚠ @brief Obtains the timestamp of an {@link OH_ImageNative} object. Timestamps, measured in nanoseconds, are usually
monotonically increasing. OH_ImageNative_Release ⚠ @brief Releases an {@link OH_ImageNative} object. OH_ImagePackerNative_Create ⚠ @brief Creates the pointer to an OH_ImagePackerNative struct. OH_ImagePackerNative_PackToDataFromImageSource ⚠ @brief Encodes an image source into data in a given format. OH_ImagePackerNative_PackToDataFromPixelmap ⚠ @brief Encodes a PixelMap into data in a given format. OH_ImagePackerNative_PackToFileFromImageSource ⚠ @brief Encodes an image source into a file. OH_ImagePackerNative_PackToFileFromPixelmap ⚠ @brief Encodes a PixelMap into a file. OH_ImagePackerNative_Release ⚠ @brief Releases the pointer to an OH_ImagePackerNative struct. OH_ImageReceiverNative_Create ⚠ @brief Creates an OH_ImageReceiverNative object at the application layer. OH_ImageReceiverNative_GetCapacity ⚠ @brief Obtains the capacity of an OH_ImageReceiverNative . OH_ImageReceiverNative_GetReceivingSurfaceId ⚠ @brief Obtains the surface ID through an OH_ImageReceiverNative object. OH_ImageReceiverNative_GetSize ⚠ @brief Obtains the size of an ImageReceiver using OH_ImageReceiverNative . OH_ImageReceiverNative_Off ⚠ @brief Unregisters the {@link OH_ImageReceiver_OnCallback} callback. OH_ImageReceiverNative_On ⚠ @brief Registers the {@link OH_ImageReceiver_OnCallback} callback. OH_ImageReceiverNative_ReadLatestImage ⚠ @brief Obtains the latest image through an OH_ImageReceiverNative object. OH_ImageReceiverNative_ReadNextImage ⚠ @brief Obtains the next image through an OH_ImageReceiverNative object. OH_ImageReceiverNative_Release ⚠ @brief Releases an OH_ImageReceiverNative object. OH_ImageReceiverOptions_Create ⚠ @brief Creates an OH_ImageReceiverOptions object at the application layer. OH_ImageReceiverOptions_GetCapacity ⚠ @brief Obtains the image cache capacity of an OH_ImageReceiverOptions object. OH_ImageReceiverOptions_GetSize ⚠ @brief Obtains the image size of an OH_ImageReceiverOptions object. OH_ImageReceiverOptions_Release ⚠ @brief Releases an OH_ImageReceiverOptions object. OH_ImageReceiverOptions_SetCapacity ⚠ @brief Sets the image cache capacity of an OH_ImageReceiverOptions object. OH_ImageReceiverOptions_SetSize ⚠ @brief Sets the image size of an OH_ImageReceiverOptions object. OH_ImageSourceInfo_Create ⚠ @brief Creates the pointer to an OH_ImageSource_Info object. OH_ImageSourceInfo_GetDynamicRange ⚠ @brief Obtains the dynamic range of an image. OH_ImageSourceInfo_GetHeight ⚠ @brief Obtains the image height. OH_ImageSourceInfo_GetWidth ⚠ @brief Obtains the image width. OH_ImageSourceInfo_Release ⚠ @brief Releases the pointer to an OH_ImageSource_Info object. OH_ImageSourceNative_CreateFromData ⚠ @brief Creates the pointer to an OH_ImageSourceNative object based on buffer data.
The buffer data must be undecoded. Do not pass the pixel buffer data such as RBGA and YUV. If you want to create a
PixelMap based on the pixel buffer data, call {@link OH_PixelmapNative_CreatePixelmap}. OH_ImageSourceNative_CreateFromFd ⚠ @brief Creates the pointer to an OH_ImageSourceNative object based on a file descriptor. OH_ImageSourceNative_CreateFromRawFile ⚠ @brief Creates the pointer to an OH_ImageSourceNative object by using the raw file descriptor of an image resource
file. OH_ImageSourceNative_CreateFromUri ⚠ @brief Creates the pointer to an OH_ImageSourceNative object based on a URI. OH_ImageSourceNative_CreatePixelmap ⚠ @brief Creates the pointer to an OH_PixelmapNative object based on decoding options. OH_ImageSourceNative_CreatePixelmapList ⚠ @brief Creates an array of OH_PixelmapNative objects based on decoding options.
This function decodes all frames at once. If the number of frames is high or the size of individual frames is large,
it can lead to significant memory usage. In these cases, you are advised to use the Image component for
displaying animations. The Image component decodes frames one by one, which uses less memory than this function. OH_ImageSourceNative_GetDelayTimeList ⚠ @brief Obtains the image delay time list. OH_ImageSourceNative_GetFrameCount ⚠ @brief Obtains the number of image frames. OH_ImageSourceNative_GetImageInfo ⚠ @brief Obtains the information about an image with a given index. OH_ImageSourceNative_GetImageProperty ⚠ @brief Obtains the value of an image property. OH_ImageSourceNative_ModifyImageProperty ⚠ @brief Obtains the value of an image property. The output value.data is terminated with a string terminator. OH_ImageSourceNative_Release ⚠ @brief Releases the pointer to an OH_ImageSourceNative object. OH_PackingOptions_Create ⚠ @brief Creates the pointer to an OH_PackingOptions struct. OH_PackingOptions_GetDesiredDynamicRange ⚠ @brief Obtains the desired dynamic range during encoding. OH_PackingOptions_GetMimeType ⚠ @brief Obtains the MIME type. value.data obtained through this API lacks the string terminator \0 . Please
use it with caution. OH_PackingOptions_GetNeedsPackProperties ⚠ @brief Obtains the needsPackProperties parameter in the OH_PackingOptions struct. OH_PackingOptions_GetQuality ⚠ @brief Obtains the encoding quality. OH_PackingOptions_Release ⚠ @brief Releases the pointer to an OH_PackingOptions struct. OH_PackingOptions_SetDesiredDynamicRange ⚠ @brief Sets the desired dynamic range during encoding. OH_PackingOptions_SetMimeType ⚠ @brief Sets the MIME type. OH_PackingOptions_SetNeedsPackProperties ⚠ @brief Sets the needsPackProperties parameter in the OH_PackingOptions struct. OH_PackingOptions_SetQuality ⚠ @brief Sets the encoding quality. OH_PixelmapImageInfo_Create ⚠ @brief Create imageinfo struct . OH_PixelmapImageInfo_GetAlphaType ⚠ @brief Get alphaType number for imageinfo struct. OH_PixelmapImageInfo_GetDynamicRange ⚠ @brief Get isHdr boolean for imageinfo struct. OH_PixelmapImageInfo_GetHeight ⚠ @brief Get height number for imageinfo struct. OH_PixelmapImageInfo_GetPixelFormat ⚠ @brief Get pixelFormat number for imageinfo struct. OH_PixelmapImageInfo_GetRowStride ⚠ @brief Get rowStride number for imageinfo struct. OH_PixelmapImageInfo_GetWidth ⚠ @brief Get width number for imageinfo struct. OH_PixelmapImageInfo_Release ⚠ @brief Delete imageinfo struct pointer. OH_PixelmapInitializationOptions_Create ⚠ @brief Create a for InitializationOtions struct. OH_PixelmapInitializationOptions_GetAlphaType ⚠ @brief Get alphaType number for InitializationOtions struct. OH_PixelmapInitializationOptions_GetHeight ⚠ @brief Get height number for InitializationOtions struct. OH_PixelmapInitializationOptions_GetPixelFormat ⚠ @brief Get pixelFormat number for InitializationOtions struct. OH_PixelmapInitializationOptions_GetRowStride ⚠ @brief Get rowStride for InitializationOptions struct. OH_PixelmapInitializationOptions_GetSrcPixelFormat ⚠ @brief Get pixelFormat number for InitializationOptions struct. OH_PixelmapInitializationOptions_GetWidth ⚠ @brief Get width number for InitializationOtions struct. OH_PixelmapInitializationOptions_Release ⚠ @brief delete InitializationOtions pointer. OH_PixelmapInitializationOptions_SetAlphaType ⚠ @brief Set alphaType number for InitializationOtions struct. OH_PixelmapInitializationOptions_SetHeight ⚠ @brief Set height number for InitializationOtions struct. OH_PixelmapInitializationOptions_SetPixelFormat ⚠ @brief Set pixelFormat number for InitializationOptions struct. OH_PixelmapInitializationOptions_SetRowStride ⚠ @brief Set rowStride number for InitializationOptions struct. OH_PixelmapInitializationOptions_SetSrcPixelFormat ⚠ @brief Set pixelFormat number for InitializationOptions struct. OH_PixelmapInitializationOptions_SetWidth ⚠ @brief Set width number for InitializationOtions struct. OH_PixelmapNative_ConvertAlphaFormat ⚠ @brief Converting images to alpha format
It is recommended to use {@link OH_PixelmapNative_ConvertAlphaType}. OH_PixelmapNative_ConvertPixelmapNativeFromNapi ⚠ @brief Convert a PixelMap napi object to native PixelMap object. OH_PixelmapNative_ConvertPixelmapNativeToNapi ⚠ @brief Convert a native PixelMap object to PixelMap napi object. OH_PixelmapNative_CreateEmptyPixelmap ⚠ @brief Create a empty PixelMap object. OH_PixelmapNative_CreatePixelmap ⚠ @brief Creates a PixelMap object. OH_PixelmapNative_Crop ⚠ @brief Crops this image based on the input size.
It is recommended to use {@link OH_PixelmapNative_ApplyCrop}. OH_PixelmapNative_Flip ⚠ @brief Flips this image horizontally or vertically, or both.
It is recommended to use {@link OH_PixelmapNative_ApplyFlip}. OH_PixelmapNative_GetImageInfo ⚠ @brief Obtains pixel map information of this image. OH_PixelmapNative_GetMetadata ⚠ @brief Get metadata. OH_PixelmapNative_GetNativeBuffer ⚠ @brief Get the native buffer from the PixelMap. OH_PixelmapNative_Opacity ⚠ @brief Sets an opacity rate for this image pixel map.
It is recommended to use {@link OH_PixelmapNative_SetOpacity}. OH_PixelmapNative_ReadPixels ⚠ @brief Reads data of this pixel map to an Buffer. If this pixel map is created in the BGRA_8888 format,
the data read is the same as the original data. OH_PixelmapNative_Release ⚠ @brief Releases an OH_Pixelmap object. OH_PixelmapNative_Rotate ⚠ @brief Rotates this image based on the input angle.
It is recommended to use {@link OH_PixelmapNative_ApplyRotate}. OH_PixelmapNative_Scale ⚠ @brief Scales this image based on the input width and height.
It is recommended to use {@link OH_PixelmapNative_ApplyScale}. OH_PixelmapNative_ScaleWithAntiAliasing ⚠ @brief Scales this image based on the input width and height with anti-aliasing.
It is recommended to use {@link OH_PixelmapNative_ApplyScaleWithAntiAliasing}. OH_PixelmapNative_SetMetadata ⚠ @brief Set metadata. OH_PixelmapNative_ToSdr ⚠ @brief Convert {@link OH_PixelmapNative} to standard dynamic range. OH_PixelmapNative_Translate ⚠ @brief Translates this image based on the input coordinates.
It is recommended to use {@link OH_PixelmapNative_ApplyTranslate}. OH_PixelmapNative_WritePixels ⚠ @brief Reads image data in an Buffer and writes the data to a Pixelmap object. Image_ErrorCode @brief Enumerates the return values that may be used by the interface. Image_MimeType @brief Defines the image encode format. OHHDRMetadataKey @brief Enumerates the HDR metadata keys.
@since 9
@deprecated since 10 OHScalingMode @brief Indicates Scaling Mode.
@since 9
@deprecated since 10
@useinstead OHScalingModeV2 OHScalingModeV2 @brief Indicates Scaling Mode.
@since 12 OH_ImageReceiver_OnCallback @brief Defines the callbacks for the image receiver at the native layer. OH_PixelmapNative_AntiAliasingLevel @brief Defines the anti-aliasing level. OH_Pixelmap_HdrMetadataKey @brief Enumerates the HDR metadata types that need to be stored in Pixelmap. OH_Pixelmap_HdrMetadataType @brief Value for HDR_METADATA_TYPE. PIXELMAP_ALPHA_TYPE @brief Define a pixelmap alpha type. PIXEL_FORMAT