Skip to main content

OH_PixelmapNative_ReadPixels

Function OH_PixelmapNative_ReadPixels 

Source
pub unsafe extern "C" fn OH_PixelmapNative_ReadPixels(
    pixelmap: *mut OH_PixelmapNative,
    destination: *mut u8,
    bufferSize: *mut usize,
) -> Image_ErrorCode
Expand description

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

@param pixelmap The Pixelmap pointer will be operated. @param destination Buffer to which the image pixel map data will be written. @param bufferSize Buffer size to which the image pixel map data will be written. @return Function result code: {@link IMAGE_SUCCESS} if the execution is successful. {@link IMAGE_BAD_PARAMETER} Parameter error. Possible causes: 1.Parameter is nullptr 2.pixelmap’s inner pixelmap is nullptr. 3.Parameter bufferSize is less than the actual data size. {@link IMAGE_UNKNOWN_ERROR} Internal unknown error, e.g. memory copy failed or pixelmap’s attributes are incorrect. @since 12