Skia
2D Graphics Library
SkRegion::Cliperator Class Reference

Returns the sequence of rectangles, sorted along y-axis, then x-axis, that make up SkRegion intersected with the specified clip rectangle. More...

#include <SkRegion.h>

Public Member Functions

 Cliperator (const SkRegion &region, const SkIRect &clip)
 Sets SkRegion::Cliperator to return elements of SkIRect array in SkRegion within clip. More...
 
bool done ()
 Returns true if SkRegion::Cliperator is pointing to final SkIRect in SkRegion. More...
 
void next ()
 Advances iterator to next SkIRect in SkRegion contained by clip. More...
 
const SkIRectrect () const
 Returns SkIRect element in SkRegion, intersected with clip passed to SkRegion::Cliperator constructor. More...
 

Detailed Description

Returns the sequence of rectangles, sorted along y-axis, then x-axis, that make up SkRegion intersected with the specified clip rectangle.

Constructor & Destructor Documentation

◆ Cliperator()

SkRegion::Cliperator::Cliperator ( const SkRegion region,
const SkIRect clip 
)

Sets SkRegion::Cliperator to return elements of SkIRect array in SkRegion within clip.

Parameters
regionSkRegion to iterate
clipbounds of iteration
Returns
SkRegion iterator

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

Member Function Documentation

◆ done()

bool SkRegion::Cliperator::done ( )
inline

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

Returns
true if data parsing is complete

◆ next()

void SkRegion::Cliperator::next ( )

Advances iterator to next SkIRect in SkRegion contained by clip.

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

◆ rect()

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

Returns SkIRect element in SkRegion, intersected with clip passed to SkRegion::Cliperator constructor.

Does not return predictable results if SkRegion is empty.

Returns
part of SkRegion inside clip as SkIRect

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