getRect method

Iterable<T> getRect(
  1. Rect rect
)

Returns a lazy iterable of pixels in the rectangle defined by rect.

The returned iterable will contain all pixels in the buffer that are within the rectangle defined by rect.

The provided rectangle is clamped to the bounds of the buffer and yields no pixels if the rectangle is empty.

Implementation

Iterable<T> getRect(Rect rect) {
  return getRectUnsafe(rect.intersect(bounds));
}