clearUnsafe method

  1. @override
void clearUnsafe([
  1. Rect? target
])
inherited

Clears the buffer to the PixelFormat.zero value.

This is equivalent to calling fillUnsafe with the zero value of the format.

If a target rectangle is provided, only the pixels within that rectangle will be cleared. If the rectangle is outside the bounds of the buffer, the behavior is undefined.

Example

final pixels = IntPixels(2, 2);
pixels.clearUnsafe();
pixels.clearUnsafe(Rect.fromLTWH(1, 0, 1, 2));

Implementation

@override
void clearUnsafe([Rect? target]) {
  lodim.fillRectLinear(data, format.zero, width: width, bounds: target);
}