JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::EdgeTable Class Reference

A table of horizontal scan-line segments - used for rasterising Paths. More...

#include <juce_EdgeTable.h>

Collaboration diagram for juce::EdgeTable:

Classes

struct  LineItem
 

Public Member Functions

 EdgeTable (Rectangle< int > clipLimits, const Path &pathToAdd, const AffineTransform &transform)
 Creates an edge table containing a path. More...
 
 EdgeTable (Rectangle< int > rectangleToAdd)
 Creates an edge table containing a rectangle. More...
 
 EdgeTable (Rectangle< float > rectangleToAdd)
 Creates an edge table containing a rectangle. More...
 
 EdgeTable (const RectangleList< int > &rectanglesToAdd)
 Creates an edge table containing a rectangle list. More...
 
 EdgeTable (const RectangleList< float > &rectanglesToAdd)
 Creates an edge table containing a rectangle list. More...
 
 EdgeTable (const EdgeTable &)
 Creates a copy of another edge table. More...
 
 ~EdgeTable ()
 Destructor. More...
 
void clipLineToMask (int x, int y, const uint8 *mask, int maskStride, int numPixels)
 
void clipToEdgeTable (const EdgeTable &)
 
void clipToRectangle (Rectangle< int > r)
 
void excludeRectangle (Rectangle< int > r)
 
const Rectangle< int > & getMaximumBounds () const noexcept
 
bool isEmpty () noexcept
 
template<class EdgeTableIterationCallback >
void iterate (EdgeTableIterationCallback &iterationCallback) const noexcept
 Iterates the lines in the table, for rendering. More...
 
void multiplyLevels (float factor)
 Scales all the alpha-levels in the table by the given multiplier. More...
 
EdgeTableoperator= (const EdgeTable &)
 Copies from another edge table. More...
 
void optimiseTable ()
 Reduces the amount of space the table has allocated. More...
 
void translate (float dx, int dy) noexcept
 

Private Member Functions

void addEdgePoint (int x, int y, int winding)
 
void addEdgePointPair (int x1, int x2, int y, int winding)
 
void allocate ()
 
void clearLineSizes () noexcept
 
void clipEdgeTableLineToRange (int *line, int x1, int x2) noexcept
 
void intersectWithEdgeTableLine (int y, const int *otherLine)
 
void remapTableForNumEdges (int newNumEdgesPerLine)
 
void remapWithExtraSpace (int numPointsNeeded)
 
void sanitiseLevels (bool useNonZeroWinding) noexcept
 

Static Private Member Functions

static void copyEdgeTableData (int *dest, int destLineStride, const int *src, int srcLineStride, int numLines) noexcept
 

Private Attributes

Rectangle< intbounds
 
int lineStrideElements
 
int maxEdgesPerLine
 
bool needToCheckEmptiness = true
 
HeapBlock< inttable
 

Detailed Description

A table of horizontal scan-line segments - used for rasterising Paths.

See also
Path, Graphics

{Graphics}

Constructor & Destructor Documentation

◆ EdgeTable() [1/6]

juce::EdgeTable::EdgeTable ( Rectangle< int clipLimits,
const Path pathToAdd,
const AffineTransform transform 
)

Creates an edge table containing a path.

A table is created with a fixed vertical range, and only sections of the path which lie within this range will be added to the table.

Parameters
clipLimitsonly the region of the path that lies within this area will be added
pathToAddthe path to add to the table
transforma transform to apply to the path being added

◆ EdgeTable() [2/6]

juce::EdgeTable::EdgeTable ( Rectangle< int rectangleToAdd)
explicit

Creates an edge table containing a rectangle.

◆ EdgeTable() [3/6]

juce::EdgeTable::EdgeTable ( Rectangle< float rectangleToAdd)
explicit

Creates an edge table containing a rectangle.

◆ EdgeTable() [4/6]

juce::EdgeTable::EdgeTable ( const RectangleList< int > &  rectanglesToAdd)
explicit

Creates an edge table containing a rectangle list.

◆ EdgeTable() [5/6]

juce::EdgeTable::EdgeTable ( const RectangleList< float > &  rectanglesToAdd)
explicit

