38 outerRadiusSquared*=outerRadiusSquared;
39 innerRadiusSquared*=innerRadiusSquared;
42 Eigen::Vector2i relativeVector(x-
width()/2, y-
height()/2);
44 if(relativeVector.squaredNorm() < outerRadiusSquared
45 && relativeVector.squaredNorm() > innerRadiusSquared) {
53 qreal devicePixelRatioF = painter->device()->devicePixelRatioF();
67 QPoint startPoint = QPoint(
width()/2 - (
m_pixelCache.width()/(2*devicePixelRatioF)),
75 int y_start, y_end, x_start, x_end;
82 painter->setPen(QColor(0,0,0));
83 painter->drawLine(x_start, y_start, x_end, y_end);
91 painter->setPen(QColor(255,255,255));
92 painter->drawLine(x_start, y_start, x_end, y_end);
143 cache.setDevicePixelRatio(devicePixelRatioF);
145 Eigen::Vector2i center(cache.width()/2., cache.height()/2.);
147 int outerRadiusHighDPI =
outerRadius()*devicePixelRatioF;
148 int innerRadiusHighDPI =
innerRadius()*devicePixelRatioF;
151 for(
int x=0; x<cache.width(); x++) {
152 for(
int y=0; y<cache.height(); y++) {
153 Eigen::Vector2i currentPoint((
float)x, (
float)y);
154 Eigen::Vector2i relativeVector = currentPoint-center;
156 qreal currentRadius = relativeVector.squaredNorm();
157 currentRadius=sqrt(currentRadius);
159 if(currentRadius < outerRadiusHighDPI+1
160 && currentRadius > innerRadiusHighDPI-1)
163 float angle = std::atan2((
float)relativeVector.y(), (
float)relativeVector.x())+((float)
M_PI);
164 angle/=2*((float)
M_PI);
166 if(currentRadius < outerRadiusHighDPI
167 && currentRadius > innerRadiusHighDPI) {
173 if(currentRadius > outerRadiusHighDPI) {
176 coef+=outerRadiusHighDPI;
181 coef-=innerRadiusHighDPI;
183 coef=qBound(qreal(0.), coef, qreal(1.));
189 QRgb color = qRgba(red*coef, green*coef, blue*coef, 255*coef);
190 cache.setPixel(x, y, color);
194 cache.setPixel(x, y, qRgba(0,0,0,0));
void paramChanged(qreal hue, qreal hsvSaturation, qreal value, qreal hslSaturation, qreal lightness, qreal hsiSaturation, qreal intensity, qreal hsySaturation, qreal luma)
-1, if unaffected
void getHsyF(const KoColor &srcColor, qreal *h, qreal *s, qreal *y, qreal R=0.2126, qreal G=0.7152, qreal B=0.0722, qreal gamma=2.2)