encodeAvif method
Future<Uint8List>
encodeAvif({
- required int width,
- required int height,
- required int speed,
- required int maxThreads,
- required int timescale,
- required int maxQuantizer,
- required int minQuantizer,
- required int maxQuantizerAlpha,
- required int minQuantizerAlpha,
- required List<
EncodeFrame> imageSequence, - required Uint8List exifData,
override
Implementation
@override
Future<Uint8List> encodeAvif({
required int width,
required int height,
required int speed,
required int maxThreads,
required int timescale,
required int maxQuantizer,
required int minQuantizer,
required int maxQuantizerAlpha,
required int minQuantizerAlpha,
required List<EncodeFrame> imageSequence,
required Uint8List exifData,
}) {
final request = EncodeRequest(
width: width,
height: height,
speed: speed,
maxThreads: maxThreads,
timescale: timescale,
maxQuantizer: maxQuantizer,
minQuantizer: minQuantizer,
maxQuantizerAlpha: maxQuantizerAlpha,
minQuantizerAlpha: minQuantizerAlpha,
imageList: imageSequence,
exifData: exifData,
).writeToBuffer();
final nativeRequest = toPointer(request);
final completer = Completer<Uint8List>();
final port = RawReceivePort();
port.handler = (response) {
port.close();
completer.complete(response);
};
flutterAvifFFI.encode_avif(
port.sendPort.nativePort,
nativeRequest[0],
nativeRequest[1],
);
malloc.free(nativeRequest[0]);
return completer.future;
}