Krita Source Code Documentation
Loading...
Searching...
No Matches
KisCIETongueWidget Class Reference

#include <kis_cie_tongue_widget.h>

+ Inheritance diagram for KisCIETongueWidget:

Public Types

enum  model {
  RGBA , CMYKA , XYZA , LABA ,
  GRAYA , YCbCrA
}
 

Public Member Functions

 KisCIETongueWidget (QWidget *parent=nullptr)
 
void loadingFailed ()
 
void loadingStarted ()
 
void setCMYKData (QVector< double > whitepoint)
 
void setGamut (QPolygonF gamut)
 
void setGrayData (QVector< double > whitepoint)
 
void setLABData (QVector< double > whitepoint)
 
void setProfileData (QVector< double > p, QVector< double > w, bool profileData=false)
 
void setProfileDataAvailable (bool dataAvailable)
 
void setRGBData (QVector< double > whitepoint, QVector< double > colorants)
 
void setXYZData (QVector< double > whitepoint)
 
void setYCbCrData (QVector< double > whitepoint)
 
void uncalibratedColor ()
 
 ~KisCIETongueWidget () override
 

Public Attributes

QPixmap cietongue
 
bool cieTongueNeedsUpdate {true}
 
model colorModel {model::RGBA}
 
QPolygonF gamut
 
QPixmap gamutMap
 
double gridside {0.0}
 
bool needUpdatePixmap {false}
 
QPainter painter
 
QPixmap pixmap
 
QVector< double > Primaries {9}
 
bool profileDataAvailable {false}
 
int pxcols {0}
 
int pxrows {0}
 
bool uncalibratedColor {false}
 
QVector< double > whitePoint {3}
 
int xBias {0}
 
int yBias {0}
 

Protected Member Functions

QRgb colorByCoord (double x, double y)
 
void drawLabels ()
 
void drawSmallEllipse (QPointF xy, int r, int g, int b, int sz)
 
void drawTongueAxis ()
 
void drawTongueGrid ()
 
void fillTongue ()
 
int grids (double val) const
 
void outlineTongue ()
 
void paintEvent (QPaintEvent *) override
 
void resizeEvent (QResizeEvent *event) override
 

Private Member Functions

void biasedLine (int x1, int y1, int x2, int y2)
 
void biasedText (int x, int y, const QString &txt)
 
void drawColorantTriangle ()
 
void drawGamut ()
 
void drawPatches ()
 
void drawWhitePoint ()
 
void mapPoint (int &icx, int &icy, QPointF xy)
 
void updatePixmap ()
 
- Private Member Functions inherited from Private
 Private (KisCanvas2 *c)
 

Private Attributes

Private *const d {nullptr}
 
- Private Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 

Detailed Description

Definition at line 128 of file kis_cie_tongue_widget.cpp.

Member Enumeration Documentation

◆ model

Constructor & Destructor Documentation

◆ KisCIETongueWidget()

KisCIETongueWidget::KisCIETongueWidget ( QWidget * parent = nullptr)

Definition at line 156 of file kis_cie_tongue_widget.cpp.

156 :
157 QWidget(parent), d(new Private)
158{
159 d->Primaries.resize(9);
160 d->Primaries.fill(0.0);
161 d->whitePoint.resize(3);
162 d->whitePoint<<0.34773<<0.35952<<1.0;
163 d->gamut = QPolygonF();
164}

References d.

◆ ~KisCIETongueWidget()

KisCIETongueWidget::~KisCIETongueWidget ( )
override

Definition at line 166 of file kis_cie_tongue_widget.cpp.

167{
168 delete d;
169}

References d.

Member Function Documentation

◆ biasedLine()

void KisCIETongueWidget::biasedLine ( int x1,
int y1,
int x2,
int y2 )
private

Definition at line 273 of file kis_cie_tongue_widget.cpp.

274{
275 d->painter.drawLine(x1 + d->xBias, y1, x2 + d->xBias, y2);
276}

References d.

◆ biasedText()

void KisCIETongueWidget::biasedText ( int x,
int y,
const QString & txt )
private

Definition at line 278 of file kis_cie_tongue_widget.cpp.

279{
280 d->painter.drawText(QPoint(d->xBias + x, y), txt);
281}

References d.

◆ colorByCoord()

QRgb KisCIETongueWidget::colorByCoord ( double x,
double y )
protected

