getBytes method

  1. @override
Future<List<List<int>>> getBytes()

Implementation

@override
Future<List<List<int>>> getBytes() async {
  final cmd = <List<int>>[];
  final image = await ISOManager.loadBalanceFuture<img.Image, Uint8List>(
    ImageDecodeTool.cropImage,
    imgData,
  );
  final startTime = DateTime.now();
  final imageBytes = await ISOManager.loadBalanceFuture<List<int>, img.Image>(
    decodeBytes,
    image,
  );
  final endTime = DateTime.now();
  final diffTime = endTime.difference(startTime).inMilliseconds;
  LogTool.log(
    '图像转打印字节耗时:$diffTime 毫秒,width(${image.width})height(${image.height})',
  );
  cmd.add(imageBytes);
  return cmd;
}