| 1137 | } |
| 1138 | |
| 1139 | QImage 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 | |
| 1160 | QImage InvertPatternImage(QImage pattern) { |
| 1161 | pattern = std::move(pattern).convertToFormat( |
no test coverage detected