Definition at line 283 of file kis_cie_tongue_widget.cpp.

284{
285 // Get xyz components scaled from coordinates
286
287 double cx = ((double)x) / (d->pxcols * devicePixelRatioF() - 1);
288 double cy = 1.0 - ((double)y) / (d->pxrows * devicePixelRatioF() - 1);
289 double cz = 1.0 - cx - cy;
290
291 // Project xyz to XYZ space. Note that in this
292 // particular case we are substituting XYZ with xyz
293
294 //Need to use KoColor here.
295 const KoColorSpace* xyzColorSpace = KoColorSpaceRegistry::instance()->colorSpace("XYZA", "U8");
296 quint8 data[4];
297 data[0]= cx*255;
298 data[1]= cy*255;
299 data[2]= cz*255;
300 data[3]= 1.0*255;
301 KoColor colXYZ(data, xyzColorSpace);
302 QColor colRGB = colXYZ.toQColor();
303 return qRgb(colRGB.red(), colRGB.green(), colRGB.blue());
304}
const KoColorSpace * colorSpace(const QString &colorModelId, const QString &colorDepthId, const KoColorProfile *profile)
static KoColorSpaceRegistry * instance()

References KoColorSpaceRegistry::colorSpace(), d, KoColorSpaceRegistry::instance(), and KoColor::toQColor().

◆ drawColorantTriangle()

void KisCIETongueWidget::drawColorantTriangle ( )
private

Definition at line 479 of file kis_cie_tongue_widget.cpp.

480{
481 d->painter.save();
482 d->painter.setPen(qRgb(80, 80, 80));
483 d->painter.setRenderHint(QPainter::Antialiasing);
484 if (d->colorModel ==KisCIETongueWidget::RGBA) {
485 drawSmallEllipse((QPointF(d->Primaries[0],d->Primaries[1])), 255, 128, 128, 6);
486 drawSmallEllipse((QPointF(d->Primaries[3],d->Primaries[4])), 128, 255, 128, 6);
487 drawSmallEllipse((QPointF(d->Primaries[6],d->Primaries[7])), 128, 128, 255, 6);
488
489 int x1, y1, x2, y2, x3, y3;
490
491 mapPoint(x1, y1, (QPointF(d->Primaries[0],d->Primaries[1])) );
492 mapPoint(x2, y2, (QPointF(d->Primaries[3],d->Primaries[4])) );
493 mapPoint(x3, y3, (QPointF(d->Primaries[6],d->Primaries[7])) );
494
495 biasedLine(x1, y1, x2, y2);
496 biasedLine(x2, y2, x3, y3);
497 biasedLine(x3, y3, x1, y1);
498 } /*else if (d->colorModel ==CMYK){
499 for (i=0; i<d->Primaries.size();i+++){
500 drawSmallEllipse((QPointF(d->Primaries[0],d->Primaries[1])), 160, 160, 160, 6);//greyscale for now
501 //int x1, y1, x2, y2;
502 //mapPoint(x1, y1, (QPointF(d->Primaries[i],d->Primaries[i+1])) );
503 //mapPoint(x2, y2, (QPointF(d->Primaries[i+3],d->Primaries[i+4])) );
504 //biasedLine(x1, y1, x2, y2);
505 }
506 }
507 */
508
509 d->painter.restore();
510}
void biasedLine(int x1, int y1, int x2, int y2)
void drawSmallEllipse(QPointF xy, int r, int g, int b, int sz)
void mapPoint(int &icx, int &icy, QPointF xy)

References biasedLine(), d, drawSmallEllipse(), mapPoint(), and RGBA.

◆ drawGamut()

void KisCIETongueWidget::drawGamut ( )
private

Definition at line 517 of file kis_cie_tongue_widget.cpp.

