112 void iterate (EdgeTableIterationCallback& iterationCallback)
const noexcept
114 const int* lineStart = table;
116 for (
int y = 0; y < bounds.getHeight(); ++y)
118 const int* line = lineStart;
119 lineStart += lineStrideElements;
120 int numPoints = line[0];
125 jassert ((x / scale) >= bounds.getX() && (x / scale) < bounds.getRight());
126 int levelAccumulator = 0;
128 iterationCallback.setEdgeTableYPos (bounds.getY() + y);
130 while (--numPoints >= 0)
132 const int level = *++line;
134 const int endX = *++line;
136 const int endOfRun = (endX / scale);
138 if (endOfRun == (x / scale))
142 levelAccumulator += (endX - x) * level;
148 levelAccumulator += (0x100 - (x & 0xff)) * level;
149 levelAccumulator /= scale;
152 if (levelAccumulator > 0)
154 if (levelAccumulator >= 255)
155 iterationCallback.handleEdgeTablePixelFull (x);
157 iterationCallback.handleEdgeTablePixel (x, levelAccumulator);
163 jassert (endOfRun <= bounds.getRight());
164 const int numPix = endOfRun - ++x;
167 iterationCallback.handleEdgeTableLine (x, numPix, level);
171 levelAccumulator = (endX & 0xff) * level;
177 levelAccumulator /= scale;
179 if (levelAccumulator > 0)
182 jassert (x >= bounds.getX() && x < bounds.getRight());
184 if (levelAccumulator >= 255)
185 iterationCallback.handleEdgeTablePixelFull (x);
187 iterationCallback.handleEdgeTablePixel (x, levelAccumulator);