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
33 namespace RenderingHelpers
78 const int tx = (
int) (t.getTranslationX() * 256.0f);
79 const int ty = (
int) (t.getTranslationY() * 256.0f);
81 if (((tx | ty) & 0xf8) == 0)
116 return r +
offset.toFloat();
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)
212 if (g->glyph == glyphNumber && g->font == font)
219 CachedGlyphType* getGlyphForReuse()
221 if (hits.value + misses.value > glyphs.
size() * 16)
223 if (misses.value * 2 > hits.value)
224 addNewGlyphSlots (32);
230 if (CachedGlyphType* g = findLeastRecentlyUsedGlyph())
233 addNewGlyphSlots (32);
237 void addNewGlyphSlots (
int num)
242 glyphs.
add (
new CachedGlyphType());
247 CachedGlyphType* oldest =
nullptr;
250 for (
int i = glyphs.
size() - 1; --i >= 0;)
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);
298 const float fontHeight = font.
getHeight();
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;
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;
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);
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>
1608 if (inverse.subtract (r))
1609 for (
const Rectangle<int>* i = inverse.begin(), *
const e = inverse.end(); i != e; ++i)
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);
1699 if (! clipped.isEmpty())
1703 state.fillWithSolidColour (et.
edgeTable, colour, replaceContents);
1712 if (! clipped.isEmpty())
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());
1784 return clip.isEmpty() ?
nullptr :
this;
1790 return clip.isEmpty() ?
nullptr :
this;
1796 return clip.isEmpty() ?
nullptr :
this;
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());
2096 if (
clip !=
nullptr)
2119 return clip !=
nullptr;
2124 if (
clip !=
nullptr)
2133 if (
clip !=
nullptr)
2151 if (
clip !=
nullptr)
2183 if (! clipped.isEmpty())
2198 if (! clipped.isEmpty())
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);
2322 int tx = (
int) (t.getTranslationX() * 256.0f);
2323 int ty = (
int) (t.getTranslationY() * 256.0f);
2327 tx = ((tx + 128) >> 8);
2328 ty = ((ty + 128) >> 8);
2330 if (tiledFillClipRegion !=
nullptr)
2341 c->renderImageUntransformed (
getThis(), sourceImage, alpha, tx, ty,
false);
2348 if (! t.isSingularity())
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)
2453 s->
clip->translate (-layerBounds.getPosition());
2461 if (
clip !=
nullptr)
2481 if (
clip !=
nullptr)
2501 if (std::abs (xScale - 1.0f) > 0.01f)
2504 cache.
drawGlyph (*
this, f, glyphNumber, pos);
2509 const float fontHeight = font.
getHeight();
2512 .followedBy (trans)));
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
void translate(float dx, int dy) noexcept
Definition: juce_EdgeTable.cpp:456
const double gy1
Definition: juce_RenderingHelpers.h:515
Graphics::ResamplingQuality interpolationQuality
Definition: juce_RenderingHelpers.h:2416
Ptr applyClipTo(const Ptr &target) const
Definition: juce_RenderingHelpers.h:1779
SoftwareRendererSavedState(const Image &im, const Rectangle< int > &clipBounds)
Definition: juce_RenderingHelpers.h:2426
int getBottomRightCornerAlpha() const noexcept
Definition: juce_RenderingHelpers.h:393
void fillRectWithColour(SavedStateType &state, const Rectangle< float > &area, const PixelARGB colour) const
Definition: juce_RenderingHelpers.h:1707
SoftwareRendererSavedState(const Image &im, const RectangleList< int > &clipList, Point< int > origin)
Definition: juce_RenderingHelpers.h:2431
Base()
Definition: juce_RenderingHelpers.h:1554
static bool isOnlyTranslationAllowingError(const AffineTransform &t)
Definition: juce_RenderingHelpers.h:2304
static GlyphCache & getInstance()
Definition: juce_RenderingHelpers.h:154
GlyphCache< CachedGlyphEdgeTable< SoftwareRendererSavedState >, SoftwareRendererSavedState > GlyphCacheType
Definition: juce_RenderingHelpers.h:2471
void reset()
Definition: juce_RenderingHelpers.h:165
void setHeight(float newHeight)
Definition: juce_Font.cpp:455
virtual Ptr clipToImageAlpha(const Image &, const AffineTransform &, const Graphics::ResamplingQuality)=0
Definition: juce_Image.h:311
Ptr applyClipTo(const Ptr &target) const
Definition: juce_RenderingHelpers.h:1596
void save()
Definition: juce_RenderingHelpers.h:2598
void drawGlyph(RenderTargetType &target, const Font &font, const int glyphNumber, Point< float > pos)
Definition: juce_RenderingHelpers.h:174
void drawImage(const Image &sourceImage, const AffineTransform &trans)
Definition: juce_RenderingHelpers.h:2298
Definition: juce_graphics.h:45
void drawLine(const Line< float > &line)
Definition: juce_RenderingHelpers.h:2291
int glyph
Definition: juce_RenderingHelpers.h:306
Definition: juce_EdgeTable.h:35
Ptr clipToImageAlpha(const Image &image, const AffineTransform &transform, const Graphics::ResamplingQuality quality)
Definition: juce_RenderingHelpers.h:1802
ValueType getY() const noexcept
Definition: juce_Point.h:68
bool hasAlphaChannel() const noexcept
Definition: juce_Image.cpp:266
GlyphCache()
Definition: juce_RenderingHelpers.h:144
int getTopRightCornerAlpha() const noexcept
Definition: juce_RenderingHelpers.h:391
ValueType getRight() const noexcept
Definition: juce_Rectangle.h:119
forcedinline void handleEdgeTablePixel(const int x, const int alphaLevel) const noexcept
Definition: juce_RenderingHelpers.h:602
bool clipRegionIntersects(const Rectangle< int > &r) override
Definition: juce_RenderingHelpers.h:2647
ObjectClass * getLast() const noexcept
Definition: juce_OwnedArray.h:184
ResamplingQuality
Definition: juce_GraphicsContext.h:465
void beginTransparencyLayer(float opacity) override
Definition: juce_RenderingHelpers.h:2655
Definition: juce_Font.h:39
RenderingHelpers::TranslationOrTransform transform
Definition: juce_RenderingHelpers.h:2414
void fillRectWithColour(SavedStateType &state, const Rectangle< float > &area, const PixelARGB colour) const
Definition: juce_RenderingHelpers.h:1817
void fillRectWithColour(SavedStateType &state, const Rectangle< int > &area, const PixelARGB colour, bool replaceContents) const
Definition: juce_RenderingHelpers.h:1811
void offsetAll(Point< ValueType > offset) noexcept
Definition: juce_RectangleList.h:597
Ptr clipToRectangleList(const RectangleList< int > &r)
Definition: juce_RenderingHelpers.h:1604
forcedinline void setEdgeTableYPos(int y) noexcept
Definition: juce_RenderingHelpers.h:792
void setUsingNonZeroWinding(bool isNonZeroWinding) noexcept
Definition: juce_Path.cpp:211
bool excludeClipRectangle(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:2094
void fillShape(typename BaseRegionType::Ptr shapeToFill, const bool replaceContents)
Definition: juce_RenderingHelpers.h:2368
double maxDist
Definition: juce_RenderingHelpers.h:516
void beginTransparencyLayer(float opacity)
Definition: juce_RenderingHelpers.h:2616
void multiplyLevels(float factor)
Definition: juce_EdgeTable.cpp:477
ReferenceCountedObjectPtr< Base > Ptr
Definition: juce_RenderingHelpers.h:1557
Definition: juce_RenderingHelpers.h:2581
bool clipToRectangle(const Rectangle< int > &r) override
Definition: juce_RenderingHelpers.h:2648
Definition: juce_Line.h:44
int totalLeft
Definition: juce_RenderingHelpers.h:397
PixelARGB getPixel(const int x) const noexcept
Definition: juce_RenderingHelpers.h:460
#define noexcept
Definition: juce_CompilerSupport.h:141
int getWidth() const noexcept
Definition: juce_Image.cpp:259
void endTransparencyLayer() override
Definition: juce_RenderingHelpers.h:2656
Definition: juce_Atomic.h:41
void renderImageTransformed(IteratorType &iter, const Image &src, const int alpha, const AffineTransform &trans, Graphics::ResamplingQuality quality, bool tiledFill) const
Definition: juce_RenderingHelpers.h:2526
void handleEdgeTableLine(int x, int width, const int alphaLevel) const noexcept
Definition: juce_RenderingHelpers.h:748
Gradient(const Image::BitmapData &dest, const ColourGradient &gradient, const AffineTransform &transform, const PixelARGB *const colours, const int numColours)
Definition: juce_RenderingHelpers.h:725
void setFill(const FillType &fillType) override
Definition: juce_RenderingHelpers.h:2657
virtual void renderImageTransformed(SavedStateType &, const Image &, const int alpha, const AffineTransform &, Graphics::ResamplingQuality, bool tiledFill) const =0
uint8 * getLinePointer(int y) const noexcept
Definition: juce_Image.h:325
void restoreState() override
Definition: juce_RenderingHelpers.h:2654
static Rectangle< int > getLargestIntegerWithin(Rectangle< float > r)
Definition: juce_RenderingHelpers.h:2084
SavedStateBase(const RectangleList< int > &clipList, Point< int > origin)
Definition: juce_RenderingHelpers.h:2014
EdgeTableRegion(const RectangleList< float > &r)
Definition: juce_RenderingHelpers.h:1589
ValueType getX() const noexcept
Definition: juce_Rectangle.h:107
double invScale
Definition: juce_RenderingHelpers.h:516
Definition: juce_RenderingHelpers.h:316
#define JUCE_PERFORM_PIXEL_OP_LOOP(op)
Definition: juce_RenderingHelpers.h:564
void multiplyOpacity(float multiplier) noexcept
Definition: juce_ColourGradient.cpp:90
int getTopLeftCornerAlpha() const noexcept
Definition: juce_RenderingHelpers.h:390
Type jmin(const Type a, const Type b)
Definition: juce_core.h:113
Definition: juce_ScopedLock.h:59
ClipRegions< SavedStateType >::RectangleListRegion RectangleListRegionType
Definition: juce_RenderingHelpers.h:2006
void fillTargetRect(const Rectangle< float > &r)
Definition: juce_RenderingHelpers.h:2188
forcedinline void multiplyAlpha(int multiplier) noexcept
Definition: juce_PixelFormats.h:219
Definition: juce_GraphicsContext.h:467
forcedinline void setY(const int y) noexcept
Definition: juce_RenderingHelpers.h:452
bool isPositiveAndBelow(Type valueToTest, Type upperLimit) noexcept
Definition: juce_core.h:238
PixelFormat pixelFormat
Definition: juce_Image.h:349
Definition: juce_RenderingHelpers.h:406
void renderImage(const Image &sourceImage, const AffineTransform &trans, const BaseRegionType *const tiledFillClipRegion)
Definition: juce_RenderingHelpers.h:2312
Definition: juce_RectangleList.h:40
void malloc(const size_t newNumElements, const size_t elementSize=sizeof(ElementType))
Definition: juce_HeapBlock.h:220
ClipRegions< SavedStateType >::EdgeTableRegion EdgeTableRegionType
Definition: juce_RenderingHelpers.h:2005
virtual void translate(Point< int > delta)=0
forcedinline void setEdgeTableYPos(const int y) noexcept
Definition: juce_RenderingHelpers.h:597
Definition: juce_graphics.h:41
StackBasedLowLevelGraphicsContext()
Definition: juce_RenderingHelpers.h:2672
void initialise(StateObjectType *state)
Definition: juce_RenderingHelpers.h:2590
Definition: juce_DeletedAtShutdown.h:40
TOUCHINPUT int
Definition: juce_win32_Windowing.cpp:123
forcedinline void handleEdgeTablePixelFull(const int x) const noexcept
Definition: juce_RenderingHelpers.h:813
void clipEdgeTableLine(EdgeTable &et, int x, int y, int width)
Definition: juce_RenderingHelpers.h:865
int roundToInt(const FloatType value) noexcept
Definition: juce_core.h:418
void drawLine(const Line< float > &line) override
Definition: juce_RenderingHelpers.h:2666
forcedinline void handleEdgeTableLineFull(const int x, const int width) const noexcept
Definition: juce_RenderingHelpers.h:631
EdgeTableRegion(const EdgeTable &e)
Definition: juce_RenderingHelpers.h:1585
ScopedPointer< ColourGradient > gradient
Definition: juce_FillType.h:129
ObjectClassPtr getUnchecked(const int index) const noexcept
Definition: juce_ReferenceCountedArray.h:171
Type * addBytesToPointer(Type *basePointer, IntegerType bytes) noexcept
Definition: juce_Memory.h:53
int rightAlpha
Definition: juce_RenderingHelpers.h:398
AffineTransform transform
Definition: juce_FillType.h:138
int totalRight
Definition: juce_RenderingHelpers.h:397
uint8 getAlpha() const noexcept
Definition: juce_Colour.h:200
void excludeRectangle(const Rectangle< int > &r)
Definition: juce_EdgeTable.cpp:712
virtual Ptr clipToRectangle(const Rectangle< int > &)=0
void renderImageTransformed(SavedStateType &state, const Image &src, const int alpha, const AffineTransform &transform, Graphics::ResamplingQuality quality, bool tiledFill) const
Definition: juce_RenderingHelpers.h:1833
int size() const noexcept
Definition: juce_ReferenceCountedArray.h:147
int getBottomLeftCornerAlpha() const noexcept
Definition: juce_RenderingHelpers.h:392
Definition: juce_Image.h:63
void clipToImageAlpha(const Image &sourceImage, const AffineTransform &t)
Definition: juce_RenderingHelpers.h:2131
virtual Ptr applyClipTo(const Ptr &target) const =0
Rectangle< float > toFloat() const noexcept
Definition: juce_Rectangle.h:792
void iterate(Renderer &r) const noexcept
Definition: juce_RenderingHelpers.h:1847
virtual void setOpacity(float)=0
Ptr excludeClipRectangle(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:1615
SavedStateBase(const Rectangle< int > &initialClip)
Definition: juce_RenderingHelpers.h:2008
bool clipRegionIntersects(const Rectangle< int > &r) const
Definition: juce_RenderingHelpers.h:1808
bool clipRegionIntersects(const Rectangle< int > &r) const
Definition: juce_RenderingHelpers.h:2149
Definition: juce_PixelFormats.h:309
Definition: juce_Point.h:39
void renderImageUntransformed(IteratorType &iter, const Image &src, const int alpha, int x, int y, bool tiledFill) const
Definition: juce_RenderingHelpers.h:2534
Definition: juce_ColourGradient.h:35
bool isTiledImage() const noexcept
Definition: juce_FillType.h:83
Path toPath() const
Definition: juce_RectangleList.h:629
void setFont(const Font &newFont) override
Definition: juce_RenderingHelpers.h:2667
Definition: juce_RenderingHelpers.h:722
Rectangle< int > getClipBounds() const
Definition: juce_RenderingHelpers.h:2162
void drawGlyph(int glyphNumber, const AffineTransform &t) override
Definition: juce_RenderingHelpers.h:2665
LowLevelGraphicsContext * createLowLevelContext() const
Definition: juce_Image.cpp:268
Definition: juce_RenderingHelpers.h:2001
Point< float > point2
Definition: juce_ColourGradient.h:145
virtual bool isHinted() const
Definition: juce_Typeface.h:123
void setInterpolationQuality(Graphics::ResamplingQuality quality) override
Definition: juce_RenderingHelpers.h:2659
virtual Ptr clipToPath(const Path &, const AffineTransform &)=0
Definition: juce_PixelFormats.h:309
RectangleListRegion(const RectangleList< int > &r)
Definition: juce_RenderingHelpers.h:1773
bool isTransparent() const noexcept
Definition: juce_Colour.cpp:244
void fillRectWithColour(SavedStateType &state, const Rectangle< int > &area, const PixelARGB colour, bool replaceContents) const
Definition: juce_RenderingHelpers.h:1694
RectangleList< int > clip
Definition: juce_RenderingHelpers.h:1843
EdgeTableRegion(const Rectangle< int > &bounds, const Path &p, const AffineTransform &t)
Definition: juce_RenderingHelpers.h:1590
void fillRect(const Rectangle< int > &r, bool replace) override
Definition: juce_RenderingHelpers.h:2660
bool isEmpty() noexcept
Definition: juce_EdgeTable.cpp:812
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
void fillAllWithColour(SavedStateType &state, const PixelARGB colour, bool replaceContents) const
Definition: juce_RenderingHelpers.h:1720
forcedinline void handleEdgeTablePixel(const int x, int alphaLevel) const noexcept
Definition: juce_RenderingHelpers.h:806
const PixelARGB getPixelARGB() const noexcept
Definition: juce_Colour.cpp:231
FloatRectangleRasterisingInfo(const Rectangle< float > &area)
Definition: juce_RenderingHelpers.h:318
StateObjectType & operator*() const noexcept
Definition: juce_RenderingHelpers.h:2596
ObjectClassPtr getLast() const noexcept
Definition: juce_ReferenceCountedArray.h:230
float getBrightness() const noexcept
Definition: juce_Colour.cpp:334
void fillAllWithGradient(SavedStateType &state, ColourGradient &gradient, const AffineTransform &transform, bool isIdentity) const
Definition: juce_RenderingHelpers.h:1828
virtual bool clipRegionIntersects(const Rectangle< int > &) const =0
Definition: juce_graphics.h:63
double dy
Definition: juce_RenderingHelpers.h:516
int left
Definition: juce_RenderingHelpers.h:396
ReferenceCountedObjectPtr< CachedGlyphType > findOrCreateGlyph(const Font &font, int glyphNumber)
Definition: juce_RenderingHelpers.h:183
Definition: juce_RenderingHelpers.h:1549
void transformAll(const AffineTransform &transform) noexcept
Definition: juce_RectangleList.h:621
Ptr clipToRectangle(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:1781
Rectangle< int > getMaximumBounds() const
Definition: juce_RenderingHelpers.h:2522
forcedinline void handleEdgeTablePixelFull(const int x) const noexcept
Definition: juce_RenderingHelpers.h:743
ValueType getBottom() const noexcept
Definition: juce_Rectangle.h:122
Ptr clipToEdgeTable(const EdgeTable &et)
Definition: juce_RenderingHelpers.h:1628
forcedinline void set(const Pixel &src) noexcept
Definition: juce_PixelFormats.h:443
CachedGlyphEdgeTable()
Definition: juce_RenderingHelpers.h:280
Definition: juce_RenderingHelpers.h:480
Definition: juce_ReferenceCountedObject.h:65
void fillRectAsPath(const Rectangle< CoordType > &r)
Definition: juce_RenderingHelpers.h:2204
const int numEntries
Definition: juce_RenderingHelpers.h:514
Definition: juce_CriticalSection.h:47
void clipToPath(const Path &p, const AffineTransform &t)
Definition: juce_RenderingHelpers.h:2122
Definition: juce_Image.h:313
Definition: juce_PixelFormats.h:566
Definition: juce_Typeface.h:44
void clipToPath(const Path &path, const AffineTransform &t) override
Definition: juce_RenderingHelpers.h:2651
SolidColour(const Image::BitmapData &image, const PixelARGB colour)
Definition: juce_RenderingHelpers.h:579
Definition: juce_Rectangle.h:36
Image image
Definition: juce_FillType.h:135
RectangleListRegion(const RectangleListRegion &other)
Definition: juce_RenderingHelpers.h:1774
virtual void fillAllWithGradient(SavedStateType &, ColourGradient &, const AffineTransform &, bool isIdentity) const =0
bool isOnePixelWide() const noexcept
Definition: juce_RenderingHelpers.h:388
int leftAlpha
Definition: juce_RenderingHelpers.h:398
void fillRect(const Rectangle< float > &r) override
Definition: juce_RenderingHelpers.h:2661
SoftwareRendererSavedState(const SoftwareRendererSavedState &other)
Definition: juce_RenderingHelpers.h:2436
virtual Rectangle< int > getClipBounds() const =0
void drawImage(const Image &im, const AffineTransform &t) override
Definition: juce_RenderingHelpers.h:2664
int width
Definition: juce_Image.h:352
Definition: juce_PixelFormats.h:309
float getOpacity() const noexcept
Definition: juce_FillType.h:106
void saveState() override
Definition: juce_RenderingHelpers.h:2653
void addRectangle(float x, float y, float width, float height)
Definition: juce_Path.cpp:399
Definition: juce_Path.h:62
void fillPath(const Path &path, const AffineTransform &t) override
Definition: juce_RenderingHelpers.h:2663
const RectangleType * begin() const noexcept
Definition: juce_RectangleList.h:641
int top
Definition: juce_RenderingHelpers.h:396
void renderImageUntransformed(SavedStateType &state, const Image &src, const int alpha, int x, int y, bool tiledFill) const
Definition: juce_RenderingHelpers.h:1838
FillType fillType
Definition: juce_RenderingHelpers.h:2415
Linear(const ColourGradient &gradient, const AffineTransform &transform, const PixelARGB *const colours, const int numColours)
Definition: juce_RenderingHelpers.h:409
bool isColour() const noexcept
Definition: juce_FillType.h:77
Definition: juce_graphics.h:55
Rectangle< int > getBounds() const noexcept
Definition: juce_Image.cpp:261
unsigned int uint32
Definition: juce_MathsFunctions.h:51
Ptr clipToRectangleList(const RectangleList< int > &r)
Definition: juce_RenderingHelpers.h:1787
void cloneClipIfMultiplyReferenced()
Definition: juce_RenderingHelpers.h:2407
Ptr excludeClipRectangle(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:1793
Ptr clipToRectangle(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:1598
int createLookupTable(const AffineTransform &transform, HeapBlock< PixelARGB > &resultLookupTable) const
Definition: juce_ColourGradient.cpp:181
virtual void fillAllWithColour(SavedStateType &, const PixelARGB colour, bool replaceContents) const =0
SavedStateStack() noexcept
Definition: juce_RenderingHelpers.h:2588
void fillRect(const Rectangle< float > &r)
Definition: juce_RenderingHelpers.h:2231
Definition: juce_PixelFormats.h:610
virtual EdgeTable * getEdgeTableForGlyph(int glyphNumber, const AffineTransform &transform, float fontHeight)
Definition: juce_Typeface.cpp:119
void clear()
Definition: juce_ReferenceCountedArray.h:129
PixelFormat getFormat() const noexcept
Definition: juce_Image.cpp:262
Definition: juce_Image.h:64
void drawGlyph(int glyphNumber, const AffineTransform &trans)
Definition: juce_RenderingHelpers.h:2479
EdgeTableRegion(const Rectangle< float > &r)
Definition: juce_RenderingHelpers.h:1587
void restore()
Definition: juce_RenderingHelpers.h:2603
forcedinline void setEdgeTableYPos(const int y) noexcept
Definition: juce_RenderingHelpers.h:732
void clipToImageAlpha(const Image &im, const AffineTransform &t) override
Definition: juce_RenderingHelpers.h:2652
void endTransparencyLayer()
Definition: juce_RenderingHelpers.h:2622
void handleEdgeTableLine(int x, int width, int alphaLevel) const noexcept
Definition: juce_RenderingHelpers.h:818
forcedinline uint8 getBlue() const noexcept
Definition: juce_PixelFormats.h:109
Definition: juce_ReferenceCountedObject.h:227
virtual Ptr clone() const =0
IntegerType negativeAwareModulo(IntegerType dividend, const IntegerType divisor) noexcept
Definition: juce_MathsFunctions.h:531
ScopedPointer< EdgeTable > edgeTable
Definition: juce_RenderingHelpers.h:305
void fillAllWithColour(SavedStateType &state, const PixelARGB colour, bool replaceContents) const
Definition: juce_RenderingHelpers.h:1823
int quality
Definition: jpeglib.h:919
bool clipToRectangleList(const RectangleList< int > &r)
Definition: juce_RenderingHelpers.h:2054
void generate(const Font &newFont, const int glyphNumber)
Definition: juce_RenderingHelpers.h:291
Definition: juce_RenderingHelpers.h:576
Ptr clone() const
Definition: juce_RenderingHelpers.h:1595
Type jmax(const Type a, const Type b)
Definition: juce_core.h:101
forcedinline uint8 getRed() const noexcept
Definition: juce_PixelFormats.h:107
const RectangleType * end() const noexcept
Definition: juce_RectangleList.h:643
StateObjectType * operator->() const noexcept
Definition: juce_RenderingHelpers.h:2595
ResamplingQuality
Definition: juce_graphics.h:466
Image image
Definition: juce_RenderingHelpers.h:2572
Rectangle< int > getClipBounds() const
Definition: juce_RenderingHelpers.h:1809
Rectangle< int > getClipBounds() const override
Definition: juce_RenderingHelpers.h:2645
const PixelARGB *const lookupTable
Definition: juce_RenderingHelpers.h:513
void add(const RectangleType &rect)
Definition: juce_RectangleList.h:108
int bottomAlpha
Definition: juce_RenderingHelpers.h:398
int lineStride
Definition: juce_Image.h:350
void ensureStorageAllocated(const int minNumElements)
Definition: juce_ReferenceCountedArray.h:864
int topAlpha
Definition: juce_RenderingHelpers.h:398
int totalBottom
Definition: juce_RenderingHelpers.h:397
const double gx1
Definition: juce_RenderingHelpers.h:515
Definition: juce_graphics.h:40
Font font
Definition: juce_RenderingHelpers.h:2573
png_const_structrp png_const_inforp int png_fixed_point * width
Definition: juce_PNGLoader.cpp:2339
ImageFill(const Image::BitmapData &dest, const Image::BitmapData &src, const int alpha, const int x, const int y)
Definition: juce_RenderingHelpers.h:782
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
Radial(const ColourGradient &gradient, const AffineTransform &, const PixelARGB *const colours, const int numColours)
Definition: juce_RenderingHelpers.h:483
void fillPath(const Path &path, const AffineTransform &t)
Definition: juce_RenderingHelpers.h:2266
SavedStateStack(StateObjectType *const initialState) noexcept
Definition: juce_RenderingHelpers.h:2584
int height
Definition: juce_Image.h:352
void handleEdgeTableLineFull(int x, int width) const noexcept
Definition: juce_RenderingHelpers.h:842
void fillWithGradient(IteratorType &iter, ColourGradient &gradient, const AffineTransform &trans, bool isIdentity) const
Definition: juce_RenderingHelpers.h:2555
void iterate(Callback &callback) const
Definition: juce_RenderingHelpers.h:378
Definition: juce_FillType.h:38
void applyTransform(const AffineTransform &transform) noexcept
Definition: juce_graphics.h:201
Definition: juce_ContainerDeletePolicy.h:44
Ptr clone() const
Definition: juce_RenderingHelpers.h:1778
void fillEdgeTable(const EdgeTable &edgeTable, const float x, const int y)
Definition: juce_RenderingHelpers.h:2272
Point< ValueType > getPointAlongLine(ValueType distanceFromStart) const noexcept
Definition: juce_Line.h:200
Base::Ptr Ptr
Definition: juce_RenderingHelpers.h:1593
Type jlimit(const Type lowerLimit, const Type upperLimit, const Type valueToConstrain) noexcept
Definition: juce_MathsFunctions.h:220
void applyTransform(const AffineTransform &transform) noexcept
Definition: juce_Point.h:200
Ptr clipToImageAlpha(const Image &image, const AffineTransform &transform, const Graphics::ResamplingQuality quality)
Definition: juce_RenderingHelpers.h:1634
int getHeight() const noexcept
Definition: juce_Image.cpp:260
forcedinline uint8 getGreen() const noexcept
Definition: juce_PixelFormats.h:108
Definition: juce_PixelFormats.h:56
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) const
Definition: juce_RenderingHelpers.h:1684
EdgeTableRegion(const EdgeTableRegion &other)
Definition: juce_RenderingHelpers.h:1591
SavedStateType & getThis() noexcept
Definition: juce_RenderingHelpers.h:2027
StackBasedLowLevelGraphicsContext(SavedStateType *initialState)
Definition: juce_RenderingHelpers.h:2671
EdgeTable edgeTable
Definition: juce_RenderingHelpers.h:1740
void translate(Point< int > delta)
Definition: juce_RenderingHelpers.h:1807
Definition: juce_Image.h:306
virtual Ptr clipToRectangleList(const RectangleList< int > &)=0
int totalTop
Definition: juce_RenderingHelpers.h:397
static void clearGlyphCache()
Definition: juce_RenderingHelpers.h:2473
void renderImageUntransformed(SavedStateType &state, const Image &src, const int alpha, int x, int y, bool tiledFill) const
Definition: juce_RenderingHelpers.h:1735
void fillRect(const Rectangle< int > &r, const bool replaceContents)
Definition: juce_RenderingHelpers.h:2211
void clipToRectangle(const Rectangle< int > &r)
Definition: juce_EdgeTable.cpp:673
void addTransform(const AffineTransform &t) override
Definition: juce_RenderingHelpers.h:2643
ValueType getY() const noexcept
Definition: juce_Rectangle.h:110
bool isGradient() const noexcept
Definition: juce_FillType.h:80
~GlyphCache()
Definition: juce_RenderingHelpers.h:149
forcedinline void handleEdgeTablePixel(const int x, const int alphaLevel) const noexcept
Definition: juce_RenderingHelpers.h:738
ElementType * getData() const noexcept
Definition: juce_HeapBlock.h:163
Definition: juce_GraphicsContext.h:42
void setFillType(const FillType &newFill)
Definition: juce_RenderingHelpers.h:2168
void translate(Point< int > delta)
Definition: juce_RenderingHelpers.h:1679
Definition: juce_Image.h:54
RenderingHelpers::SavedStateStack< SavedStateType > stack
Definition: juce_RenderingHelpers.h:2674
EdgeTableRegion(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:1586
Base::Ptr Ptr
Definition: juce_RenderingHelpers.h:1776
int pixelStride
Definition: juce_Image.h:351
bool isClipEmpty() const override
Definition: juce_RenderingHelpers.h:2646
Definition: juce_LowLevelGraphicsContext.h:43
Definition: juce_RenderingHelpers.h:1551
void fillTargetRect(const Rectangle< int > &r, const bool replaceContents)
Definition: juce_RenderingHelpers.h:2173
void endTransparencyLayer(SoftwareRendererSavedState &finishedLayerState)
Definition: juce_RenderingHelpers.h:2459
BaseRegionType::Ptr clip
Definition: juce_RenderingHelpers.h:2413
Rectangle< int > getClipBounds() const
Definition: juce_RenderingHelpers.h:1689
void fillRectList(const RectangleList< float > &list) override
Definition: juce_RenderingHelpers.h:2662
void setHorizontalScale(float scaleFactor)
Definition: juce_Font.cpp:558
void setOrigin(Point< int > o) override
Definition: juce_RenderingHelpers.h:2642
void applyTransform(const AffineTransform &transform) noexcept
Definition: juce_Path.cpp:916
Definition: juce_RenderingHelpers.h:779
virtual ~Base()
Definition: juce_RenderingHelpers.h:1555
int lastAccessCount
Definition: juce_RenderingHelpers.h:306
Rectangle getIntersection(const Rectangle &other) const noexcept
Definition: juce_Rectangle.h:609
void addLineSegment(const Line< float > &line, float lineThickness)
Definition: juce_Path.cpp:674
ObjectClass * add(ObjectClass *newObject) noexcept
Definition: juce_OwnedArray.h:278
Definition: juce_PixelFormats.h:566
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
Typeface * getTypeface() const
Definition: juce_Font.cpp:395
bool clipToRectangleList(const RectangleList< int > &r) override
Definition: juce_RenderingHelpers.h:2649
Definition: juce_RenderingHelpers.h:1769
void handleEdgeTableLineFull(int x, int width) const noexcept
Definition: juce_RenderingHelpers.h:758
void excludeClipRectangle(const Rectangle< int > &r) override
Definition: juce_RenderingHelpers.h:2650
void renderImageTransformed(SavedStateType &state, const Image &src, const int alpha, const AffineTransform &transform, Graphics::ResamplingQuality quality, bool tiledFill) const
Definition: juce_RenderingHelpers.h:1730
Definition: juce_RenderingHelpers.h:141
Definition: juce_PixelFormats.h:309
const Font & getFont() override
Definition: juce_RenderingHelpers.h:2668
bool isVectorDevice() const override
Definition: juce_RenderingHelpers.h:2641
void fillRectList(const RectangleList< float > &list)
Definition: juce_RenderingHelpers.h:2244
bool snapToIntegerCoordinate
Definition: juce_RenderingHelpers.h:307
Definition: juce_RenderingHelpers.h:2638
Ptr clipToPath(const Path &p, const AffineTransform &transform)
Definition: juce_RenderingHelpers.h:1621
float getPhysicalPixelScaleFactor() override
Definition: juce_RenderingHelpers.h:2644
void setOpacity(float newOpacity) override
Definition: juce_RenderingHelpers.h:2658
Colour colour
Definition: juce_FillType.h:122
SavedStateBase(const SavedStateBase &other)
Definition: juce_RenderingHelpers.h:2020
virtual void renderImageUntransformed(SavedStateType &, const Image &, const int alpha, int x, int y, bool tiledFill) const =0
forcedinline void setY(const int y) noexcept
Definition: juce_RenderingHelpers.h:497
Definition: juce_PixelFormats.h:566
Definition: juce_RenderingHelpers.h:2421
Definition: juce_graphics.h:39
#define max(x, y)
Definition: os.h:79
Definition: juce_ReferenceCountedObject.h:144
unsigned char uint8
Definition: juce_MathsFunctions.h:43
virtual void fillRectWithColour(SavedStateType &, const Rectangle< int > &, const PixelARGB colour, bool replaceContents) const =0
PixelARGB getPixel(const int px) const noexcept
Definition: juce_RenderingHelpers.h:503
void clipToEdgeTable(const EdgeTable &)
Definition: juce_EdgeTable.cpp:733
ClipRegions< SavedStateType >::Base BaseRegionType
Definition: juce_RenderingHelpers.h:2004
forcedinline void handleEdgeTablePixelFull(const int x) const noexcept
Definition: juce_RenderingHelpers.h:610
forcedinline void handleEdgeTableLine(const int x, const int width, const int alphaLevel) const noexcept
Definition: juce_RenderingHelpers.h:618
float getHeight() const noexcept
Definition: juce_Font.cpp:625
virtual Ptr excludeClipRectangle(const Rectangle< int > &)=0
void draw(RendererType &state, Point< float > pos) const
Definition: juce_RenderingHelpers.h:282
Ptr clipToEdgeTable(const EdgeTable &et)
Definition: juce_RenderingHelpers.h:1800
void removeLast(int howManyToRemove=1, bool deleteObjects=true)
Definition: juce_OwnedArray.h:715
bool isRadial
Definition: juce_ColourGradient.h:152
float getHorizontalScale() const noexcept
Definition: juce_Font.cpp:565
virtual Ptr clipToEdgeTable(const EdgeTable &et)=0
const Rectangle< int > & getMaximumBounds() const noexcept
Definition: juce_EdgeTable.h:79
Point< float > point1
Definition: juce_ColourGradient.h:145
bool clipToRectangle(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:2029
forcedinline uint8 getAlpha() const noexcept
Definition: juce_PixelFormats.h:106
EdgeTableRegion(const RectangleList< int > &r)
Definition: juce_RenderingHelpers.h:1588
float transparencyLayerAlpha
Definition: juce_RenderingHelpers.h:2417
void fillAllWithGradient(SavedStateType &state, ColourGradient &gradient, const AffineTransform &transform, bool isIdentity) const
Definition: juce_RenderingHelpers.h:1725
RectangleListRegion(const Rectangle< int > &r)
Definition: juce_RenderingHelpers.h:1772
void fillWithSolidColour(IteratorType &iter, const PixelARGB colour, bool replaceContents) const
Definition: juce_RenderingHelpers.h:2542
ObjectClass * add(ObjectClass *const newObject) noexcept
Definition: juce_ReferenceCountedArray.h:321
ValueType x
Definition: juce_Point.h:226
Definition: juce_RenderingHelpers.h:277
Definition: juce_PixelFormats.h:361
int right
Definition: juce_RenderingHelpers.h:396
int bottom
Definition: juce_RenderingHelpers.h:396
uint8 * getPixelPointer(int x, int y) const noexcept
Definition: juce_Image.h:331
ValueType y
Definition: juce_Point.h:227
Font font
Definition: juce_RenderingHelpers.h:304
Definition: juce_RenderingHelpers.h:1582
SoftwareRendererSavedState * beginTransparencyLayer(float opacity)
Definition: juce_RenderingHelpers.h:2441
void clipLineToMask(int x, int y, const uint8 *mask, int maskStride, int numPixels)
Definition: juce_EdgeTable.cpp:768
Ptr clipToPath(const Path &p, const AffineTransform &transform)
Definition: juce_RenderingHelpers.h:1799
bool isEmpty() const noexcept
Definition: juce_Rectangle.h:101