518{
519 d->gamutMap = QPixmap(size() * devicePixelRatioF());
520 d->gamutMap.setDevicePixelRatio(devicePixelRatioF());
521 d->gamutMap.fill(Qt::black);
522 QPainter gamutPaint;
523 gamutPaint.begin(&d->gamutMap);
524 QPainterPath path;
525 //gamutPaint.setCompositionMode(QPainter::CompositionMode_Clear);
526 gamutPaint.setRenderHint(QPainter::Antialiasing);
527 path.setFillRule(Qt::WindingFill);
528 gamutPaint.setBrush(Qt::white);
529 gamutPaint.setPen(Qt::white);
530 int x, y = 0;
531 if (!d->gamut.empty()) {
532 gamutPaint.setOpacity(0.5);
533 if (d->colorModel == KisCIETongueWidget::RGBA) {
534 mapPoint(x, y, (QPointF(d->Primaries[0],d->Primaries[1])) );
535 path.moveTo(QPointF(x + d->xBias,y));
536 mapPoint(x, y, (QPointF(d->Primaries[3],d->Primaries[4])) );
537 path.lineTo(QPointF(x + d->xBias,y));
538 mapPoint(x, y, (QPointF(d->Primaries[6],d->Primaries[7])) );
539 path.lineTo(QPointF(x + d->xBias,y));
540 mapPoint(x, y, (QPointF(d->Primaries[0],d->Primaries[1])) );
541 path.lineTo(QPointF(x + d->xBias,y));
542 }
543 gamutPaint.drawPath(path);
544 gamutPaint.setOpacity(1.0);
545 foreach (QPointF Point, d->gamut) {
546 mapPoint(x, y, Point);
547 gamutPaint.drawEllipse(x + d->xBias- 2, y-2, 4, 4);
548 //Point.setX(x);
549 //Point.setY(y);
550 //path.lineTo(Point);
551 }
552 }
553
554 gamutPaint.end();
555 d->painter.save();
556 d->painter.setOpacity(0.5);
557 d->painter.setCompositionMode(QPainter::CompositionMode_Multiply);
558 d->painter.drawPixmap(0, 0, d->gamutMap);
559 d->painter.setOpacity(1.0);
560 d->painter.restore();
561}
int size(const Forest< T > &forest)
Definition KisForest.h:1232

References d, mapPoint(), and RGBA.

◆ drawLabels()

void KisCIETongueWidget::drawLabels ( )
protected

Definition at line 417 of file kis_cie_tongue_widget.cpp.

418{
419 QFont font;
420 font.setPointSize(5);
421 d->painter.setFont(font);
422
423 for (int x = 450; x <= 650; x += (x > 470 && x < 600) ? 5 : 10)
424 {
425 QString wl;
426 int bx = 0, by = 0, tx, ty;
427
428 if (x < 520)
429 {
430 bx = grids(-22);
431 by = grids(2);
432 }
433 else if (x < 535)
434 {
435 bx = grids(-8);
436 by = grids(-6);
437 }
438 else
439 {
440 bx = grids(4);
441 }
442
443 int ix = (x - 380) / 5;
444
445 QPointF p(spectral_chromaticity[ix][0], spectral_chromaticity[ix][1]);
446
447 int icx, icy;
448 mapPoint(icx, icy, p);
449
450 tx = icx + ((x < 520) ? grids(-2) : ((x >= 535) ? grids(2) : 0));
451 ty = icy + ((x < 520) ? 0 : ((x >= 535) ? grids(-1) : grids(-2)));
452
453 d->painter.setPen(qRgb(255, 255, 255));
454 biasedLine(icx, icy, tx, ty);
455
456 QRgb Color = colorByCoord(icx, icy);
457 d->painter.setPen(Color);
458
459 QTextStream(&wl) << x;
460 biasedText(icx+bx, icy+by, wl);
461 }
462}
const Params2D p
void biasedText(int x, int y, const QString &txt)
QRgb colorByCoord(double x, double y)
int grids(double val) const
static const double spectral_chromaticity[81][3]
unsigned int QRgb

References biasedLine(), biasedText(), colorByCoord(), d, grids(), mapPoint(), p, and spectral_chromaticity.

◆ drawPatches()

void KisCIETongueWidget::drawPatches ( )
private

◆ drawSmallEllipse()

void KisCIETongueWidget::drawSmallEllipse ( QPointF xy,
int r,
int g,
int b,
int sz )
protected

Definition at line 464 of file kis_cie_tongue_widget.cpp.

465{
466 int icx, icy;
467
468 mapPoint(icx, icy, xy);
469 d->painter.save();
470 d->painter.setRenderHint(QPainter::Antialiasing);
471 d->painter.setPen(qRgb(r, g, b));
472 d->painter.drawEllipse(icx + d->xBias- sz/2, icy-sz/2, sz, sz);
473 d->painter.setPen(qRgb(r/2, g/2, b/2));
474 int sz2 = sz-2;
475 d->painter.drawEllipse(icx + d->xBias- sz2/2, icy-sz2/2, sz2, sz2);
476 d->painter.restore();
477}

