MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / PreparePatternImage

Function PreparePatternImage

Telegram/SourceFiles/ui/chat/chat_theme.cpp:1139–1158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1137}
1138
1139QImage PreparePatternImage(
1140 QImage pattern,
1141 const std::vector<QColor> &bg,
1142 int gradientRotation,
1143 float64 patternOpacity) {
1144 auto result = GenerateBackgroundImage(
1145 pattern.size(),
1146 bg,
1147 gradientRotation,
1148 patternOpacity,
1149 [&](QPainter &p, bool inverted) {
1150 if (inverted) {
1151 pattern = InvertPatternImage(std::move(pattern));
1152 }
1153 p.drawImage(QRect(QPoint(), pattern.size()), pattern);
1154 });
1155
1156 pattern = QImage();
1157 return result;
1158}
1159
1160QImage InvertPatternImage(QImage pattern) {
1161 pattern = std::move(pattern).convertToFormat(

Callers 6

startMethod · 0.85
PrepareScaledFromFullFunction · 0.85
PrepareBackgroundImageFunction · 0.85
prepareThumbnailFromMethod · 0.85

Calls 4

GenerateBackgroundImageFunction · 0.85
InvertPatternImageFunction · 0.85
QImageClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected