Skia
2D Graphics Library
SkRegion::Iterator Class Reference

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

#include <SkRegion.h>

Public Member Functions

 Iterator ()
 Initializes SkRegion::Iterator with an empty SkRegion. More...
 
 Iterator (const SkRegion &region)
 Sets SkRegion::Iterator to return elements of SkIRect array in region. More...
 
bool rewind ()
 SkPoint SkRegion::Iterator to start of SkRegion. More...
 
void reset (const SkRegion &region)
 Resets iterator, using the new SkRegion. More...
 
bool done () const
 Returns true if SkRegion::Iterator is pointing to final SkIRect in SkRegion. More...
 
void next ()
 Advances SkRegion::Iterator to next SkIRect in SkRegion if it is not done. More...
 
const SkIRectrect () const
 Returns SkIRect element in SkRegion. More...
 
const SkRegionrgn () const
 Returns SkRegion if set; otherwise, returns nullptr. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Iterator() [1/2]

SkRegion::Iterator::Iterator ( )
inline

Initializes SkRegion::Iterator with an empty SkRegion.

done() on SkRegion::Iterator returns true. Call reset() to initialized SkRegion::Iterator at a later time.

Returns
empty SkRegion iterator

◆ Iterator() [2/2]

SkRegion::Iterator::Iterator ( const SkRegion region)

Sets SkRegion::Iterator to return elements of SkIRect array in region.

Parameters
regionSkRegion to iterate
Returns
SkRegion iterator

example: https://fiddle.skia.org/c/@Region_Iterator_copy_const_SkRegion

Member Function Documentation

◆ done()

bool SkRegion::Iterator::done ( ) const
inline

Returns true if SkRegion::Iterator is pointing to final SkIRect in SkRegion.

Returns
true if data parsing is complete

◆ next()

void SkRegion::Iterator::next ( )

◆ rect()

const SkIRect& SkRegion::Iterator::rect ( ) const
inline

Returns SkIRect element in SkRegion.

Does not return predictable results if SkRegion is empty.

Returns
part of SkRegion as SkIRect

◆ reset()

void SkRegion::Iterator::reset ( const SkRegion region)

Resets iterator, using the new SkRegion.

Parameters
regionSkRegion to iterate

example: https://fiddle.skia.org/c/@Region_Iterator_reset

◆ rewind()

bool SkRegion::Iterator::rewind ( )

SkPoint SkRegion::Iterator to start of SkRegion.

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

Returns
true if SkRegion was set

example: https://fiddle.skia.org/c/@Region_Iterator_rewind

◆ rgn()

const SkRegion* SkRegion::Iterator::rgn ( ) const
inline

Returns SkRegion if set; otherwise, returns nullptr.

Returns
iterated SkRegion

The documentation for this class was generated from the following file: