25 #ifndef JUCE_EDGETABLE_H_INCLUDED
26 #define JUCE_EDGETABLE_H_INCLUDED
49 const Path& pathToAdd,
77 void clipLineToMask (
int x,
int y,
const uint8* mask,
int maskStride,
int numPixels);
83 void multiplyLevels (
float factor);
109 template <
class EdgeTableIterationCallback>
112 const int* lineStart = table;
114 for (
int y = 0; y < bounds.getHeight(); ++y)
116 const int* line = lineStart;
117 lineStart += lineStrideElements;
118 int numPoints = line[0];
123 jassert ((x >> 8) >= bounds.getX() && (x >> 8) < bounds.getRight());
124 int levelAccumulator = 0;
126 iterationCallback.setEdgeTableYPos (bounds.getY() + y);
128 while (--numPoints >= 0)
130 const int level = *++line;
132 const int endX = *++line;
134 const int endOfRun = (endX >> 8);
136 if (endOfRun == (x >> 8))
140 levelAccumulator += (endX - x) * level;
146 levelAccumulator += (0x100 - (x & 0xff)) * level;
147 levelAccumulator >>= 8;
150 if (levelAccumulator > 0)
152 if (levelAccumulator >= 255)
153 iterationCallback.handleEdgeTablePixelFull (x);
155 iterationCallback.handleEdgeTablePixel (x, levelAccumulator);
161 jassert (endOfRun <= bounds.getRight());
162 const int numPix = endOfRun - ++x;
165 iterationCallback.handleEdgeTableLine (x, numPix, level);
169 levelAccumulator = (endX & 0xff) * level;
175 levelAccumulator >>= 8;
177 if (levelAccumulator > 0)
180 jassert (x >= bounds.getX() && x < bounds.getRight());
182 if (levelAccumulator >= 255)
183 iterationCallback.handleEdgeTablePixelFull (x);
185 iterationCallback.handleEdgeTablePixel (x, levelAccumulator);
203 int maxEdgesPerLine, lineStrideElements;
204 bool needToCheckEmptiness;
208 void addEdgePoint (
int x,
int y,
int winding);
209 void addEdgePointPair (
int x1,
int x2,
int y,
int winding);
210 void remapTableForNumEdges (
int newNumEdgesPerLine);
211 void intersectWithEdgeTableLine (
int y,
const int* otherLine);
212 void clipEdgeTableLineToRange (
int* line,
int x1,
int x2)
noexcept;
213 void sanitiseLevels (
bool useNonZeroWinding) noexcept;
214 static
void copyEdgeTableData (
int* dest,
int destLineStride,
const int* src,
int srcLineStride,
int numLines) noexcept;
220 #endif // JUCE_EDGETABLE_H_INCLUDED
Definition: juce_EdgeTable.h:35
#define noexcept
Definition: juce_CompilerSupport.h:141
bool isPositiveAndBelow(Type valueToTest, Type upperLimit) noexcept
Definition: juce_core.h:238
Definition: juce_RectangleList.h:40
void iterate(EdgeTableIterationCallback &iterationCallback) const noexcept
Definition: juce_EdgeTable.h:110
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_Rectangle.h:36
Definition: juce_Path.h:62
JUCE_API bool JUCE_CALLTYPE operator<(const String &s1, const String &s2) noexcept
Definition: juce_core.cpp:590
Definition: juce_HeapBlock.h:90
JUCE_API String translate(const String &text)
Definition: juce_core.cpp:198
#define JUCE_LEAK_DETECTOR(OwnerClass)
Definition: juce_LeakedObjectDetector.h:141
unsigned char uint8
Definition: juce_MathsFunctions.h:43
const Rectangle< int > & getMaximumBounds() const noexcept
Definition: juce_EdgeTable.h:79