Skip to main content

OH_ImageSourceNative_CreateFromData

Function OH_ImageSourceNative_CreateFromData 

Source
pub unsafe extern "C" fn OH_ImageSourceNative_CreateFromData(
    data: *mut u8,
    dataSize: usize,
    res: *mut *mut OH_ImageSourceNative,
) -> Image_ErrorCode
Expand description

@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}.

@param data Pointer to the buffer data. @param dataSize Size of the buffer. @param res Double pointer to the OH_ImageSourceNative object created at the C++ local layer. @return {@link IMAGE_SUCCESS} if the execution is successful.
{@link IMAGE_BAD_PARAMETER} if data is a null pointer or if dataSize is 0. @since 12