Skia
2D Graphics Library
SkRegion::Spanerator Class Reference

Returns the line segment ends within SkRegion that intersect a horizontal line. More...

#include <SkRegion.h>

Public Member Functions

 Spanerator (const SkRegion &region, int y, int left, int right)
 Sets SkRegion::Spanerator to return line segments in SkRegion on scan line. More...
 
bool next (int *left, int *right)
 Advances iterator to next span intersecting SkRegion within line segment provided in constructor. More...
 

Detailed Description

Returns the line segment ends within SkRegion that intersect a horizontal line.

Constructor & Destructor Documentation

◆ Spanerator()

SkRegion::Spanerator::Spanerator ( const SkRegion region,
int  y,
int  left,
int  right 
)

Sets SkRegion::Spanerator to return line segments in SkRegion on scan line.

Parameters
regionSkRegion to iterate
yhorizontal line to intersect
leftbounds of iteration
rightbounds of iteration
Returns
SkRegion iterator

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

Member Function Documentation

◆ next()

bool SkRegion::Spanerator::next ( int *  left,
int *  right 
)

Advances iterator to next span intersecting SkRegion within line segment provided in constructor.

Returns true if interval was found.

Parameters
leftpointer to span start; may be nullptr
rightpointer to span end; may be nullptr
Returns
true if interval was found

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


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