Region.Iterator

class Iterator

Returns sequence of rectangles, sorted along y-axis, then x-axis, that make up Region.

Methods

__init__

Overloaded function.

done

Returns true if Iterator is pointing to final IRect in Region.

next

Advances Iterator to next IRect in Region if it is not done.

rect

Returns IRect element in Region.

reset

Resets iterator, using the new Region.

rewind

Point Iterator to start of Region.

rgn

Returns Region if set; otherwise, returns nullptr.

Methods

Iterator.__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: skia.Region.Iterator) -> None

    Initializes Iterator with an empty Region.

    done() on Iterator returns true. Call reset() to initialize Iterator at a later time.

    return:

    empty Region iterator

  2. __init__(self: skia.Region.Iterator, region: skia.Region) -> None

    Sets Iterator to return elements of IRect array in region.

    region:

    Region to iterate Region iterator

Iterator.done(self: skia.Region.Iterator) bool

Returns true if Iterator is pointing to final IRect in Region.

Returns:

true if data parsing is complete

Iterator.next(self: skia.Region.Iterator) None

Advances Iterator to next IRect in Region if it is not done.

Iterator.rect(self: skia.Region.Iterator) skia.IRect

Returns IRect element in Region.

Does not return predictable results if Region is empty.

Returns:

part of Region as IRect

Iterator.reset(self: skia.Region.Iterator, region: skia.Region) None

Resets iterator, using the new Region.

Parameters:

regionRegion to iterate

Iterator.rewind(self: skia.Region.Iterator) bool

Point Iterator to start of Region.

Returns true if Region was set; otherwise, returns false.

Returns:

true if Region was set

Iterator.rgn(self: skia.Region.Iterator) skia.Region

Returns Region if set; otherwise, returns nullptr.

Returns:

iterated Region