References d, and mapPoint().

◆ drawTongueAxis()

void KisCIETongueWidget::drawTongueAxis ( )
protected

Definition at line 374 of file kis_cie_tongue_widget.cpp.

375{
376 QFont font;
377 font.setPointSize(6);
378 d->painter.setFont(font);
379
380 d->painter.setPen(qRgb(255, 255, 255));
381
382 biasedLine(0, 0, 0, d->pxrows - 1);
383 biasedLine(0, d->pxrows-1, d->pxcols-1, d->pxrows - 1);
384
385 for (int y = 1; y <= 9; y += 1)
386 {
387 QString s;
388 int xstart = (y * (d->pxcols - 1)) / 10;
389 int ystart = (y * (d->pxrows - 1)) / 10;
390
391 QTextStream(&s) << y;
392 biasedLine(xstart, d->pxrows - grids(1), xstart, d->pxrows - grids(4));
393 biasedText(xstart - grids(11), d->pxrows + grids(15), s);
394
395 QTextStream(&s) << 10 - y;
396 biasedLine(0, ystart, grids(3), ystart);
397 biasedText(grids(-25), ystart + grids(5), s);
398 }
399}

References biasedLine(), biasedText(), d, and grids().

◆ drawTongueGrid()

void KisCIETongueWidget::drawTongueGrid ( )
protected

Definition at line 401 of file kis_cie_tongue_widget.cpp.

402{
403 d->painter.setPen(qRgb(128, 128, 128));
404 d->painter.setOpacity(0.5);
405
406 for (int y = 1; y <= 9; y += 1)
407 {
408 int xstart = (y * (d->pxcols - 1)) / 10;
409 int ystart = (y * (d->pxrows - 1)) / 10;
410
411 biasedLine(xstart, grids(4), xstart, d->pxrows - grids(4) - 1);
412 biasedLine(grids(7), ystart, d->pxcols-1-grids(7), ystart);
413 }
414 d->painter.setOpacity(1.0);
415}

References biasedLine(), d, and grids().

◆ drawWhitePoint()

void KisCIETongueWidget::drawWhitePoint ( )
private

Definition at line 512 of file kis_cie_tongue_widget.cpp.

513{
514 drawSmallEllipse(QPointF (d->whitePoint[0],d->whitePoint[1]), 255, 255, 255, 8);
515}

References d, and drawSmallEllipse().

◆ fillTongue()

void KisCIETongueWidget::fillTongue ( )
protected

Definition at line 334 of file kis_cie_tongue_widget.cpp.

335{
336 QImage Img = d->cietongue.toImage();
337 Img.setDevicePixelRatio(devicePixelRatioF());
338
339 int x;
340
341 for (int y = 0; y < d->pxrows * devicePixelRatioF(); ++y) {
342 int xe = 0;
343
344 // Find horizontal extents of tongue on this line.
345
346 for (x = 0; x < d->pxcols * devicePixelRatioF(); ++x) {
347 if (QColor(Img.pixel(x + d->xBias, y)) != QColor(Qt::black))
348 {
349 for (xe = (d->pxcols * devicePixelRatioF()) - 1; xe >= x;
350 --xe) {
351 if (QColor(Img.pixel(xe + d->xBias, y)) != QColor(Qt::black))
352 {
353 break;
354 }
355 }
356
357 break;
358 }
359 }
360
361 if (x < d->pxcols * devicePixelRatioF()) {
362 for ( ; x <= xe; ++x)
363 {
364 QRgb Color = colorByCoord(x, y);
365 Img.setPixel(x + d->xBias, y, Color);
366 }
367 }
368 }
369
370 d->cietongue = QPixmap::fromImage(Img, Qt::AvoidDither);
371 d->cietongue.setDevicePixelRatio(devicePixelRatioF());
372}

References colorByCoord(), d, and pxcols.

◆ grids()

int KisCIETongueWidget::grids ( double val) const
protected

Definition at line 171 of file kis_cie_tongue_widget.cpp.

172{
173 return (int) floor(val * d->gridside + 0.5);
174}

References d.

◆ loadingFailed()

