row method

Uint8List row(
  1. int y, [
  2. Uint8List? into
])

Copies one row into into (allocated when null).

Implementation

Uint8List row(int y, [Uint8List? into]) {
  final Uint8List out = into != null && into.length >= width ? into : Uint8List(width);
  final int offset = y * stride;
  for (int x = 0; x < width; x++) {
    out[x] = data[offset + x];
  }
  return out;
}