Creates an edge table containing a rectangle list.

◆ EdgeTable() [6/6]

juce::EdgeTable::EdgeTable ( const EdgeTable )

Creates a copy of another edge table.

◆ ~EdgeTable()

juce::EdgeTable::~EdgeTable ( )

Destructor.

Member Function Documentation

◆ addEdgePoint()

void juce::EdgeTable::addEdgePoint ( int  x,
int  y,
int  winding 
)
private

◆ addEdgePointPair()

void juce::EdgeTable::addEdgePointPair ( int  x1,
int  x2,
int  y,
int  winding 
)
private

◆ allocate()

void juce::EdgeTable::allocate ( )
private

◆ clearLineSizes()

void juce::EdgeTable::clearLineSizes ( )
privatenoexcept

◆ clipEdgeTableLineToRange()

void juce::EdgeTable::clipEdgeTableLineToRange ( int line,
int  x1,
int  x2 
)
privatenoexcept

◆ clipLineToMask()

◆ clipToEdgeTable()

◆ clipToRectangle()

◆ copyEdgeTableData()

static void juce::EdgeTable::copyEdgeTableData ( int dest,
int  destLineStride,
const int src,
int  srcLineStride,
int  numLines 
)
staticprivatenoexcept

◆ excludeRectangle()

void juce::EdgeTable::excludeRectangle ( Rectangle< int r)

◆ getMaximumBounds()

const Rectangle<int>& juce::EdgeTable::getMaximumBounds ( ) const
inlinenoexcept

◆ intersectWithEdgeTableLine()

void juce::EdgeTable::intersectWithEdgeTableLine ( int  y,
const int otherLine 
)
private

◆ isEmpty()

bool juce::EdgeTable::isEmpty ( )
noexcept

◆ iterate()

template<class EdgeTableIterationCallback >
void juce::EdgeTable::iterate ( EdgeTableIterationCallback &  iterationCallback) const
inlinenoexcept

Iterates the lines in the table, for rendering.

This function will iterate each line in the table, and call a user-defined class to render each pixel or continuous line of pixels that the table contains.

Parameters
iterationCallbackthis templated class must contain the following methods:
inline void setEdgeTableYPos (int y);
inline void handleEdgeTablePixel (int x, int alphaLevel) const;
inline void handleEdgeTablePixelFull (int x) const;
inline void handleEdgeTableLine (int x, int width, int alphaLevel) const;
inline void handleEdgeTableLineFull (int x, int width) const;
(these don't necessarily have to be 'const', but it might help it go faster)

References juce::isPositiveAndBelow(), and jassert.

◆ multiplyLevels()

void juce::EdgeTable::multiplyLevels ( float  factor)

Scales all the alpha-levels in the table by the given multiplier.

◆ operator=()

EdgeTable& juce::EdgeTable::operator= ( const EdgeTable )

Copies from another edge table.

◆ optimiseTable()

void juce::EdgeTable::optimiseTable ( )

Reduces the amount of space the table has allocated.

This will shrink the table down to use as little memory as possible - useful for read-only tables that get stored and re-used for rendering.

◆ remapTableForNumEdges()

void juce::EdgeTable::remapTableForNumEdges ( int  newNumEdgesPerLine)
private

◆ remapWithExtraSpace()

void juce::EdgeTable::remapWithExtraSpace ( int  numPointsNeeded)
private

◆ sanitiseLevels()

void juce::EdgeTable::sanitiseLevels ( bool  useNonZeroWinding)
privatenoexcept

◆ translate()

void juce::EdgeTable::translate ( float  dx,
int  dy 
)
noexcept

Member Data Documentation

◆ bounds

Rectangle<int> juce::EdgeTable::bounds
private

◆ lineStrideElements

int juce::EdgeTable::lineStrideElements
private

◆ maxEdgesPerLine

int juce::EdgeTable::maxEdgesPerLine
private

◆ needToCheckEmptiness

bool juce::EdgeTable::needToCheckEmptiness = true
private

◆ table

HeapBlock<int> juce::EdgeTable::table
private

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