fill method

  1. @override
void fill(
  1. Float32x4 pixel, [
  2. Rect? target
])
inherited

Fill the buffer with the given pixel.

This is equivalent to calling set for every pixel in the buffer.

If a target rectangle is provided, only the pixels within that rectangle will be filled, and the rectangle will be clipped to the bounds of the buffer. If omitted, the entire buffer will be filled.

Example

final pixels = IntPixels(2, 2);
pixels.fill(0xFFFFFFFF);
pixels.fill(0x00000000,  Rect.fromLTWH(1, 0, 1, 2));

Implementation

@override
void fill(T pixel, [Rect? target]) {
  target = target?.intersect(bounds);
  lodim.fillRectLinear(data, pixel, width: width, bounds: target);
}