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 Defines the region of the image source to decode. OHExtDataHandle @brief Defines the ExtData Handle
@since 9
@deprecated since 10 OHHDRMetaData @brief Defines the HDR metadata.
@since 9
@deprecated since 10 OHIPCParcel OH_ComposeOptions OH_DecodingOptions @brief Defines the options for decoding the image source.
It is used in {@link OH_ImageSourceNative_CreatePixelmap}. OH_ImageNative @brief Defines an OH_ImageNative object. OH_ImagePackerNative @brief Define a ImagePacker struct type, used for ImagePacker pointer controls. OH_ImageReceiverNative @brief Defines an OH_ImageReceiverNative object. OH_ImageReceiverOptions @brief Defines an image receiver options object. OH_ImageSourceNative @brief Defines an image source object for the image interface. OH_ImageSource_Info @brief Defines image source infomation
{@link OH_ImageSourceInfo_Create}. OH_NativeColorSpaceManager OH_PackingOptions @brief Defines the image packing options. 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_SOURCE_UNSUPPORTED_OPTIONS 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. 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 Create a pointer for OH_DecodingOptions struct. OH_DecodingOptions_GetDesiredDynamicRange ⚠ @brief Set desiredDynamicRange number for OH_DecodingOptions struct. OH_DecodingOptions_GetDesiredRegion ⚠ @brief Set desiredRegion number for OH_DecodingOptions struct. OH_DecodingOptions_GetDesiredSize ⚠ @brief Get desiredSize number for OH_DecodingOptions struct. OH_DecodingOptions_GetIndex ⚠ @brief Get index number for OH_DecodingOptions struct. OH_DecodingOptions_GetPixelFormat ⚠ @brief Get pixelFormat number for OH_DecodingOptions struct. OH_DecodingOptions_GetRotate ⚠ @brief Get rotate number for OH_DecodingOptions struct. OH_DecodingOptions_Release ⚠ @brief delete OH_DecodingOptions pointer. OH_DecodingOptions_SetDesiredDynamicRange ⚠ @brief Set desiredDynamicRange number for OH_DecodingOptions struct. OH_DecodingOptions_SetDesiredRegion ⚠ @brief Set desiredRegion number for OH_DecodingOptions struct. OH_DecodingOptions_SetDesiredSize ⚠ @brief Set desiredSize number for OH_DecodingOptions struct. OH_DecodingOptions_SetIndex ⚠ @brief Set index number for OH_DecodingOptions struct. OH_DecodingOptions_SetPixelFormat ⚠ @brief Set pixelFormat number for OH_DecodingOptions struct. OH_DecodingOptions_SetRotate ⚠ @brief Set rotate number for OH_DecodingOptions struct. OH_ImageNative_GetBufferSize ⚠ @brief Get size of buffer from an {@link OH_ImageNative} object by the component type. OH_ImageNative_GetByteBuffer ⚠ @brief Get byte buffer from an {@link OH_ImageNative} object by the component type. OH_ImageNative_GetComponentTypes ⚠ @brief Get type arry from an {@link OH_ImageNative} object. OH_ImageNative_GetImageSize ⚠ @brief Obtains {@link Image_Size} of an {@link OH_ImageNative} object. OH_ImageNative_GetPixelStride ⚠ @brief Get pixel stride from an {@link OH_ImageNative} object by the component type. OH_ImageNative_GetRowStride ⚠ @brief Get row stride from an {@link OH_ImageNative} object by the component type. OH_ImageNative_GetTimestamp ⚠ @brief Get timestamp from an {@link OH_ImageNative} object. OH_ImageNative_Release ⚠ @brief Releases an {@link OH_ImageNative} object.
It is used to release the object {@link OH_ImageNative}. OH_ImagePackerNative_Create ⚠ @brief Create a pointer for OH_ImagePackerNative struct. OH_ImagePackerNative_PackToDataFromImageSource ⚠ @brief Encoding an ImageSource into the data with required format. OH_ImagePackerNative_PackToDataFromPixelmap ⚠ @brief Encoding a Pixelmap into the data with required format. OH_ImagePackerNative_PackToFileFromImageSource ⚠ @brief Encoding an ImageSource into the a file with fd with required format. OH_ImagePackerNative_PackToFileFromPixelmap ⚠ @brief Encoding a Pixelmap into the a file with fd with required format OH_ImagePackerNative_Release ⚠ @brief Releases an imagePacker object. OH_ImageReceiverNative_Create ⚠ @brief Creates an OH_ImageReceiverNative object at the application layer. OH_ImageReceiverNative_GetCapacity ⚠ @brief Obtains the capacity of the image receiver through an {@link OH_ImageReceiverNative} object. OH_ImageReceiverNative_GetReceivingSurfaceId ⚠ @brief Obtains the receiver ID through an {@link OH_ImageReceiverNative} object. OH_ImageReceiverNative_GetSize ⚠ @brief Obtains the size of the image receiver through an {@link OH_ImageReceiverNative} object. OH_ImageReceiverNative_Off ⚠ @brief Unregisters the {@link OH_ImageReceiver_OnCallback} callback event. OH_ImageReceiverNative_On ⚠ @brief Registers an {@link OH_ImageReceiver_OnCallback} callback event. OH_ImageReceiverNative_ReadLatestImage ⚠ @brief Obtains the latest image through an {@link OH_ImageReceiverNative} object. OH_ImageReceiverNative_ReadNextImage ⚠ @brief Obtains the next image through an {@link OH_ImageReceiverNative} object. OH_ImageReceiverNative_Release ⚠ @brief Releases an {@link OH_ImageReceiverNative} object. OH_ImageReceiverOptions_Create ⚠ @brief Creates an OH_ImageReceiverOptions object at the application layer. OH_ImageReceiverOptions_GetCapacity ⚠ @brief Get capacity from an {@link OH_ImageReceiverOptions} object. OH_ImageReceiverOptions_GetSize ⚠ @brief Get size of an {@link OH_ImageReceiverOptions} object. OH_ImageReceiverOptions_Release ⚠ @brief Releases an {@link OH_ImageReceiverOptions} object.
It is used to release the object {@link OH_ImageReceiverOptions}. OH_ImageReceiverOptions_SetCapacity ⚠ @brief Set capacity of an {@link OH_ImageReceiverOptions} object. OH_ImageReceiverOptions_SetSize ⚠ @brief Set size of an {@link OH_ImageReceiverOptions} object. OH_ImageSourceInfo_Create ⚠ @brief Create a pointer for OH_ImageSource_Info struct. OH_ImageSourceInfo_GetDynamicRange ⚠ @brief Get isHdr for OH_ImageSource_Info struct. OH_ImageSourceInfo_GetHeight ⚠ @brief Get height number for OH_ImageSource_Info struct. OH_ImageSourceInfo_GetWidth ⚠ @brief Get width number for OH_ImageSource_Info struct. OH_ImageSourceInfo_Release ⚠ @brief delete OH_ImageSource_Info pointer. OH_ImageSourceNative_CreateFromData ⚠ @brief Creates an void pointer OH_ImageSourceNative_CreateFromFd ⚠ @brief Creates an void pointer OH_ImageSourceNative_CreateFromRawFile ⚠ @brief Creates an void pointer OH_ImageSourceNative_CreateFromUri ⚠ @brief Creates an ImageSource pointer. OH_ImageSourceNative_CreatePixelmap ⚠ @brief Decodes an void pointer
based on the specified {@link OH_DecodingOptions} struct. OH_ImageSourceNative_CreatePixelmapList ⚠ @brief Decodes an void pointer
the Pixelmap objects at the C++ native layer
based on the specified {@link OH_DecodingOptions} struct. OH_ImageSourceNative_GetDelayTimeList ⚠ @brief Obtains the delay time list from some ImageSource objects (such as GIF image sources). OH_ImageSourceNative_GetFrameCount ⚠ @brief Obtains the number of frames from an ImageSource object. OH_ImageSourceNative_GetImageInfo ⚠ @brief Obtains image source information from an ImageSource object by index. OH_ImageSourceNative_GetImageProperty ⚠ @brief Obtains the value of an image property from an ImageSource object. OH_ImageSourceNative_ModifyImageProperty ⚠ @brief Modifies the value of an image property of an ImageSource object.
@param source Indicates a void pointer(from ImageSource pointer convert).
@param key Indicates a pointer to the property. For details, see {@link Image_String}., key is an exif constant.
Release after use ImageSource, see {@link OH_ImageSourceNative_Release}.
@param value Indicates a pointer to the new value of the property.
@return Returns one of the following result codes:
{@link IMAGE_SUCCESS} if the execution is successful.
{@link IMAGE_BAD_PARAMETER} source is nullptr, or key is nullptr, or value is nullptr,
or failed to modify image property because of invalid parameters.
@since 12 OH_ImageSourceNative_Release ⚠ @brief Releases an ImageSourc object. OH_PackingOptions_Create ⚠ @brief Create a pointer for PackingOptions struct. OH_PackingOptions_GetDesiredDynamicRange ⚠ @brief Get desiredDynamicRange for PackingOptions struct. OH_PackingOptions_GetMimeType ⚠ @brief Get mime type for OH_PackingOptions struct. OH_PackingOptions_GetNeedsPackProperties ⚠ @brief Get needsPackProperties for OH_PackingOptions struct. OH_PackingOptions_GetQuality ⚠ @brief Get quality for OH_PackingOptions struct. OH_PackingOptions_Release ⚠ @brief delete OH_PackingOptions pointer. OH_PackingOptions_SetDesiredDynamicRange ⚠ @brief Set desiredDynamicRange number for PackingOptions struct. OH_PackingOptions_SetMimeType ⚠ @brief Set format number for OH_PackingOptions struct. OH_PackingOptions_SetNeedsPackProperties ⚠ @brief Set needsPackProperties for OH_PackingOptions struct. OH_PackingOptions_SetQuality ⚠ @brief Set quality number for OH_PackingOptions struct. 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 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. OH_PixelmapNative_Flip ⚠ @brief Flips this image horizontally or vertically, or both. 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. 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. OH_PixelmapNative_Scale ⚠ @brief Scales this image based on the input width and height. OH_PixelmapNative_ScaleWithAntiAliasing ⚠ @brief Scales this image based on the input width and height with anti-aliasing. 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. 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 images. 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. PIXEL_FORMAT