Artifact.fromUint8List constructor

Artifact.fromUint8List(
  1. Uint8List pixels,
  2. int width
)

Creates a Matrix from a Uint8List, typically used for image data.

pixels A Uint8List representing pixel data. width The width of the image.

Implementation

factory Artifact.fromUint8List(final Uint8List pixels, final int width) {
  return Artifact.fromFlatListOfBool([
    for (int i = 0; i < pixels.length; i += 4) pixels[i] == 0,
  ], width);
}