renderThumbnail method

List<int> renderThumbnail()

Implementation

List<int> renderThumbnail() {
  final tWidth = width ~/ _THUMBNAIL_SCALE_FACTOR;
  final tHeight = height ~/ _THUMBNAIL_SCALE_FACTOR;
  final pixels = List.filled(tWidth * tHeight, 0);
  final yuv = _yuvData;
  int inputOffset = _top * _dataWidth + _left;

  for (int y = 0; y < tHeight; y++) {
    final outputOffset = y * tWidth;
    for (int x = 0; x < tWidth; x++) {
      final grey = yuv[inputOffset + x * _THUMBNAIL_SCALE_FACTOR];
      pixels[outputOffset + x] = 0xFF000000 | (grey * 0x00010101);
    }
    inputOffset += _dataWidth * _THUMBNAIL_SCALE_FACTOR;
  }
  return pixels;
}