void KisCIETongueWidget::loadingFailed ( )

◆ loadingStarted()

void KisCIETongueWidget::loadingStarted ( )

◆ mapPoint()

void KisCIETongueWidget::mapPoint ( int & icx,
int & icy,
QPointF xy )
private

Definition at line 267 of file kis_cie_tongue_widget.cpp.

268{
269 icx = (int) floor((xy.x() * (d->pxcols - 1)) + .5);
270 icy = (int) floor(((d->pxrows - 1) - xy.y() * (d->pxrows - 1)) + .5);
271}

References d.

◆ outlineTongue()

void KisCIETongueWidget::outlineTongue ( )
protected

Definition at line 306 of file kis_cie_tongue_widget.cpp.

307{
308 int lx=0, ly=0;
309 int fx=0, fy=0;
310
311 for (int x = 380; x <= 700; x += 5) {
312 int ix = (x - 380) / 5;
313
314 QPointF p(spectral_chromaticity[ix][0], spectral_chromaticity[ix][1]);
315 int icx, icy;
316 mapPoint(icx, icy, p);
317
318 if (x > 380) {
319 biasedLine(lx, ly, icx, icy);
320 }
321 else {
322 fx = icx;
323 fy = icy;
324 }
325
326 lx = icx;
327 ly = icy;
328
329 }
330
331 biasedLine(lx, ly, fx, fy);
332}

References biasedLine(), mapPoint(), p, and spectral_chromaticity.

◆ paintEvent()

void KisCIETongueWidget::paintEvent ( QPaintEvent * )
overrideprotected

Definition at line 620 of file kis_cie_tongue_widget.cpp.

621{
622 QPainter p(this);
623
624 // Widget is disable : drawing grayed frame.
625
626 if ( !isEnabled() )
627 {
628 p.fillRect(0, 0, width(), height(),
629 palette().color(QPalette::Disabled, QPalette::Window));
630
631 QPen pen(palette().color(QPalette::Disabled, QPalette::WindowText));
632 pen.setStyle(Qt::SolidLine);
633 pen.setWidth(1);
634
635 p.setPen(pen);
636 p.drawRect(0, 0, width(), height());
637
638 return;
639 }
640
641
642 // No profile data to show, or RAW file
643
644 if (!d->profileDataAvailable)
645 {
646 p.fillRect(0, 0, width(), height(), palette().color(QPalette::Active, QPalette::Window));
647 QPen pen(palette().color(QPalette::Active, QPalette::Text));
648 pen.setStyle(Qt::SolidLine);
649 pen.setWidth(1);
650
651 p.setPen(pen);
652 p.drawRect(0, 0, width(), height());
653
654 if (d->uncalibratedColor)
655 {
656 p.drawText(0, 0, width(), height(), Qt::AlignCenter,
657 i18n("Uncalibrated color space"));
658 }
659 else
660 {
661 p.setPen(Qt::red);
662 p.drawText(0, 0, width(), height(), Qt::AlignCenter,
663 i18n("No profile available..."));
664 }
665
666 return;
667 }
668
669 // Create CIE tongue if needed
670 if (d->needUpdatePixmap)
671 {
672 updatePixmap();
673 }
674
675 // draw prerendered tongue
676 p.drawPixmap(0, 0, d->pixmap);
677}
rgba palette[MAX_PALETTE]
Definition palette.c:35

References d, p, palette, and updatePixmap().

◆ resizeEvent()

void KisCIETongueWidget::resizeEvent ( QResizeEvent * event)
overrideprotected

Definition at line 679 of file kis_cie_tongue_widget.cpp.

680{
681 QWidget::resizeEvent(event);
682 d->needUpdatePixmap = true;
683 d->cieTongueNeedsUpdate = true;
684}

References d.

◆ setCMYKData()

void KisCIETongueWidget::setCMYKData ( QVector< double > whitepoint)

Definition at line 205 of file kis_cie_tongue_widget.cpp.

206{
207 if (whitepoint.size()==3){
208 //d->Primaries= colorants;
209
210 d->whitePoint = whitepoint;
211 d->needUpdatePixmap = true;
212 d->colorModel = KisCIETongueWidget::CMYKA;
213 d->profileDataAvailable = true;
214 } else {
215 return;
216 }
217}

References CMYKA, and d.

◆ setGamut()

