convertYUV2ARGB method Null safety
Convert input image to android.graphics.Bitmap.Config.ARGB_8888 format.
Input must be in YUV_NV21 of YUV_NV12 format.
Note: actual bytes order is BGRA, it looks like ARGB_8888
name use little-endian 32-bit integer notation.
image
- Image in YUV_NV21 or YUV_NV12 format.
result_buffer
- Data buffer to store converted result, with size image.width * image.height bytes if downscale_x2, or 4 * image.width * image.height bytes otherwise.
downscale_x2
- Downscale image during conversion, so the result image size will be image.width/2 x image.height/2.
Implementation
void convertYUV2ARGB(RawImageF image, Pointer<Void> result_buffer, {bool downscale_x2 = false}) {
final exception = _getException();
final convertYUV2ARGBConstructor =
_dll_handle.lookupFunction<_RawImage_convertYUV2ARGB_c, _RawImage_convertYUV2ARGB_dart>(
_c_namespace + 'RawImage_convertYUV2ARGB');
convertYUV2ARGBConstructor(
image.data.cast(),
image.width,
image.height,
image.format.index,
image.with_crop,
image.crop_info_offset_x,
image.crop_info_offset_y,
image.crop_info_data_image_width,
image.crop_info_data_image_height,
downscale_x2 ? 1 : 0,
result_buffer,
exception);
checkException(exception, _dll_handle);
}