Go to the documentation of this file.
25 #ifndef JUCE_RENDERINGHELPERS_H_INCLUDED
26 #define JUCE_RENDERINGHELPERS_H_INCLUDED
29 #pragma warning (push)
30 #pragma warning (disable: 4127) // "expression is constant" warning
78 const int tx = (int) (t.getTranslationX() * 256.0f);
79 const int ty = (int) (t.getTranslationY() * 256.0f);
81 if (((tx | ty) & 0xf8) == 0)
119 template <
typename RectangleOrPo
int>
126 template <
typename Type>
140 template <
class CachedGlyphType,
class RenderTargetType>
151 getSingletonPointer() =
nullptr;
169 addNewGlyphSlots (120);
178 glyph->lastAccessCount = ++accessCounter;
179 glyph->draw (target, pos);
187 if (CachedGlyphType* g = findExistingGlyph (font, glyphNumber))
194 CachedGlyphType* g = getGlyphForReuse();
196 g->generate (font, glyphNumber);
206 CachedGlyphType* findExistingGlyph (
const Font& font,
int glyphNumber)
const
208 for (
int i = 0; i < glyphs.size(); ++i)
210 CachedGlyphType*
const g = glyphs.getUnchecked (i);
212 if (g->glyph == glyphNumber && g->font == font)
219 CachedGlyphType* getGlyphForReuse()
221 if (hits.
value + misses.
value > glyphs.size() * 16)
224 addNewGlyphSlots (32);
230 if (CachedGlyphType* g = findLeastRecentlyUsedGlyph())
233 addNewGlyphSlots (32);
234 return glyphs.getLast();
237 void addNewGlyphSlots (
int num)
239 glyphs.ensureStorageAllocated (glyphs.size() + num);
242 glyphs.add (
new CachedGlyphType());
245 CachedGlyphType* findLeastRecentlyUsedGlyph() const
noexcept
247 CachedGlyphType* oldest =
nullptr;
248 int oldestCounter = std::numeric_limits<int>::max();
250 for (
int i = glyphs.size() - 1; --i >= 0;)
252 CachedGlyphType*
const glyph = glyphs.getUnchecked(i);
254 if (glyph->lastAccessCount <= oldestCounter
255 && glyph->getReferenceCount() == 1)
257 oldestCounter = glyph->lastAccessCount;
276 template <
class RendererType>
285 pos.
x = std::floor (pos.
x + 0.5f);
301 fontHeight), fontHeight);
333 if ((
top & 255) == 0)
359 if ((
left & 255) == 0)
377 template <
class Callback>
403 namespace GradientPixelIterators
410 const PixelARGB*
const colours,
const int numColours)
411 : lookupTable (colours),
412 numEntries (numColours)
430 vertical = std::abs (p1.
x - p2.
x) < 0.001f;
431 horizontal = std::abs (p1.
y - p2.
y) < 0.001f;
435 scale =
roundToInt ((numEntries << (
int) numScaleBits) / (
double) (p2.
y - p1.
y));
440 scale =
roundToInt ((numEntries << (
int) numScaleBits) / (
double) (p2.
x - p1.
x));
445 grad = (p2.
getY() - p1.
y) / (
double) (p1.
x - p2.
x);
446 yTerm = p1.
getY() - p1.
x / grad;
447 scale =
roundToInt ((numEntries << (
int) numScaleBits) / (yTerm * grad - (p2.
y * grad - p2.
x)));
455 linePix = lookupTable [
jlimit (0, numEntries, (y * scale - start) >> (
int) numScaleBits)];
456 else if (! horizontal)
462 return vertical ? linePix
463 : lookupTable [
jlimit (0, numEntries, (x * scale - start) >> (
int) numScaleBits)];
468 const int numEntries;
472 bool vertical, horizontal;
473 enum { numScaleBits = 12 };
484 const PixelARGB*
const colours,
const int numColours)
487 gx1 (gradient.point1.x),
488 gy1 (gradient.point1.y)
527 const PixelARGB*
const colours,
const int numColours)
528 :
Radial (gradient, transform, colours, numColours),
529 inverseTransform (transform.inverted())
531 tM10 = inverseTransform.
mat10;
532 tM00 = inverseTransform.
mat00;
537 const float floatY = (float) y;
538 lineYM01 = inverseTransform.
mat01 * floatY + inverseTransform.
mat02 -
gx1;
539 lineYM11 = inverseTransform.
mat11 * floatY + inverseTransform.
mat12 -
gy1;
545 const double y = tM10 * x + lineYM11;
546 x = tM00 * x + lineYM01;
557 double tM10, tM00, lineYM01, lineYM11;
564 #define JUCE_PERFORM_PIXEL_OP_LOOP(op) \
566 const int destStride = destData.pixelStride; \
567 do { dest->op; dest = addBytesToPointer (dest, destStride); } while (--width > 0); \
572 namespace EdgeTableFillers
575 template <
class PixelType,
bool replaceExisting = false>
580 : destData (image), sourceColour (colour)
582 if (
sizeof (PixelType) == 3 && destData.
pixelStride == sizeof (PixelType))
584 areRGBComponentsEqual = sourceColour.
getRed() == sourceColour.
getGreen()
586 filler[0].
set (sourceColour);
587 filler[1].
set (sourceColour);
588 filler[2].
set (sourceColour);
589 filler[3].
set (sourceColour);
593 areRGBComponentsEqual =
false;
605 getPixel (x)->set (sourceColour);
607 getPixel (x)->blend (sourceColour, (
uint32) alphaLevel);
613 getPixel (x)->set (sourceColour);
615 getPixel (x)->blend (sourceColour);
623 PixelType* dest = getPixel (x);
625 if (replaceExisting || p.
getAlpha() >= 0xff)
626 replaceLine (dest, p, width);
628 blendLine (dest, p, width);
633 PixelType* dest = getPixel (x);
635 if (replaceExisting || sourceColour.
getAlpha() >= 0xff)
636 replaceLine (dest, sourceColour, width);
638 blendLine (dest, sourceColour, width);
643 PixelType* linePixels;
646 bool areRGBComponentsEqual;
653 inline void blendLine (PixelType* dest,
const PixelARGB colour,
int width)
const noexcept
662 if (areRGBComponentsEqual)
664 memset (dest, colour.getRed(), (
size_t) width * 3);
670 const int*
const intFiller =
reinterpret_cast<const int*
> (filler);
681 int* d =
reinterpret_cast<int*
> (dest);
685 dest =
reinterpret_cast<PixelRGB*
> (d);
706 memset (dest, colour.getAlpha(), (
size_t) width);
721 template <
class PixelType,
class GradientType>
726 const PixelARGB*
const colours,
const int numColours)
727 : GradientType (gradient, transform, colours, numColours - 1),
735 GradientType::setY (y);
740 getPixel (x)->blend (GradientType::getPixel (x), (
uint32) alphaLevel);
745 getPixel (x)->blend (GradientType::getPixel (x));
750 PixelType* dest = getPixel (x);
752 if (alphaLevel < 0xff)
760 PixelType* dest = getPixel (x);
766 PixelType* linePixels;
778 template <
class DestPixelType,
class SrcPixelType,
bool repeatPattern>
783 const int alpha,
const int x,
const int y)
786 extraAlpha (alpha + 1),
808 alphaLevel = (alphaLevel * extraAlpha) >> 8;
810 getDestPixel (x)->blend (*getSrcPixel (repeatPattern ? ((x - xOffset) % srcData.
width) : (x - xOffset)), (
uint32) alphaLevel);
815 getDestPixel (x)->blend (*getSrcPixel (repeatPattern ? ((x - xOffset) % srcData.
width) : (x - xOffset)), (
uint32) extraAlpha);
820 DestPixelType* dest = getDestPixel (x);
821 alphaLevel = (alphaLevel * extraAlpha) >> 8;
826 if (alphaLevel < 0xfe)
835 if (alphaLevel < 0xfe)
838 copyRow (dest, getSrcPixel (x), width);
844 DestPixelType* dest = getDestPixel (x);
849 if (extraAlpha < 0xfe)
858 if (extraAlpha < 0xfe)
861 copyRow (dest, getSrcPixel (x), width);
867 jassert (x - xOffset >= 0 && x + width - xOffset <= srcData.
width);
868 SrcPixelType* s = (SrcPixelType*) srcData.
getLinePointer (y - yOffset);
871 if (
sizeof (SrcPixelType) ==
sizeof (
PixelARGB))
880 const int extraAlpha, xOffset, yOffset;
881 DestPixelType* linePixels;
882 SrcPixelType* sourceLineStart;
894 forcedinline void copyRow (DestPixelType* dest, SrcPixelType
const* src,
int width)
const noexcept
899 if (destStride == srcStride
903 memcpy (dest, src, (
size_t) (width * srcStride));
912 }
while (--width > 0);
921 template <
class DestPixelType,
class SrcPixelType,
bool repeatPattern>
927 : interpolator (transform,
928 q !=
Graphics::lowResamplingQuality ? 0.5f : 0.0f,
929 q !=
Graphics::lowResamplingQuality ? -128 : 0),
932 extraAlpha (alpha + 1),
934 maxX (src.width - 1),
935 maxY (src.height - 1),
938 scratchBuffer.
malloc (scratchSize);
952 getDestPixel (x)->blend (p, (
uint32) (alphaLevel * extraAlpha) >> 8);
960 getDestPixel (x)->blend (p, (
uint32) extraAlpha);
965 if (width > (
int) scratchSize)
967 scratchSize = (size_t) width;
968 scratchBuffer.
malloc (scratchSize);
971 SrcPixelType* span = scratchBuffer;
972 generate (span, x, width);
974 DestPixelType* dest = getDestPixel (x);
975 alphaLevel *= extraAlpha;
978 if (alphaLevel < 0xfe)
991 if (width > (
int) scratchSize)
993 scratchSize = (size_t) width;
994 scratchBuffer.
malloc (scratchSize);
998 generate (scratchBuffer.
getData(), x, width);
1001 reinterpret_cast<uint8*
> (scratchBuffer.
getData()) + SrcPixelType::indexA,
1002 sizeof (SrcPixelType), width);
1012 template <
class PixelType>
1013 void generate (PixelType* dest,
const int x,
int numPixels)
noexcept
1015 this->interpolator.setStartOfLine ((
float) x, (
float) y, numPixels);
1020 this->interpolator.next (hiResX, hiResY);
1022 int loResX = hiResX >> 8;
1023 int loResY = hiResY >> 8;
1038 render4PixelAverage (dest, this->srcData.
getPixelPointer (loResX, loResY),
1039 hiResX & 255, hiResY & 255);
1044 if (! repeatPattern)
1048 render2PixelAverageX (dest, this->srcData.
getPixelPointer (loResX, 0), hiResX & 255);
1050 render2PixelAverageX (dest, this->srcData.
getPixelPointer (loResX, maxY), hiResX & 255);
1062 render2PixelAverageY (dest, this->srcData.
getPixelPointer (0, loResY), hiResY & 255);
1064 render2PixelAverageY (dest, this->srcData.
getPixelPointer (maxX, loResY), hiResY & 255);
1072 if (! repeatPattern)
1074 if (loResX < 0) loResX = 0;
1075 if (loResY < 0) loResY = 0;
1076 if (loResX > maxX) loResX = maxX;
1077 if (loResY > maxY) loResY = maxY;
1080 dest->set (*(
const PixelType*) this->srcData.
getPixelPointer (loResX, loResY));
1083 }
while (--numPixels > 0);
1087 void render4PixelAverage (
PixelARGB*
const dest,
const uint8* src,
const int subPixelX,
const int subPixelY)
noexcept
1089 uint32 c[4] = { 256 * 128, 256 * 128, 256 * 128, 256 * 128 };
1091 uint32 weight = (
uint32) ((256 - subPixelX) * (256 - subPixelY));
1092 c[0] += weight * src[0];
1093 c[1] += weight * src[1];
1094 c[2] += weight * src[2];
1095 c[3] += weight * src[3];
1099 weight = (
uint32) (subPixelX * (256 - subPixelY));
1100 c[0] += weight * src[0];
1101 c[1] += weight * src[1];
1102 c[2] += weight * src[2];
1103 c[3] += weight * src[3];
1107 weight = (
uint32) (subPixelX * subPixelY);
1108 c[0] += weight * src[0];
1109 c[1] += weight * src[1];
1110 c[2] += weight * src[2];
1111 c[3] += weight * src[3];
1115 weight = (
uint32) ((256 - subPixelX) * subPixelY);
1116 c[0] += weight * src[0];
1117 c[1] += weight * src[1];
1118 c[2] += weight * src[2];
1119 c[3] += weight * src[3];
1129 uint32 c[4] = { 128, 128, 128, 128 };
1131 uint32 weight = 256 - subPixelX;
1132 c[0] += weight * src[0];
1133 c[1] += weight * src[1];
1134 c[2] += weight * src[2];
1135 c[3] += weight * src[3];
1140 c[0] += weight * src[0];
1141 c[1] += weight * src[1];
1142 c[2] += weight * src[2];
1143 c[3] += weight * src[3];
1153 uint32 c[4] = { 128, 128, 128, 128 };
1155 uint32 weight = 256 - subPixelY;
1156 c[0] += weight * src[0];
1157 c[1] += weight * src[1];
1158 c[2] += weight * src[2];
1159 c[3] += weight * src[3];
1164 c[0] += weight * src[0];
1165 c[1] += weight * src[1];
1166 c[2] += weight * src[2];
1167 c[3] += weight * src[3];
1178 uint32 c[3] = { 256 * 128, 256 * 128, 256 * 128 };
1180 uint32 weight = (256 - subPixelX) * (256 - subPixelY);
1181 c[0] += weight * src[0];
1182 c[1] += weight * src[1];
1183 c[2] += weight * src[2];
1187 weight = subPixelX * (256 - subPixelY);
1188 c[0] += weight * src[0];
1189 c[1] += weight * src[1];
1190 c[2] += weight * src[2];
1194 weight = subPixelX * subPixelY;
1195 c[0] += weight * src[0];
1196 c[1] += weight * src[1];
1197 c[2] += weight * src[2];
1201 weight = (256 - subPixelX) * subPixelY;
1202 c[0] += weight * src[0];
1203 c[1] += weight * src[1];
1204 c[2] += weight * src[2];
1206 dest->setARGB ((
uint8) 255,
1214 uint32 c[3] = { 128, 128, 128 };
1216 const uint32 weight = 256 - subPixelX;
1217 c[0] += weight * src[0];
1218 c[1] += weight * src[1];
1219 c[2] += weight * src[2];
1223 c[0] += subPixelX * src[0];
1224 c[1] += subPixelX * src[1];
1225 c[2] += subPixelX * src[2];
1227 dest->setARGB ((
uint8) 255,
1235 uint32 c[3] = { 128, 128, 128 };
1237 const uint32 weight = 256 - subPixelY;
1238 c[0] += weight * src[0];
1239 c[1] += weight * src[1];
1240 c[2] += weight * src[2];
1244 c[0] += subPixelY * src[0];
1245 c[1] += subPixelY * src[1];
1246 c[2] += subPixelY * src[2];
1248 dest->setARGB ((
uint8) 255,
1258 c += src[0] * ((256 - subPixelX) * (256 - subPixelY));
1260 c += src[1] * (subPixelX * (256 - subPixelY));
1262 c += src[1] * (subPixelX * subPixelY);
1265 c += src[0] * ((256 - subPixelX) * subPixelY);
1273 c += src[0] * (256 - subPixelX);
1275 c += src[0] * subPixelX;
1282 c += src[0] * (256 - subPixelY);
1284 c += src[0] * subPixelY;
1289 class TransformedImageSpanInterpolator
1293 const float offsetFloat,
const int offsetInt)
noexcept
1294 : inverseTransform (transform.inverted()),
1295 pixelOffset (offsetFloat), pixelOffsetInt (offsetInt)
1298 void setStartOfLine (
float sx,
float sy,
const int numPixels)
noexcept
1304 float x1 = sx, y1 = sy;
1305 sx += (float) numPixels;
1306 inverseTransform.transformPoints (x1, y1, sx, sy);
1308 xBresenham.set ((
int) (x1 * 256.0f), (
int) (sx * 256.0f), numPixels, pixelOffsetInt);
1309 yBresenham.set ((
int) (y1 * 256.0f), (
int) (sy * 256.0f), numPixels, pixelOffsetInt);
1312 void next (
int& px,
int& py)
noexcept
1314 px = xBresenham.n; xBresenham.stepToNext();
1315 py = yBresenham.n; yBresenham.stepToNext();
1319 class BresenhamInterpolator
1322 BresenhamInterpolator()
noexcept {}
1324 void set (
const int n1,
const int n2,
const int steps,
const int offsetInt)
noexcept
1327 step = (n2 - n1) / numSteps;
1328 remainder = modulo = (n2 - n1) % numSteps;
1334 remainder += numSteps;
1343 modulo += remainder;
1356 int numSteps, step, modulo, remainder;
1360 BresenhamInterpolator xBresenham, yBresenham;
1361 const float pixelOffset;
1362 const int pixelOffsetInt;
1368 TransformedImageSpanInterpolator interpolator;
1371 const int extraAlpha;
1373 const int maxX, maxY;
1375 DestPixelType* linePixels;
1384 template <
class Iterator>
1446 template <
class Iterator>
1507 template <
class Iterator,
class DestPixelType>
1510 if (replaceContents)
1522 template <
class Iterator,
class DestPixelType>
1524 const PixelARGB*
const lookupTable,
const int numLookupEntries,
const bool isIdentity, DestPixelType*)
1531 iter.iterate (renderer);
1536 iter.iterate (renderer);
1542 iter.iterate (renderer);
1548 template <
class SavedStateType>
1646 const int imageX = ((tx + 128) >> 8);
1647 const int imageY = ((ty + 128) >> 8);
1650 straightClipImage (srcData, imageX, imageY, (
PixelARGB*) 0);
1652 straightClipImage (srcData, imageX, imageY, (
PixelAlpha*) 0);
1671 transformedClipImage (srcData, transform, quality, (
PixelARGB*) 0);
1673 transformedClipImage (srcData, transform, quality, (
PixelAlpha*) 0);
1703 state.fillWithSolidColour (et.
edgeTable, colour, replaceContents);
1716 state.fillWithSolidColour (et.
edgeTable, colour,
false);
1722 state.fillWithSolidColour (
edgeTable, colour, replaceContents);
1727 state.fillWithGradient (
edgeTable, gradient, transform, isIdentity);
1732 state.renderImageTransformed (
edgeTable, src, alpha, transform, quality, tiledFill);
1737 state.renderImageUntransformed (
edgeTable, src, alpha, x, y, tiledFill);
1743 template <
class SrcPixelType>
1753 template <
class SrcPixelType>
1754 void straightClipImage (
const Image::BitmapData& srcData,
int imageX,
int imageY,
const SrcPixelType*)
1761 for (
int y = 0; y < r.getHeight(); ++y)
1762 renderer.clipEdgeTableLine (
edgeTable, r.getX(), y + r.getY(), r.getWidth());
1804 return toEdgeTable()->clipToImageAlpha (image, transform, quality);
1813 SubRectangleIterator iter (
clip, area);
1814 state.fillWithSolidColour (iter, colour, replaceContents);
1819 SubRectangleIteratorFloat iter (
clip, area);
1820 state.fillWithSolidColour (iter, colour,
false);
1825 state.fillWithSolidColour (*
this, colour, replaceContents);
1830 state.fillWithGradient (*
this, gradient, transform, isIdentity);
1835 state.renderImageTransformed (*
this, src, alpha, transform, quality, tiledFill);
1840 state.renderImageUntransformed (*
this, src, alpha, x, y, tiledFill);
1846 template <
class Renderer>
1851 const int x = i->getX();
1852 const int w = i->getWidth();
1854 const int bottom = i->getBottom();
1856 for (
int y = i->getY(); y < bottom; ++y)
1858 r.setEdgeTableYPos (y);
1859 r.handleEdgeTableLineFull (x, w);
1866 class SubRectangleIterator
1870 :
clip (clipList), area (clipBounds)
1873 template <
class Renderer>
1880 if (! rect.isEmpty())
1882 const int x = rect.getX();
1883 const int w = rect.getWidth();
1884 const int bottom = rect.getBottom();
1886 for (
int y = rect.getY(); y < bottom; ++y)
1888 r.setEdgeTableYPos (y);
1889 r.handleEdgeTableLineFull (x, w);
1903 class SubRectangleIteratorFloat
1907 :
clip (clipList), area (clipBounds)
1911 template <
class Renderer>
1918 const int clipLeft = i->getX();
1919 const int clipRight = i->getRight();
1920 const int clipTop = i->getY();
1921 const int clipBottom = i->getBottom();
1923 if (f.totalBottom > clipTop && f.totalTop < clipBottom
1924 && f.totalRight > clipLeft && f.totalLeft < clipRight)
1926 if (f.isOnePixelWide())
1928 if (f.topAlpha != 0 && f.totalTop >= clipTop)
1930 r.setEdgeTableYPos (f.totalTop);
1931 r.handleEdgeTablePixel (f.left, f.topAlpha);
1934 const int endY =
jmin (f.bottom, clipBottom);
1935 for (
int y =
jmax (clipTop, f.top); y < endY; ++y)
1937 r.setEdgeTableYPos (y);
1938 r.handleEdgeTablePixelFull (f.left);
1941 if (f.bottomAlpha != 0 && f.bottom < clipBottom)
1943 r.setEdgeTableYPos (f.bottom);
1944 r.handleEdgeTablePixel (f.left, f.bottomAlpha);
1949 const int clippedLeft =
jmax (f.left, clipLeft);
1950 const int clippedWidth =
jmin (f.right, clipRight) - clippedLeft;
1951 const bool doLeftAlpha = f.leftAlpha != 0 && f.totalLeft >= clipLeft;
1952 const bool doRightAlpha = f.rightAlpha != 0 && f.right < clipRight;
1954 if (f.topAlpha != 0 && f.totalTop >= clipTop)
1956 r.setEdgeTableYPos (f.totalTop);
1958 if (doLeftAlpha) r.handleEdgeTablePixel (f.totalLeft, f.getTopLeftCornerAlpha());
1959 if (clippedWidth > 0) r.handleEdgeTableLine (clippedLeft, clippedWidth, f.topAlpha);
1960 if (doRightAlpha) r.handleEdgeTablePixel (f.right, f.getTopRightCornerAlpha());
1963 const int endY =
jmin (f.bottom, clipBottom);
1964 for (
int y =
jmax (clipTop, f.top); y < endY; ++y)
1966 r.setEdgeTableYPos (y);
1968 if (doLeftAlpha) r.handleEdgeTablePixel (f.totalLeft, f.leftAlpha);
1969 if (clippedWidth > 0) r.handleEdgeTableLineFull (clippedLeft, clippedWidth);
1970 if (doRightAlpha) r.handleEdgeTablePixel (f.right, f.rightAlpha);
1973 if (f.bottomAlpha != 0 && f.bottom < clipBottom)
1975 r.setEdgeTableYPos (f.bottom);
1977 if (doLeftAlpha) r.handleEdgeTablePixel (f.totalLeft, f.getBottomLeftCornerAlpha());
1978 if (clippedWidth > 0) r.handleEdgeTableLine (clippedLeft, clippedWidth, f.bottomAlpha);
1979 if (doRightAlpha) r.handleEdgeTablePixel (f.right, f.getBottomRightCornerAlpha());
1993 Ptr toEdgeTable()
const {
return new EdgeTableRegion (
clip); }
2000 template <
class SavedStateType>
2031 if (
clip !=
nullptr)
2051 return clip !=
nullptr;
2056 if (
clip !=
nullptr)
2063 clip =
clip->clipToRectangleList (offsetList);
2073 clip =
clip->clipToRectangleList (scaledList);
2081 return clip !=
nullptr;
2086 const int x1 = (int) std::ceil (r.
getX());
2087 const int y1 = (int) std::ceil (r.
getY());
2088 const int x2 = (int) std::floor (r.
getRight());
2089 const int y2 = (int) std::floor (r.
getBottom());
2096 if (
clip !=
nullptr)
2119 return clip !=
nullptr;
2124 if (
clip !=
nullptr)
2133 if (
clip !=
nullptr)
2151 if (
clip !=
nullptr)
2203 template <
typename CoordType>
2213 if (
clip !=
nullptr)
2233 if (
clip !=
nullptr)
2246 if (
clip !=
nullptr)
2268 if (
clip !=
nullptr)
2274 if (
clip !=
nullptr)
2283 if (brightness > 0.0f)
2306 return (std::abs (t.
mat01) < 0.002)
2307 && (std::abs (t.
mat10) < 0.002)
2308 && (std::abs (t.
mat00 - 1.0f) < 0.002)
2309 && (std::abs (t.
mat11 - 1.0f) < 0.002);
2327 tx = ((tx + 128) >> 8);
2328 ty = ((ty + 128) >> 8);
2330 if (tiledFillClipRegion !=
nullptr)
2341 c->renderImageUntransformed (
getThis(), sourceImage, alpha, tx, ty,
false);
2350 if (tiledFillClipRegion !=
nullptr)
2360 c = c->clipToPath (p, t);
2372 shapeToFill =
clip->applyClipTo (shapeToFill);
2374 if (shapeToFill !=
nullptr)
2394 shapeToFill->fillAllWithGradient (
getThis(), g2, t, isIdentity);
2409 if (
clip->getReferenceCount() > 1)
2445 if (
clip !=
nullptr)
2461 if (
clip !=
nullptr)
2481 if (
clip !=
nullptr)
2501 if (std::abs (xScale - 1.0f) > 0.01f)
2504 cache.
drawGlyph (*
this, f, glyphNumber, pos);
2525 template <
typename IteratorType>
2533 template <
typename IteratorType>
2541 template <
typename IteratorType>
2554 template <
typename IteratorType>
2559 jassert (numLookupEntries > 0);
2580 template <
class StateObjectType>
2585 : currentState (initialState)
2592 currentState = state;
2600 stack.
add (
new StateObjectType (*currentState));
2605 if (StateObjectType*
const top = stack.
getLast())
2619 currentState = currentState->beginTransparencyLayer (opacity);
2626 currentState->endTransparencyLayer (*finishedTransparencyLayer);
2637 template <
class SavedStateType>
2680 #pragma warning (pop)
2683 #endif // JUCE_RENDERINGHELPERS_H_INCLUDED
bool snapToIntegerCoordinate
Definition: juce_RenderingHelpers.h:307
ReferenceCountedObjectPtr< Base > Ptr
Definition: juce_RenderingHelpers.h:1557
ValueType getWidth() const noexcept
Definition: juce_Rectangle.h:113
~GlyphCache()
Definition: juce_RenderingHelpers.h:149
void fillRectWithColour(SavedStateType &state, const Rectangle< float > &area, const PixelARGB colour) const
Definition: juce_RenderingHelpers.h:1707
ValueType x
Definition: juce_Point.h:226
forcedinline void setY(const int y) noexcept
Definition: juce_RenderingHelpers.h:452
EdgeTableRegion(const RectangleList< int > &r)
Definition: juce_RenderingHelpers.h:1588
void fillRectWithColour(SavedStateType &state, const Rectangle< float > &area, const PixelARGB colour) const
Definition: juce_RenderingHelpers.h:1817
int leftAlpha
Definition: juce_RenderingHelpers.h:398
Definition: juce_Path.h:62
forcedinline void setEdgeTableYPos(const int y) noexcept
Definition: juce_RenderingHelpers.h:597
virtual Ptr clipToRectangleList(const RectangleList< int > &)=0
Colour colour
Definition: juce_FillType.h:122
Image image
Definition: juce_RenderingHelpers.h:2572
void multiplyLevels(float factor)
Definition: juce_EdgeTable.cpp:477
CachedGlyphEdgeTable()
Definition: juce_RenderingHelpers.h:280
Definition: juce_PixelFormats.h:610
bool clipTo(const RectangleType &rect)
Definition: juce_RectangleList.h:311
void handleEdgeTableLine(int x, int width, int alphaLevel) const noexcept
Definition: juce_RenderingHelpers.h:818
void beginTransparencyLayer(float opacity)
Definition: juce_RenderingHelpers.h:2616
virtual void fillAllWithColour(SavedStateType &, const PixelARGB colour, bool replaceContents) const =0
void applyTransform(const AffineTransform &transform) noexcept
Definition: juce_Path.cpp:916
void endTransparencyLayer() override
Definition: juce_RenderingHelpers.h:2656
int bottomAlpha
Definition: juce_RenderingHelpers.h:398
@ indexB
Definition: juce_PixelFormats.h:566
unsigned int uint32
Definition: juce_MathsFunctions.h:51
Radial(const ColourGradient &gradient, const AffineTransform &, const PixelARGB *const colours, const int numColours)
Definition: juce_RenderingHelpers.h:483
bool clipToRectangle(const Rectangle< int > &r) override
Definition: juce_RenderingHelpers.h:2648
Font font
Definition: juce_RenderingHelpers.h:2573
bool clipRegionIntersects(const Rectangle< int > &r) const
Definition: juce_RenderingHelpers.h:1684
void restoreState() override
Definition: juce_RenderingHelpers.h:2654
void renderImageUntransformed(SavedStateType &state, const Image &src, const int alpha, int x, int y, bool tiledFill) const
Definition: juce_RenderingHelpers.h:1838
virtual void translate(Point< int > delta)=0
int glyph
Definition: juce_RenderingHelpers.h:306
ValueType getY() const noexcept
Definition: juce_Rectangle.h:110
Point< float > point2
Definition: juce_ColourGradient.h:145
void save()
Definition: juce_RenderingHelpers.h:2598
void clipLineToMask(int x, int y, const uint8 *mask, int maskStride, int numPixels)
Definition: juce_EdgeTable.cpp:768
float getHorizontalScale() const noexcept
Definition: juce_Font.cpp:565
float getBrightness() const noexcept
Definition: juce_Colour.cpp:334
void iterate(Renderer &r) const noexcept
Definition: juce_RenderingHelpers.h:1847
Definition: juce_EdgeTable.h:35
void fillEdgeTable(const EdgeTable &edgeTable, const float x, const int y)
Definition: juce_RenderingHelpers.h:2272
bool clipToRectangleList(const RectangleList< int > &r)
Definition: juce_RenderingHelpers.h:2054
void renderSolidFill(Iterator &iter, const Image::BitmapData &destData, const PixelARGB fillColour, const bool replaceContents, DestPixelType *)
Definition: juce_RenderingHelpers.h:1508
bool clipRegionIntersects(const Rectangle< int > &r) override
Definition: juce_RenderingHelpers.h:2647
void handleEdgeTableLineFull(int x, int width) const noexcept
Definition: juce_RenderingHelpers.h:842
Definition: juce_ContainerDeletePolicy.h:44
#define nullptr
Definition: juce_CompilerSupport.h:151
Rectangle< int > getClipBounds() const
Definition: juce_RenderingHelpers.h:1809
int totalBottom
Definition: juce_RenderingHelpers.h:397
@ lowResamplingQuality
Definition: juce_GraphicsContext.h:467
SavedStateType & getThis() noexcept
Definition: juce_RenderingHelpers.h:2027
void beginTransparencyLayer(float opacity) override
Definition: juce_RenderingHelpers.h:2655
EdgeTableRegion(const EdgeTable &e)
Definition: juce_RenderingHelpers.h:1585
void handleEdgeTableLineFull(int x, int width) const noexcept
Definition: juce_RenderingHelpers.h:758
void initialise(StateObjectType *state)
Definition: juce_RenderingHelpers.h:2590
virtual Ptr clipToImageAlpha(const Image &, const AffineTransform &, const Graphics::ResamplingQuality)=0
@ readWrite
Definition: juce_Image.h:313
void fillAllWithColour(SavedStateType &state, const PixelARGB colour, bool replaceContents) const
Definition: juce_RenderingHelpers.h:1720
virtual Ptr excludeClipRectangle(const Rectangle< int > &)=0
bool isPositiveAndBelow(Type valueToTest, Type upperLimit) noexcept
Definition: juce_MathsFunctions.h:237
void fillPath(const Path &path, const AffineTransform &t)
Definition: juce_RenderingHelpers.h:2266
Typeface * getTypeface() const
Definition: juce_Font.cpp:395
StackBasedLowLevelGraphicsContext()
Definition: juce_RenderingHelpers.h:2672
void fillRect(const Rectangle< int > &r, const bool replaceContents)
Definition: juce_RenderingHelpers.h:2211
AffineTransform transform
Definition: juce_FillType.h:138
float getHeight() const noexcept
Definition: juce_Font.cpp:625
Ptr clipToPath(const Path &p, const AffineTransform &transform)
Definition: juce_RenderingHelpers.h:1621
void translate(Point< int > delta)
Definition: juce_RenderingHelpers.h:1807
void drawLine(const Line< float > &line) override
Definition: juce_RenderingHelpers.h:2666
void renderImageUntransformed(Iterator &iter, const Image::BitmapData &destData, const Image::BitmapData &srcData, const int alpha, int x, int y, bool tiledFill)
Definition: juce_RenderingHelpers.h:1447
ValueType getBottom() const noexcept
Definition: juce_Rectangle.h:122
void renderImageTransformed(IteratorType &iter, const Image &src, const int alpha, const AffineTransform &trans, Graphics::ResamplingQuality quality, bool tiledFill) const
Definition: juce_RenderingHelpers.h:2526
Definition: juce_FillType.h:38
forcedinline void handleEdgeTableLineFull(const int x, const int width) const noexcept
Definition: juce_RenderingHelpers.h:631
volatile Type value
Definition: juce_Atomic.h:153
void fillWithSolidColour(IteratorType &iter, const PixelARGB colour, bool replaceContents) const
Definition: juce_RenderingHelpers.h:2542
@ RGB
Definition: juce_Image.h:63
bool isEmpty() const noexcept
Definition: juce_Rectangle.h:101
void renderImageUntransformed(IteratorType &iter, const Image &src, const int alpha, int x, int y, bool tiledFill) const
Definition: juce_RenderingHelpers.h:2534
void setFill(const FillType &fillType) override
Definition: juce_RenderingHelpers.h:2657
void clipToEdgeTable(const EdgeTable &)
Definition: juce_EdgeTable.cpp:733
forcedinline void handleEdgeTablePixel(const int x, int alphaLevel) const noexcept
Definition: juce_RenderingHelpers.h:806
forcedinline uint8 getRed() const noexcept
Definition: juce_PixelFormats.h:107
Definition: juce_RenderingHelpers.h:277
bool hasAlphaChannel() const noexcept
Definition: juce_Image.cpp:266
forcedinline uint8 getGreen() const noexcept
Definition: juce_PixelFormats.h:108
RectangleListRegion(const RectangleListRegion &other)
Definition: juce_RenderingHelpers.h:1774
ValueType getY() const noexcept
Definition: juce_Point.h:68
Definition: juce_RenderingHelpers.h:722
int totalTop
Definition: juce_RenderingHelpers.h:397
void endTransparencyLayer(SoftwareRendererSavedState &finishedLayerState)
Definition: juce_RenderingHelpers.h:2459
BaseRegionType::Ptr clip
Definition: juce_RenderingHelpers.h:2413
Type * addBytesToPointer(Type *basePointer, IntegerType bytes) noexcept
Definition: juce_Memory.h:53
Base::Ptr Ptr
Definition: juce_RenderingHelpers.h:1776
void setFont(const Font &newFont) override
Definition: juce_RenderingHelpers.h:2667
virtual bool isHinted() const
Definition: juce_Typeface.h:123
Definition: juce_CriticalSection.h:47
void addLineSegment(const Line< float > &line, float lineThickness)
Definition: juce_Path.cpp:674
void fillAllWithGradient(SavedStateType &state, ColourGradient &gradient, const AffineTransform &transform, bool isIdentity) const
Definition: juce_RenderingHelpers.h:1725
void renderImageTransformed(Iterator &iter, const Image::BitmapData &destData, const Image::BitmapData &srcData, const int alpha, const AffineTransform &transform, Graphics::ResamplingQuality quality, bool tiledFill)
Definition: juce_RenderingHelpers.h:1385
@ indexA
Definition: juce_PixelFormats.h:309
ReferenceCountedObjectPtr< CachedGlyphType > findOrCreateGlyph(const Font &font, int glyphNumber)
Definition: juce_RenderingHelpers.h:183
static void clearGlyphCache()
Definition: juce_RenderingHelpers.h:2473
#define JUCE_PERFORM_PIXEL_OP_LOOP(op)
Definition: juce_RenderingHelpers.h:564
Definition: juce_LowLevelGraphicsContext.h:43
uint8 getAlpha() const noexcept
Definition: juce_Colour.h:200
Definition: juce_Image.h:54
forcedinline void multiplyAlpha(int multiplier) noexcept
Definition: juce_PixelFormats.h:219
Definition: juce_RenderingHelpers.h:316
void fillRect(const Rectangle< int > &r, bool replace) override
Definition: juce_RenderingHelpers.h:2660
void drawGlyph(int glyphNumber, const AffineTransform &t) override
Definition: juce_RenderingHelpers.h:2665
Definition: juce_ScopedLock.h:59
int getWidth() const noexcept
Definition: juce_Image.cpp:259
LowLevelGraphicsContext * createLowLevelContext() const
Definition: juce_Image.cpp:268
void translate(float dx, int dy) noexcept
Definition: juce_EdgeTable.cpp:456
ScopedPointer< EdgeTable > edgeTable
Definition: juce_RenderingHelpers.h:305
ValueType getRight() const noexcept
Definition: juce_Rectangle.h:119
bool isEmpty() const noexcept
Definition: juce_RectangleList.h:82
StateObjectType & operator*() const noexcept
Definition: juce_RenderingHelpers.h:2596
void renderImageTransformed(SavedStateType &state, const Image &src, const int alpha, const AffineTransform &transform, Graphics::ResamplingQuality quality, bool tiledFill) const
Definition: juce_RenderingHelpers.h:1833
Definition: juce_GraphicsContext.h:42
Point< float > toFloat() const noexcept
Definition: juce_Point.h:214
bool isTiledImage() const noexcept
Definition: juce_FillType.h:83
void setFillType(const FillType &newFill)
Definition: juce_RenderingHelpers.h:2168
Definition: juce_RenderingHelpers.h:1549
SavedStateBase(const SavedStateBase &other)
Definition: juce_RenderingHelpers.h:2020
Base()
Definition: juce_RenderingHelpers.h:1554
virtual void fillRectWithColour(SavedStateType &, const Rectangle< int > &, const PixelARGB colour, bool replaceContents) const =0
void fillTargetRect(const Rectangle< int > &r, const bool replaceContents)
Definition: juce_RenderingHelpers.h:2173
void fillAllWithColour(SavedStateType &state, const PixelARGB colour, bool replaceContents) const
Definition: juce_RenderingHelpers.h:1823
@ indexR
Definition: juce_PixelFormats.h:566
int bottom
Definition: juce_RenderingHelpers.h:396
#define noexcept
Definition: juce_CompilerSupport.h:141
ScopedPointer< ColourGradient > gradient
Definition: juce_FillType.h:129
Ptr excludeClipRectangle(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:1793
Type jlimit(const Type lowerLimit, const Type upperLimit, const Type valueToConstrain) noexcept
Definition: juce_MathsFunctions.h:220
ClipRegions< SavedStateType >::Base BaseRegionType
Definition: juce_RenderingHelpers.h:2004
ValueType getX() const noexcept
Definition: juce_Rectangle.h:107
int getTopRightCornerAlpha() const noexcept
Definition: juce_RenderingHelpers.h:391
void setHorizontalScale(float scaleFactor)
Definition: juce_Font.cpp:558
PixelARGB getPixel(const int px) const noexcept
Definition: juce_RenderingHelpers.h:503
Ptr clipToImageAlpha(const Image &image, const AffineTransform &transform, const Graphics::ResamplingQuality quality)
Definition: juce_RenderingHelpers.h:1634
Ptr applyClipTo(const Ptr &target) const
Definition: juce_RenderingHelpers.h:1779
Definition: juce_RenderingHelpers.h:33
ValueType getHeight() const noexcept
Definition: juce_Rectangle.h:116
void fillAllWithGradient(SavedStateType &state, ColourGradient &gradient, const AffineTransform &transform, bool isIdentity) const
Definition: juce_RenderingHelpers.h:1828
void setInterpolationQuality(Graphics::ResamplingQuality quality) override
Definition: juce_RenderingHelpers.h:2659
Type jmin(const Type a, const Type b)
Definition: juce_MathsFunctions.h:112
virtual Ptr clipToRectangle(const Rectangle< int > &)=0
virtual Ptr applyClipTo(const Ptr &target) const =0
void setHeight(float newHeight)
Definition: juce_Font.cpp:455
bool isGradient() const noexcept
Definition: juce_FillType.h:80
bool intersects(const Rectangle &other) const noexcept
Definition: juce_Rectangle.h:586
void removeLast(int howManyToRemove=1, bool deleteObjects=true)
Definition: juce_OwnedArray.h:715
Ptr applyClipTo(const Ptr &target) const
Definition: juce_RenderingHelpers.h:1596
Gradient(const Image::BitmapData &dest, const ColourGradient &gradient, const AffineTransform &transform, const PixelARGB *const colours, const int numColours)
Definition: juce_RenderingHelpers.h:725
Image image
Definition: juce_FillType.h:135
Definition: juce_PixelFormats.h:361
void fillRectList(const RectangleList< float > &list)
Definition: juce_RenderingHelpers.h:2244
Point< ValueType > getPosition() const noexcept
Definition: juce_Rectangle.h:141
virtual void setOpacity(float)=0
void fillPath(const Path &path, const AffineTransform &t) override
Definition: juce_RenderingHelpers.h:2663
const Rectangle< int > & getMaximumBounds() const noexcept
Definition: juce_EdgeTable.h:79
void offsetAll(Point< ValueType > offset) noexcept
Definition: juce_RectangleList.h:597
Type jmax(const Type a, const Type b)
Definition: juce_MathsFunctions.h:100
Graphics::ResamplingQuality interpolationQuality
Definition: juce_RenderingHelpers.h:2416
Base::Ptr Ptr
Definition: juce_RenderingHelpers.h:1593
forcedinline void handleEdgeTablePixelFull(const int x) const noexcept
Definition: juce_RenderingHelpers.h:813
void clipToPath(const Path &path, const AffineTransform &t) override
Definition: juce_RenderingHelpers.h:2651
bool isColour() const noexcept
Definition: juce_FillType.h:77
@ readOnly
Definition: juce_Image.h:311
SavedStateStack() noexcept
Definition: juce_RenderingHelpers.h:2588
bool clipRegionIntersects(const Rectangle< int > &r) const
Definition: juce_RenderingHelpers.h:2149
Rectangle getIntersection(const Rectangle &other) const noexcept
Definition: juce_Rectangle.h:609
void fillRectWithColour(SavedStateType &state, const Rectangle< int > &area, const PixelARGB colour, bool replaceContents) const
Definition: juce_RenderingHelpers.h:1811
float getOpacity() const noexcept
Definition: juce_FillType.h:106
PixelARGB getPixel(const int x) const noexcept
Definition: juce_RenderingHelpers.h:460
virtual bool clipRegionIntersects(const Rectangle< int > &) const =0
void restore()
Definition: juce_RenderingHelpers.h:2603
int getTopLeftCornerAlpha() const noexcept
Definition: juce_RenderingHelpers.h:390
uint8 * getLinePointer(int y) const noexcept
Definition: juce_Image.h:325
void fillRect(const Rectangle< float > &r) override
Definition: juce_RenderingHelpers.h:2661
bool clipToRectangle(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:2029
EdgeTableRegion(const Rectangle< float > &r)
Definition: juce_RenderingHelpers.h:1587
void drawImage(const Image &im, const AffineTransform &t) override
Definition: juce_RenderingHelpers.h:2664
void saveState() override
Definition: juce_RenderingHelpers.h:2653
forcedinline void handleEdgeTablePixelFull(const int x) const noexcept
Definition: juce_RenderingHelpers.h:743
Rectangle< float > toFloat() const noexcept
Definition: juce_Rectangle.h:792
void multiplyOpacity(float multiplier) noexcept
Definition: juce_ColourGradient.cpp:90
float transparencyLayerAlpha
Definition: juce_RenderingHelpers.h:2417
int roundToInt(const FloatType value) noexcept
Definition: juce_MathsFunctions.h:417
int getBottomRightCornerAlpha() const noexcept
Definition: juce_RenderingHelpers.h:393
int getHeight() const noexcept
Definition: juce_Image.cpp:260
ObjectClass * getLast() const noexcept
Definition: juce_OwnedArray.h:184
SoftwareRendererSavedState * beginTransparencyLayer(float opacity)
Definition: juce_RenderingHelpers.h:2441
unsigned char uint8
Definition: juce_MathsFunctions.h:43
bool isTransparent() const noexcept
Definition: juce_Colour.cpp:244
Definition: juce_RenderingHelpers.h:1582
Definition: juce_RenderingHelpers.h:2001
const RectangleType * begin() const noexcept
Definition: juce_RectangleList.h:641
StateObjectType * operator->() const noexcept
Definition: juce_RenderingHelpers.h:2595
Point< ValueType > findNearestPointTo(const Point< ValueType > point) const noexcept
Definition: juce_Line.h:312
int getBottomLeftCornerAlpha() const noexcept
Definition: juce_RenderingHelpers.h:392
forcedinline void setY(const int y) noexcept
Definition: juce_RenderingHelpers.h:497
Ptr clipToRectangle(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:1598
@ ARGB
Definition: juce_Image.h:64
const double gy1
Definition: juce_RenderingHelpers.h:515
SoftwareRendererSavedState(const Image &im, const Rectangle< int > &clipBounds)
Definition: juce_RenderingHelpers.h:2426
int lastAccessCount
Definition: juce_RenderingHelpers.h:306
Ptr clipToImageAlpha(const Image &image, const AffineTransform &transform, const Graphics::ResamplingQuality quality)
Definition: juce_RenderingHelpers.h:1802
virtual void fillAllWithGradient(SavedStateType &, ColourGradient &, const AffineTransform &, bool isIdentity) const =0
int right
Definition: juce_RenderingHelpers.h:396
Definition: juce_RenderingHelpers.h:480
bool excludeClipRectangle(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:2094
Definition: juce_Font.h:39
SoftwareRendererSavedState(const Image &im, const RectangleList< int > &clipList, Point< int > origin)
Definition: juce_RenderingHelpers.h:2431
Definition: juce_RenderingHelpers.h:1769
static bool isOnlyTranslationAllowingError(const AffineTransform &t)
Definition: juce_RenderingHelpers.h:2304
Ptr clone() const
Definition: juce_RenderingHelpers.h:1778
GlyphCache< CachedGlyphEdgeTable< SoftwareRendererSavedState >, SoftwareRendererSavedState > GlyphCacheType
Definition: juce_RenderingHelpers.h:2471
virtual Ptr clipToPath(const Path &, const AffineTransform &)=0
bool isRadial
Definition: juce_ColourGradient.h:152
void endTransparencyLayer()
Definition: juce_RenderingHelpers.h:2622
Point transformedBy(const AffineTransform &transform) const noexcept
Definition: juce_Point.h:203
SavedStateBase(const RectangleList< int > &clipList, Point< int > origin)
Definition: juce_RenderingHelpers.h:2014
EdgeTableRegion(const RectangleList< float > &r)
Definition: juce_RenderingHelpers.h:1589
void drawImage(const Image &sourceImage, const AffineTransform &trans)
Definition: juce_RenderingHelpers.h:2298
static Rectangle< int > getLargestIntegerWithin(Rectangle< float > r)
Definition: juce_RenderingHelpers.h:2084
Definition: juce_Line.h:44
void clipToImageAlpha(const Image &im, const AffineTransform &t) override
Definition: juce_RenderingHelpers.h:2652
Definition: juce_RenderingHelpers.h:2581
forcedinline void setEdgeTableYPos(int y) noexcept
Definition: juce_RenderingHelpers.h:792
int rightAlpha
Definition: juce_RenderingHelpers.h:398
virtual void drawImage(const Image &, const AffineTransform &)=0
void drawLine(const Line< float > &line)
Definition: juce_RenderingHelpers.h:2291
void malloc(const size_t newNumElements, const size_t elementSize=sizeof(ElementType))
Definition: juce_HeapBlock.h:220
int totalLeft
Definition: juce_RenderingHelpers.h:397
Point< ValueType > getPointAlongLine(ValueType distanceFromStart) const noexcept
Definition: juce_Line.h:200
virtual Ptr clipToEdgeTable(const EdgeTable &et)=0
ClipRegions< SavedStateType >::RectangleListRegion RectangleListRegionType
Definition: juce_RenderingHelpers.h:2006
Font font
Definition: juce_RenderingHelpers.h:304
virtual void renderImageUntransformed(SavedStateType &, const Image &, const int alpha, int x, int y, bool tiledFill) const =0
StackBasedLowLevelGraphicsContext(SavedStateType *initialState)
Definition: juce_RenderingHelpers.h:2671
Definition: juce_Image.h:306
Rectangle< int > getBounds() const noexcept
Definition: juce_Image.cpp:261
Definition: juce_PixelFormats.h:56
void fillTargetRect(const Rectangle< float > &r)
Definition: juce_RenderingHelpers.h:2188
RenderingHelpers::TranslationOrTransform transform
Definition: juce_RenderingHelpers.h:2414
Rectangle< int > getClipBounds() const override
Definition: juce_RenderingHelpers.h:2645
virtual EdgeTable * getEdgeTableForGlyph(int glyphNumber, const AffineTransform &transform, float fontHeight)
Definition: juce_Typeface.cpp:119
Definition: juce_RenderingHelpers.h:141
void renderImage(const Image &sourceImage, const AffineTransform &trans, const BaseRegionType *const tiledFillClipRegion)
Definition: juce_RenderingHelpers.h:2312
void fillShape(typename BaseRegionType::Ptr shapeToFill, const bool replaceContents)
Definition: juce_RenderingHelpers.h:2368
ClipRegions< SavedStateType >::EdgeTableRegion EdgeTableRegionType
Definition: juce_RenderingHelpers.h:2005
Definition: juce_ReferenceCountedObject.h:65
void clipToRectangle(const Rectangle< int > &r)
Definition: juce_EdgeTable.cpp:673
void renderImageTransformed(SavedStateType &state, const Image &src, const int alpha, const AffineTransform &transform, Graphics::ResamplingQuality quality, bool tiledFill) const
Definition: juce_RenderingHelpers.h:1730
void transformAll(const AffineTransform &transform) noexcept
Definition: juce_RectangleList.h:621
@ indexG
Definition: juce_PixelFormats.h:566
PixelFormat getFormat() const noexcept
Definition: juce_Image.cpp:262
RectangleType getBounds() const noexcept
Definition: juce_RectangleList.h:489
SavedStateStack(StateObjectType *const initialState) noexcept
Definition: juce_RenderingHelpers.h:2584
Definition: juce_RenderingHelpers.h:2421
int left
Definition: juce_RenderingHelpers.h:396
int height
Definition: juce_Image.h:352
forcedinline uint8 getAlpha() const noexcept
Definition: juce_PixelFormats.h:106
bool intersects(const RectangleList &other) const noexcept
Definition: juce_RectangleList.h:478
virtual void renderImageTransformed(SavedStateType &, const Image &, const int alpha, const AffineTransform &, Graphics::ResamplingQuality, bool tiledFill) const =0
EdgeTableRegion(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:1586
void addTransform(const AffineTransform &t) override
Definition: juce_RenderingHelpers.h:2643
bool clipRegionIntersects(const Rectangle< int > &r) const
Definition: juce_RenderingHelpers.h:1808
void draw(RendererType &state, Point< float > pos) const
Definition: juce_RenderingHelpers.h:282
PixelFormat pixelFormat
Definition: juce_Image.h:349
virtual Rectangle< int > getClipBounds() const =0
Definition: juce_DeletedAtShutdown.h:40
double invScale
Definition: juce_RenderingHelpers.h:516
Ptr clipToEdgeTable(const EdgeTable &et)
Definition: juce_RenderingHelpers.h:1628
forcedinline void set(const Pixel &src) noexcept
Definition: juce_PixelFormats.h:443
void applyTransform(const AffineTransform &transform) noexcept
Definition: juce_Point.h:200
bool isOnePixelWide() const noexcept
Definition: juce_RenderingHelpers.h:388
EdgeTableRegion(const EdgeTableRegion &other)
Definition: juce_RenderingHelpers.h:1591
void clipToImageAlpha(const Image &sourceImage, const AffineTransform &t)
Definition: juce_RenderingHelpers.h:2131
void translate(Point< int > delta)
Definition: juce_RenderingHelpers.h:1679
Definition: juce_RenderingHelpers.h:406
void fillRectList(const RectangleList< float > &list) override
Definition: juce_RenderingHelpers.h:2662
void set(Type newValue) noexcept
Definition: juce_Atomic.h:79
void setOrigin(Point< int > o) override
Definition: juce_RenderingHelpers.h:2642
Ptr clipToRectangleList(const RectangleList< int > &r)
Definition: juce_RenderingHelpers.h:1604
ImageFill(const Image::BitmapData &dest, const Image::BitmapData &src, const int alpha, const int x, const int y)
Definition: juce_RenderingHelpers.h:782
forcedinline void handleEdgeTablePixel(const int x, const int alphaLevel) const noexcept
Definition: juce_RenderingHelpers.h:602
double maxDist
Definition: juce_RenderingHelpers.h:516
FloatRectangleRasterisingInfo(const Rectangle< float > &area)
Definition: juce_RenderingHelpers.h:318
int pointer_sized_int
Definition: juce_MathsFunctions.h:86
void excludeRectangle(const Rectangle< int > &r)
Definition: juce_EdgeTable.cpp:712
void fillWithGradient(IteratorType &iter, ColourGradient &gradient, const AffineTransform &trans, bool isIdentity) const
Definition: juce_RenderingHelpers.h:2555
void fillRectWithColour(SavedStateType &state, const Rectangle< int > &area, const PixelARGB colour, bool replaceContents) const
Definition: juce_RenderingHelpers.h:1694
Definition: juce_ColourGradient.h:35
Ptr clipToEdgeTable(const EdgeTable &et)
Definition: juce_RenderingHelpers.h:1800
ResamplingQuality
Definition: juce_GraphicsContext.h:465
Definition: juce_Typeface.h:44
int width
Definition: juce_Image.h:352
Ptr clipToPath(const Path &p, const AffineTransform &transform)
Definition: juce_RenderingHelpers.h:1799
void reset()
Definition: juce_RenderingHelpers.h:165
void clear()
Definition: juce_ReferenceCountedArray.h:129
forcedinline void setEdgeTableYPos(const int y) noexcept
Definition: juce_RenderingHelpers.h:732
RectangleListRegion(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:1772
void subtract(const RectangleType &rect)
Definition: juce_RectangleList.h:204
bool isVectorDevice() const override
Definition: juce_RenderingHelpers.h:2641
virtual Ptr clone() const =0
RenderingHelpers::SavedStateStack< SavedStateType > stack
Definition: juce_RenderingHelpers.h:2674
Definition: juce_ReferenceCountedObject.h:227
RectangleListRegion(const RectangleList< int > &r)
Definition: juce_RenderingHelpers.h:1773
GlyphCache()
Definition: juce_RenderingHelpers.h:144
RectangleList< int > clip
Definition: juce_RenderingHelpers.h:1843
const Font & getFont() override
Definition: juce_RenderingHelpers.h:2668
double dy
Definition: juce_RenderingHelpers.h:516
SavedStateBase(const Rectangle< int > &initialClip)
Definition: juce_RenderingHelpers.h:2008
Definition: juce_RenderingHelpers.h:779
ValueType y
Definition: juce_Point.h:227
void generate(const Font &newFont, const int glyphNumber)
Definition: juce_RenderingHelpers.h:291
int pixelStride
Definition: juce_Image.h:351
Definition: juce_RenderingHelpers.h:576
int totalRight
Definition: juce_RenderingHelpers.h:397
void setUsingNonZeroWinding(bool isNonZeroWinding) noexcept
Definition: juce_Path.cpp:211
IntegerType negativeAwareModulo(IntegerType dividend, const IntegerType divisor) noexcept
Definition: juce_MathsFunctions.h:531
const RectangleType * end() const noexcept
Definition: juce_RectangleList.h:643
forcedinline void handleEdgeTablePixelFull(const int x) const noexcept
Definition: juce_RenderingHelpers.h:610
Definition: juce_RenderingHelpers.h:1551
bool isClipEmpty() const override
Definition: juce_RenderingHelpers.h:2646
bool isEmpty() noexcept
Definition: juce_EdgeTable.cpp:812
Rectangle< int > getClipBounds() const
Definition: juce_RenderingHelpers.h:1689
void iterate(Callback &callback) const
Definition: juce_RenderingHelpers.h:378
void add(const RectangleType &rect)
Definition: juce_RectangleList.h:108
void renderImageUntransformed(SavedStateType &state, const Image &src, const int alpha, int x, int y, bool tiledFill) const
Definition: juce_RenderingHelpers.h:1735
void drawGlyph(RenderTargetType &target, const Font &font, const int glyphNumber, Point< float > pos)
Definition: juce_RenderingHelpers.h:174
const int numEntries
Definition: juce_RenderingHelpers.h:514
forcedinline void handleEdgeTablePixel(const int x, const int alphaLevel) const noexcept
Definition: juce_RenderingHelpers.h:738
void fillRectAsPath(const Rectangle< CoordType > &r)
Definition: juce_RenderingHelpers.h:2204
ElementType * getData() const noexcept
Definition: juce_HeapBlock.h:163
uint8 * getPixelPointer(int x, int y) const noexcept
Definition: juce_Image.h:331
SolidColour(const Image::BitmapData &image, const PixelARGB colour)
Definition: juce_RenderingHelpers.h:579
Definition: juce_ReferenceCountedObject.h:144
static GlyphCache & getInstance()
Definition: juce_RenderingHelpers.h:154
int top
Definition: juce_RenderingHelpers.h:396
int topAlpha
Definition: juce_RenderingHelpers.h:398
void handleEdgeTableLine(int x, int width, const int alphaLevel) const noexcept
Definition: juce_RenderingHelpers.h:748
Ptr clone() const
Definition: juce_RenderingHelpers.h:1595
const PixelARGB getPixelARGB() const noexcept
Definition: juce_Colour.cpp:231
Path toPath() const
Definition: juce_RectangleList.h:629
EdgeTableRegion(const Rectangle< int > &bounds, const Path &p, const AffineTransform &t)
Definition: juce_RenderingHelpers.h:1590
void clipEdgeTableLine(EdgeTable &et, int x, int y, int width)
Definition: juce_RenderingHelpers.h:865
bool clipToRectangleList(const RectangleList< int > &r) override
Definition: juce_RenderingHelpers.h:2649
SoftwareRendererSavedState(const SoftwareRendererSavedState &other)
Definition: juce_RenderingHelpers.h:2436
void excludeClipRectangle(const Rectangle< int > &r) override
Definition: juce_RenderingHelpers.h:2650
void renderGradient(Iterator &iter, const Image::BitmapData &destData, const ColourGradient &g, const AffineTransform &transform, const PixelARGB *const lookupTable, const int numLookupEntries, const bool isIdentity, DestPixelType *)
Definition: juce_RenderingHelpers.h:1523
forcedinline uint8 getBlue() const noexcept
Definition: juce_PixelFormats.h:109
float getPhysicalPixelScaleFactor() override
Definition: juce_RenderingHelpers.h:2644
int createLookupTable(const AffineTransform &transform, HeapBlock< PixelARGB > &resultLookupTable) const
Definition: juce_ColourGradient.cpp:181
Rectangle< int > getMaximumBounds() const
Definition: juce_RenderingHelpers.h:2522
void addRectangle(float x, float y, float width, float height)
Definition: juce_Path.cpp:399
EdgeTable edgeTable
Definition: juce_RenderingHelpers.h:1740
Definition: juce_RenderingHelpers.h:2638
FillType fillType
Definition: juce_RenderingHelpers.h:2415
virtual ~Base()
Definition: juce_RenderingHelpers.h:1555
@ indexR
Definition: juce_PixelFormats.h:309
Linear(const ColourGradient &gradient, const AffineTransform &transform, const PixelARGB *const colours, const int numColours)
Definition: juce_RenderingHelpers.h:409
forcedinline void handleEdgeTableLine(const int x, const int width, const int alphaLevel) const noexcept
Definition: juce_RenderingHelpers.h:618
@ indexG
Definition: juce_PixelFormats.h:309
void setOpacity(float newOpacity) override
Definition: juce_RenderingHelpers.h:2658
@ indexB
Definition: juce_PixelFormats.h:309
void cloneClipIfMultiplyReferenced()
Definition: juce_RenderingHelpers.h:2407
int lineStride
Definition: juce_Image.h:350
Point< float > point1
Definition: juce_ColourGradient.h:145
Ptr clipToRectangle(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:1781
const PixelARGB *const lookupTable
Definition: juce_RenderingHelpers.h:513
Ptr excludeClipRectangle(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:1615
void clipToPath(const Path &p, const AffineTransform &t)
Definition: juce_RenderingHelpers.h:2122
ObjectClass * add(ObjectClass *newObject) noexcept
Definition: juce_OwnedArray.h:278
const double gx1
Definition: juce_RenderingHelpers.h:515
void fillRect(const Rectangle< float > &r)
Definition: juce_RenderingHelpers.h:2231
Ptr clipToRectangleList(const RectangleList< int > &r)
Definition: juce_RenderingHelpers.h:1787
Rectangle< int > getClipBounds() const
Definition: juce_RenderingHelpers.h:2162
void drawGlyph(int glyphNumber, const AffineTransform &trans)
Definition: juce_RenderingHelpers.h:2479