void KisCIETongueWidget::setGamut ( QPolygonF gamut)

Definition at line 188 of file kis_cie_tongue_widget.cpp.

189{
190 d->gamut=gamut;
191}

References d, and gamut.

◆ setGrayData()

void KisCIETongueWidget::setGrayData ( QVector< double > whitepoint)

Definition at line 229 of file kis_cie_tongue_widget.cpp.

230{
231 if (whitepoint.size()==3){
232 d->whitePoint = whitepoint;
233 d->needUpdatePixmap = true;
234 d->colorModel = KisCIETongueWidget::GRAYA;
235 d->profileDataAvailable = true;
236 } else {
237 return;
238 }
239}

References d, and GRAYA.

◆ setLABData()

void KisCIETongueWidget::setLABData ( QVector< double > whitepoint)

Definition at line 240 of file kis_cie_tongue_widget.cpp.

241{
242 if (whitepoint.size()==3){
243 d->whitePoint = whitepoint;
244 d->needUpdatePixmap = true;
245 d->colorModel = KisCIETongueWidget::LABA;
246 d->profileDataAvailable = true;
247 } else {
248 return;
249 }
250}

References d, and LABA.

◆ setProfileData()

void KisCIETongueWidget::setProfileData ( QVector< double > p,
QVector< double > w,
bool profileData = false )

Definition at line 176 of file kis_cie_tongue_widget.cpp.

177{
178 d->profileDataAvailable = profileData;
179 if (profileData){
180 d->Primaries= p;
181
182 d->whitePoint = w;
183 d->needUpdatePixmap = true;
184 } else {
185 return;
186 }
187}

References d, and p.

◆ setProfileDataAvailable()

void KisCIETongueWidget::setProfileDataAvailable ( bool dataAvailable)

Definition at line 263 of file kis_cie_tongue_widget.cpp.

264{
265 d->profileDataAvailable = dataAvailable;
266}

References d.

◆ setRGBData()

void KisCIETongueWidget::setRGBData ( QVector< double > whitepoint,
QVector< double > colorants )

Definition at line 192 of file kis_cie_tongue_widget.cpp.

193{
194 if (colorants.size()==9){
195 d->Primaries= colorants;
196
197 d->whitePoint = whitepoint;
198 d->needUpdatePixmap = true;
199 d->colorModel = KisCIETongueWidget::RGBA;
200 d->profileDataAvailable = true;
201 } else {
202 return;
203 }
204}

References d, and RGBA.

◆ setXYZData()

void KisCIETongueWidget::setXYZData ( QVector< double > whitepoint)

Definition at line 218 of file kis_cie_tongue_widget.cpp.

219{
220 if (whitepoint.size()==3){
221 d->whitePoint = whitepoint;
222 d->needUpdatePixmap = true;
223 d->colorModel = KisCIETongueWidget::XYZA;
224 d->profileDataAvailable = true;
225 } else {
226 return;
227 }
228}

References d, and XYZA.

◆ setYCbCrData()

void KisCIETongueWidget::setYCbCrData ( QVector< double > whitepoint)

Definition at line 251 of file kis_cie_tongue_widget.cpp.

252{
253 if (whitepoint.size()==3){
254 d->whitePoint = whitepoint;
255 d->needUpdatePixmap = true;
256 d->colorModel = KisCIETongueWidget::YCbCrA;
257 d->profileDataAvailable = true;
258 } else {
259 return;
260 }
261}

References d, and YCbCrA.

◆ uncalibratedColor()

void KisCIETongueWidget::uncalibratedColor ( )

◆ updatePixmap()

void KisCIETongueWidget::updatePixmap ( )
private

Definition at line 563 of file kis_cie_tongue_widget.cpp.

