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

The KisASCCDLConfigWidget class this handles the configuration widget for the slope offset power filter. More...

#include <kis_wdg_asccdl.h>

+ Inheritance diagram for KisASCCDLConfigWidget:

Public Slots

void offsetColorChanged (const KoColor &c)
 
void powerColorChanged (const KoColor &c)
 
void slopeColorChanged (const KoColor &c)
 

Public Member Functions

KisPropertiesConfigurationSP configuration () const override
 
 KisASCCDLConfigWidget (QWidget *parent, const KoColorSpace *cs)
 
void setConfiguration (const KisPropertiesConfigurationSP config) override
 
 ~KisASCCDLConfigWidget () override
 
- Public Member Functions inherited from KisConfigWidget
virtual KoCanvasResourcesInterfaceSP canvasResourcesInterface () const
 
virtual void setCanvasResourcesInterface (KoCanvasResourcesInterfaceSP canvasResourcesInterface)
 
virtual void setView (KisViewManager *view)
 
 ~KisConfigWidget () override
 

Public Attributes

const KoColorSpacem_cs
 
Ui_WdgASCCDL * m_page
 

Additional Inherited Members

- Signals inherited from KisConfigWidget
void sigConfigurationItemChanged ()
 
void sigConfigurationUpdated ()
 
void sigDropLockedConfig (KisPropertiesConfigurationSP p)
 
void sigSaveLockedConfig (KisPropertiesConfigurationSP p)
 
- Protected Member Functions inherited from KisConfigWidget
 KisConfigWidget (QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags(), int delay=200)
 

Detailed Description

The KisASCCDLConfigWidget class this handles the configuration widget for the slope offset power filter.

Future improvements:

  1. Have the cs that the widgets gets when being created be actually the image cs.
  2. Have the shape be force to a HSV wheel with a slider.
  3. Make it easier to select power higher than 1.0 (it is possible, but cumbersome)
  4. make it easier to access ocio from filters.
  5. Implement saturation whenever we can figure out what the formula is for that.
  6. Implement a way to retrieve and store xml data according to the asc-cdl spec...

The main problem for 5 and 6 is that I am unable to find the actual asc-cdl spec.

Definition at line 31 of file kis_wdg_asccdl.h.

Constructor & Destructor Documentation

◆ KisASCCDLConfigWidget()

KisASCCDLConfigWidget::KisASCCDLConfigWidget ( QWidget * parent,
const KoColorSpace * cs )

Definition at line 16 of file kis_wdg_asccdl.cpp.

17 :KisConfigWidget(parent),
18 m_page(new Ui_WdgASCCDL),
19 m_cs(cs)
20
21{
22 KoColor black(Qt::black, cs);
23 m_page->setupUi(this);
24 m_page->btnSlope->setColor(black);
25 m_page->btnOffset->setColor(black);
26 m_page->btnPower->setColor(black);
27
28 m_page->slopeSelector->slotSetColorSpace(m_cs);
29 m_page->offsetSelector->slotSetColorSpace(m_cs);
30 m_page->powerSelector->slotSetColorSpace(m_cs);
31
32 connect(m_page->btnSlope , SIGNAL(changed(KoColor)), this, SLOT(slopeColorChanged(KoColor)));
33 connect(m_page->btnOffset, SIGNAL(changed(KoColor)), this, SLOT(offsetColorChanged(KoColor)));
34 connect(m_page->btnPower , SIGNAL(changed(KoColor)), this, SLOT(powerColorChanged(KoColor)));
35 connect(m_page->slopeSelector, SIGNAL(sigNewColor(KoColor)), this, SLOT(slopeColorChanged(KoColor)));
36 connect(m_page->offsetSelector, SIGNAL(sigNewColor(KoColor)), this, SLOT(offsetColorChanged(KoColor)));
37 connect(m_page->powerSelector, SIGNAL(sigNewColor(KoColor)), this, SLOT(powerColorChanged(KoColor)));
38}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
Ui_WdgASCCDL * m_page
void offsetColorChanged(const KoColor &c)
void powerColorChanged(const KoColor &c)
const KoColorSpace * m_cs
void slopeColorChanged(const KoColor &c)
KisConfigWidget(QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags(), int delay=200)

References connect(), m_cs, m_page, offsetColorChanged(), powerColorChanged(), and slopeColorChanged().

◆ ~KisASCCDLConfigWidget()

KisASCCDLConfigWidget::~KisASCCDLConfigWidget ( )
override

Definition at line 40 of file kis_wdg_asccdl.cpp.

41{
42 delete m_page;
43}

References m_page.

Member Function Documentation

◆ configuration()

KisPropertiesConfigurationSP KisASCCDLConfigWidget::configuration ( ) const
overridevirtual
Returns
the configuration

Implements KisConfigWidget.

Definition at line 45 of file kis_wdg_asccdl.cpp.

46{
48 QVariant colorVariant("KoColor");
49 colorVariant.setValue(m_page->btnSlope->color());
50 config->setProperty("slope", colorVariant);
51 colorVariant.setValue(m_page->btnOffset->color());
52 config->setProperty("offset", colorVariant);
53 colorVariant.setValue(m_page->btnPower->color());
54 config->setProperty("power", colorVariant);
55 return config;
56}
static KisResourcesInterfaceSP instance()

References KisGlobalResourcesInterface::instance(), and m_page.

◆ offsetColorChanged

void KisASCCDLConfigWidget::offsetColorChanged ( const KoColor & c)
slot

Definition at line 91 of file kis_wdg_asccdl.cpp.

92{
93 if (QObject::sender() == m_page->btnOffset) {
94 m_page->offsetSelector->slotSetColor(c);
95 } else {
96 m_page->btnOffset->setColor(c);
97 }
99}
void sigConfigurationItemChanged()

References m_page, and KisConfigWidget::sigConfigurationItemChanged().

◆ powerColorChanged

void KisASCCDLConfigWidget::powerColorChanged ( const KoColor & c)
slot

Definition at line 101 of file kis_wdg_asccdl.cpp.

102{
103 if (QObject::sender() == m_page->btnPower) {
104 m_page->powerSelector->slotSetColor(c);
105 } else {
106 m_page->btnPower->setColor(c);
107 }
109}

References m_page, and KisConfigWidget::sigConfigurationItemChanged().

◆ setConfiguration()

void KisASCCDLConfigWidget::setConfiguration ( const KisPropertiesConfigurationSP config)
overridevirtual
Parameters
configthe configuration for this configuration widget.

Implements KisConfigWidget.

Definition at line 58 of file kis_wdg_asccdl.cpp.

59{
60 KoColor white(m_cs);
61 QVector<float> channels(m_cs->channelCount());
62 m_cs->normalisedChannelsValue(white.data(), channels);
63 channels.fill(1.0);
64 m_cs->fromNormalisedChannelsValue(white.data(), channels);
65 KoColor black(Qt::black, m_cs);
66 KoColor slope = config->getColor("slope", white);
67 slope.convertTo(m_cs);
68 KoColor offset = config->getColor("offset", black);
69 offset.convertTo(m_cs);
70 KoColor power = config->getColor("power", white);
71 power.convertTo(m_cs);
72
73 m_page->btnSlope->setColor(slope);
74 m_page->slopeSelector->slotSetColor(slope);
75 m_page->btnOffset->setColor(offset);
76 m_page->offsetSelector->slotSetColor(offset);
77 m_page->btnPower->setColor (power);
78 m_page->powerSelector->slotSetColor(power);
79}
virtual quint32 channelCount() const =0
virtual void normalisedChannelsValue(const quint8 *pixel, QVector< float > &channels) const =0
virtual void fromNormalisedChannelsValue(quint8 *pixel, const QVector< float > &values) const =0
void convertTo(const KoColorSpace *cs, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags)
Definition KoColor.cpp:136

References KoColorSpace::channelCount(), KoColor::convertTo(), KoColor::data(), KoColorSpace::fromNormalisedChannelsValue(), m_cs, m_page, and KoColorSpace::normalisedChannelsValue().

◆ slopeColorChanged

void KisASCCDLConfigWidget::slopeColorChanged ( const KoColor & c)
slot

Definition at line 81 of file kis_wdg_asccdl.cpp.

82{
83 if (QObject::sender() == m_page->btnSlope) {
84 m_page->slopeSelector->slotSetColor(c);
85 } else {
86 m_page->btnSlope->setColor(c);
87 }
89}

References m_page, and KisConfigWidget::sigConfigurationItemChanged().

Member Data Documentation

◆ m_cs

const KoColorSpace* KisASCCDLConfigWidget::m_cs

Definition at line 43 of file kis_wdg_asccdl.h.

◆ m_page

Ui_WdgASCCDL* KisASCCDLConfigWidget::m_page

Definition at line 42 of file kis_wdg_asccdl.h.


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