Krita Source Code Documentation
Loading...
Searching...
No Matches
KoColorDisplayRendererInterface Class Referenceabstract

#include <KoColorDisplayRendererInterface.h>

+ Inheritance diagram for KoColorDisplayRendererInterface:

Signals

void displayConfigurationChanged ()
 

Public Member Functions

virtual KoColor approximateFromRenderedQColor (const QColor &c) const =0
 
virtual KoColor fromHsv (int h, int s, int v, int a=255) const =0
 
virtual void getHsv (const KoColor &srcColor, int *h, int *s, int *v, int *a=0) const =0
 
virtual const KoColorSpacegetPaintingColorSpace () const =0
 getColorSpace
 
 KoColorDisplayRendererInterface ()
 
virtual qreal maxVisibleFloatValue (const KoChannelInfo *chaninfo) const =0
 
virtual qreal minVisibleFloatValue (const KoChannelInfo *chaninfo) const =0
 
virtual QColor toQColor (const KoColor &c, bool proofToPaintColors=false) const =0
 
virtual QImage toQImage (const KoColorSpace *srcColorSpace, const quint8 *data, QSize size, bool proofPaintColors=false) const =0
 Convert a consecutive block of pixel data to an ARGB32 QImage.
 
 ~KoColorDisplayRendererInterface () override
 

Detailed Description

A special interface class provided by pigment to let widgets render a KoColor on screen using custom profiling provided by the user.

If you want to provide your own rendering of the KoColor on screen, reimplement this class and provide its instance to a supporting widget.

Definition at line 26 of file KoColorDisplayRendererInterface.h.

Constructor & Destructor Documentation

◆ KoColorDisplayRendererInterface()

KoColorDisplayRendererInterface::KoColorDisplayRendererInterface ( )

Definition at line 18 of file KoColorDisplayRendererInterface.cpp.

19{
20}

◆ ~KoColorDisplayRendererInterface()

KoColorDisplayRendererInterface::~KoColorDisplayRendererInterface ( )
override

Definition at line 22 of file KoColorDisplayRendererInterface.cpp.

23{
24}

Member Function Documentation

◆ approximateFromRenderedQColor()

virtual KoColor KoColorDisplayRendererInterface::approximateFromRenderedQColor ( const QColor & c) const
pure virtual

This tries to approximate a rendered QColor into the KoColor of the painting color space. Please note, that in most of the cases the exact reverse transformation does not exist, so the resulting color will be only a rough approximation. Never try to do a round trip like that:

// r will never be equal to c! r = approximateFromRenderedQColor(toQColor(c));

Implemented in KoDumbColorDisplayRenderer, and KisDisplayColorConverter::Private::DisplayRenderer.

◆ displayConfigurationChanged

void KoColorDisplayRendererInterface::displayConfigurationChanged ( )
signal

◆ fromHsv()

virtual KoColor KoColorDisplayRendererInterface::fromHsv ( int h,
int s,
int v,
int a = 255 ) const
pure virtual

◆ getHsv()

virtual void KoColorDisplayRendererInterface::getHsv ( const KoColor & srcColor,
int * h,
int * s,
int * v,
int * a = 0 ) const
pure virtual

◆ getPaintingColorSpace()

virtual const KoColorSpace * KoColorDisplayRendererInterface::getPaintingColorSpace ( ) const
pure virtual

getColorSpace

Returns
the painting color space, this is useful for determining the transform.

Implemented in KoDumbColorDisplayRenderer, and KisDisplayColorConverter::Private::DisplayRenderer.

◆ maxVisibleFloatValue()

virtual qreal KoColorDisplayRendererInterface::maxVisibleFloatValue ( const KoChannelInfo * chaninfo) const
pure virtual
Returns
the maximum value of a floating point channel that can be seen on screen. In normal situation it is 1.0. When the user changes exposure the value varies.

Implemented in KoDumbColorDisplayRenderer, and KisDisplayColorConverter::Private::DisplayRenderer.

◆ minVisibleFloatValue()

virtual qreal KoColorDisplayRendererInterface::minVisibleFloatValue ( const KoChannelInfo * chaninfo) const
pure virtual
Returns
the minimum value of a floating point channel that can be seen on screen

Implemented in KoDumbColorDisplayRenderer, and KisDisplayColorConverter::Private::DisplayRenderer.

◆ toQColor()

virtual QColor KoColorDisplayRendererInterface::toQColor ( const KoColor & c,
bool proofToPaintColors = false ) const
pure virtual

Convert the color c to a custom QColor that will be displayed by the widget on screen. Please note, that the reverse conversion may simply not exist.

Parameters
proofPaintColorsoptionally adjust the color data to painting gamut first

Implemented in KoDumbColorDisplayRenderer, and KisDisplayColorConverter::Private::DisplayRenderer.

◆ toQImage()

virtual QImage KoColorDisplayRendererInterface::toQImage ( const KoColorSpace * srcColorSpace,
const quint8 * data,
QSize size,
bool proofPaintColors = false ) const
pure virtual

Convert a consecutive block of pixel data to an ARGB32 QImage.

Parameters
srcColorSpacethe colorspace the pixel data is in
dataa pointer to a byte array with color data; must cover the requested image size
sizedefines the dimensions of the resulting image
proofPaintColorsoptionally adjust the color data to painting gamut first
Returns
a QImage that can be displayed

Implemented in KoDumbColorDisplayRenderer, and KisDisplayColorConverter::Private::DisplayRenderer.


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