564{
565 d->needUpdatePixmap = false;
566 d->pixmap = QPixmap(size() * devicePixelRatioF());
567 d->pixmap.setDevicePixelRatio(devicePixelRatioF());
568
569 if (d->cieTongueNeedsUpdate){
570 // Draw the CIE tongue curve. I don't see why we need to redraw it every time the whitepoint and such changes so we cache it.
571 d->cieTongueNeedsUpdate = false;
572 d->cietongue = QPixmap(size() * devicePixelRatioF());
573 d->cietongue.setDevicePixelRatio(devicePixelRatioF());
574 d->cietongue.fill(Qt::black);
575 d->painter.begin(&d->cietongue);
576
577 int pixcols = static_cast<int>(d->cietongue.width()
578 / d->cietongue.devicePixelRatioF());
579 int pixrows = static_cast<int>(d->cietongue.height()
580 / d->cietongue.devicePixelRatioF());
581
582 d->gridside = (qMin(pixcols, pixrows)) / 512.0;
583 d->xBias = grids(32);
584 d->yBias = grids(20);
585 d->pxcols = pixcols - d->xBias;
586 d->pxrows = pixrows - d->yBias;
587
588 d->painter.setBackground(QBrush(qRgb(0, 0, 0)));
589 d->painter.setPen(qRgb(255, 255, 255));
590
592 d->painter.end();
593
594 fillTongue();
595
596 d->painter.begin(&d->cietongue);
598 drawLabels();
600 d->painter.end();
601 }
602 d->pixmap = d->cietongue;
603
604 d->painter.begin(&d->pixmap);
605 //draw whitepoint and colorants
606 if (d->whitePoint[2] > 0.0)
607 {
609 }
610
611 if (d->Primaries[2] != 0.0)
612 {
614 }
615 drawGamut();
616
617 d->painter.end();
618}

References d, drawColorantTriangle(), drawGamut(), drawLabels(), drawTongueAxis(), drawTongueGrid(), drawWhitePoint(), fillTongue(), grids(), and outlineTongue().

Member Data Documentation

◆ cietongue

QPixmap KisCIETongueWidget::cietongue

Definition at line 147 of file kis_cie_tongue_widget.cpp.

◆ cieTongueNeedsUpdate

bool KisCIETongueWidget::cieTongueNeedsUpdate {true}

Definition at line 134 of file kis_cie_tongue_widget.cpp.

134{true};

◆ colorModel

model KisCIETongueWidget::colorModel {model::RGBA}

Definition at line 153 of file kis_cie_tongue_widget.cpp.

◆ d

Private* const KisCIETongueWidget::d {nullptr}
private

Definition at line 86 of file kis_cie_tongue_widget.h.

86{nullptr};

◆ gamut

QPolygonF KisCIETongueWidget::gamut

Definition at line 152 of file kis_cie_tongue_widget.cpp.

◆ gamutMap

QPixmap KisCIETongueWidget::gamutMap

Definition at line 148 of file kis_cie_tongue_widget.cpp.

◆ gridside

double KisCIETongueWidget::gridside {0.0}

Definition at line 142 of file kis_cie_tongue_widget.cpp.

142{0.0};

◆ needUpdatePixmap

bool KisCIETongueWidget::needUpdatePixmap {false}

Definition at line 133 of file kis_cie_tongue_widget.cpp.

133{false};

◆ painter

QPainter KisCIETongueWidget::painter

Definition at line 144 of file kis_cie_tongue_widget.cpp.

◆ pixmap

QPixmap KisCIETongueWidget::pixmap

Definition at line 146 of file kis_cie_tongue_widget.cpp.

◆ Primaries

QVector<double> KisCIETongueWidget::Primaries {9}

Definition at line 150 of file kis_cie_tongue_widget.cpp.

150{9};

◆ profileDataAvailable

bool KisCIETongueWidget::profileDataAvailable {false}

Definition at line 132 of file kis_cie_tongue_widget.cpp.

132{false};

◆ pxcols

int KisCIETongueWidget::pxcols {0}

Definition at line 139 of file kis_cie_tongue_widget.cpp.

139{0};

◆ pxrows

int KisCIETongueWidget::pxrows {0}

Definition at line 140 of file kis_cie_tongue_widget.cpp.

140{0};

◆ uncalibratedColor

bool KisCIETongueWidget::uncalibratedColor {false}

Definition at line 135 of file kis_cie_tongue_widget.cpp.

135{false};

◆ whitePoint

QVector<double> KisCIETongueWidget::whitePoint {3}

Definition at line 151 of file kis_cie_tongue_widget.cpp.

151{3};

◆ xBias

int KisCIETongueWidget::xBias {0}

Definition at line 137 of file kis_cie_tongue_widget.cpp.

137{0};

◆ yBias

int KisCIETongueWidget::yBias {0}

Definition at line 138 of file kis_cie_tongue_widget.cpp.

138{0};

The documentation for this class was generated from the following files: