crop method
void
crop()
Image cropping will be done by crop method
Implementation
void crop(
int imageCropX,
int imageCropY,
int imageCropWidth,
int imageCropHeight,
Function(Image, Uint8List) onImageLoaded) async {
worker.postMessage([
1,
libraryImage.getBytes(),
libraryImage.width.toInt(),
libraryImage.height.toInt(),
imageCropX,
imageCropY,
imageCropWidth,
imageCropHeight,
encodingQuality,
outputImageFormat.index
]);
final event = await worker.onMessage.first;
onImageLoaded.call(
Image.fromBytes(imageCropWidth, imageCropHeight, event.data[0],
channels: Channels.rgb),
event.data[1]);
}