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

A widget that allows to select a combination of auto levels parameters. More...

#include <KisAutoLevelsWidget.h>

+ Inheritance diagram for KisAutoLevelsWidget:

Public Slots

void lockShadowsAndHighlightsAdjustmentMethod ()
 Disables the contrast method combo box. Use this when only one of the methods makes sense.
 
void setHighlightsClipping (qreal newHighlightsClipping)
 Set the normalized percentage used to clip the highlights.
 
void setHighlightsColor (const KoColor &newHighlightsColor)
 Set the color used to move the highlights towards.
 
void setMaximumInputBlackAndWhiteOffset (qreal newMaximumInputBlackAndWhiteOffset)
 Set the normalized maximum value that the black/white point can be moved from the default position of 0.0/1.0.
 
void setMidtonesAdjustmentAmount (qreal newMidtonesAdjustmentAmount)
 Set how much the reference midtone point is deviated from the center of the histogram to the median/mean (depending on the midtone adjustment method selected)
 
void setMidtonesAdjustmentMethod (KisAutoLevels::MidtonesAdjustmentMethod newMethod)
 Set the method used to adjust the midtones.
 
void setMidtonesColor (const KoColor &newMidtonesColor)
 Set the color used to move the midtones towards.
 
void setShadowsAndHighlightsAdjustmentMethod (KisAutoLevels::ShadowsAndHighlightsAdjustmentMethod newMethod)
 Set the method used to adjust the contrast.
 
void setShadowsClipping (qreal newShadowsClipping)
 Set the normalized percentage used to clip the shadows.
 
void setShadowsColor (const KoColor &newShadowsColor)
 Set the color used to move the shadows towards.
 
void unlockShadowsAndHighlightsAdjustmentMethod ()
 Enables the contrast method combo box, allowing the user to choose any of the methods.
 

Signals

void parametersChanged ()
 

Public Member Functions

qreal highlightsClipping () const
 Get the normalized percentage used to clip the highlights.
 
 KisAutoLevelsWidget (QWidget *parent)
 
qreal maximumInputBlackAndWhiteOffset () const
 Get the normalized maximum value that the black/white point can be moved from the default position of 0.0/1.0.
 
qreal midtonesAdjustmentAmount () const
 Get how much the reference midtone point is deviated from the center of the histogram to the median/mean (depending on the midtone adjustment method selected)
 
KisAutoLevels::MidtonesAdjustmentMethod midtonesAdjustmentMethod () const
 Get the method used to adjust the midtones.
 
KoColor outputHighlightsColor () const
 Get the color used to move the highlights towards.
 
KoColor outputMidtonesColor () const
 Get the color used to move the midtones towards.
 
KoColor outputShadowsColor () const
 Get the color used to move the shadows towards.
 
KisAutoLevels::ShadowsAndHighlightsAdjustmentMethod shadowsAndHighlightsAdjustmentMethod () const
 Get the method used to adjust the contrast.
 
qreal shadowsClipping () const
 Get the normalized percentage used to clip the shadows.
 
 ~KisAutoLevelsWidget () override
 

Private Attributes

Ui_KisAutoLevelsWidget m_ui
 

Detailed Description

A widget that allows to select a combination of auto levels parameters.

Definition at line 23 of file KisAutoLevelsWidget.h.

Constructor & Destructor Documentation

◆ KisAutoLevelsWidget()

KisAutoLevelsWidget::KisAutoLevelsWidget ( QWidget * parent)

Definition at line 13 of file KisAutoLevelsWidget.cpp.

14 : QWidget(parent)
15{
16 m_ui.setupUi(this);
17
18 KisSpinBoxI18nHelper::setText(m_ui.sliderShadowsClipping,
19 i18nc("{n} is the number value, % is the percent sign", "{n}%"));
20 m_ui.sliderShadowsClipping->setRange(0.0, 10.0, 2);
21 m_ui.sliderShadowsClipping->setValue(0.1);
22 m_ui.sliderShadowsClipping->setSingleStep(0.1);
23
24 m_ui.sliderHighlightsClipping->setSuffix(m_ui.sliderShadowsClipping->suffix());
25 m_ui.sliderHighlightsClipping->setRange(0.0, 10.0, 2);
26 m_ui.sliderHighlightsClipping->setValue(0.1);
27 m_ui.sliderHighlightsClipping->setSingleStep(0.1);
28
29 m_ui.sliderShadowsAndLightsMaximumOffset->setSuffix(m_ui.sliderShadowsClipping->suffix());
30 m_ui.sliderShadowsAndLightsMaximumOffset->setRange(0.0, 100.0, 2);
31 m_ui.sliderShadowsAndLightsMaximumOffset->setValue(100.0);
32
33 m_ui.sliderMidtonesAdjustmentAmount->setSuffix(m_ui.sliderShadowsClipping->suffix());
34 m_ui.sliderMidtonesAdjustmentAmount->setRange(0.0, 100.0, 2);
35 m_ui.sliderMidtonesAdjustmentAmount->setValue(50.0);
36
37 connect(m_ui.comboBoxShadowsAndLightsMethod, SIGNAL(currentIndexChanged(int)), SIGNAL(parametersChanged()));
38 connect(m_ui.sliderShadowsClipping, SIGNAL(valueChanged(qreal)), SIGNAL(parametersChanged()));
39 connect(m_ui.sliderHighlightsClipping, SIGNAL(valueChanged(qreal)), SIGNAL(parametersChanged()));
40 connect(m_ui.sliderShadowsAndLightsMaximumOffset, SIGNAL(valueChanged(qreal)), SIGNAL(parametersChanged()));
41 connect(m_ui.comboBoxMidtonesMethod, SIGNAL(currentIndexChanged(int)), SIGNAL(parametersChanged()));
42 connect(m_ui.sliderMidtonesAdjustmentAmount, SIGNAL(valueChanged(qreal)), SIGNAL(parametersChanged()));
43 connect(m_ui.buttonShadowsColor, SIGNAL(changed(const KoColor&)), SIGNAL(parametersChanged()));
44 connect(m_ui.buttonHighlightsColor, SIGNAL(changed(const KoColor&)), SIGNAL(parametersChanged()));
45 connect(m_ui.buttonMidtonesColor, SIGNAL(changed(const KoColor&)), SIGNAL(parametersChanged()));
46}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
Ui_KisAutoLevelsWidget m_ui
void setText(QSpinBox *spinBox, const QStringView textTemplate)

References connect(), m_ui, parametersChanged(), and KisSpinBoxI18nHelper::setText().

◆ ~KisAutoLevelsWidget()

KisAutoLevelsWidget::~KisAutoLevelsWidget ( )
override

Definition at line 48 of file KisAutoLevelsWidget.cpp.

49{}

Member Function Documentation

◆ highlightsClipping()

qreal KisAutoLevelsWidget::highlightsClipping ( ) const

Get the normalized percentage used to clip the highlights.

Definition at line 61 of file KisAutoLevelsWidget.cpp.

62{
63 return m_ui.sliderHighlightsClipping->value();
64}

References m_ui.

◆ lockShadowsAndHighlightsAdjustmentMethod

void KisAutoLevelsWidget::lockShadowsAndHighlightsAdjustmentMethod ( )
slot

Disables the contrast method combo box. Use this when only one of the methods makes sense.

Definition at line 141 of file KisAutoLevelsWidget.cpp.

142{
143 m_ui.comboBoxShadowsAndLightsMethod->setEnabled(false);
144}

References m_ui.

◆ maximumInputBlackAndWhiteOffset()

qreal KisAutoLevelsWidget::maximumInputBlackAndWhiteOffset ( ) const

Get the normalized maximum value that the black/white point can be moved from the default position of 0.0/1.0.

Definition at line 66 of file KisAutoLevelsWidget.cpp.

67{
68 return m_ui.sliderShadowsAndLightsMaximumOffset->value();
69}

References m_ui.

◆ midtonesAdjustmentAmount()

qreal KisAutoLevelsWidget::midtonesAdjustmentAmount ( ) const

Get how much the reference midtone point is deviated from the center of the histogram to the median/mean (depending on the midtone adjustment method selected)

Definition at line 76 of file KisAutoLevelsWidget.cpp.

77{
78 return m_ui.sliderMidtonesAdjustmentAmount->value();
79}

References m_ui.

◆ midtonesAdjustmentMethod()

KisAutoLevels::MidtonesAdjustmentMethod KisAutoLevelsWidget::midtonesAdjustmentMethod ( ) const

Get the method used to adjust the midtones.

Definition at line 71 of file KisAutoLevelsWidget.cpp.

72{
73 return static_cast<KisAutoLevels::MidtonesAdjustmentMethod>(m_ui.comboBoxMidtonesMethod->currentIndex());
74}
MidtonesAdjustmentMethod
The different methods to enhance the mid tones.

References m_ui.

◆ outputHighlightsColor()

KoColor KisAutoLevelsWidget::outputHighlightsColor ( ) const

Get the color used to move the highlights towards.

Definition at line 86 of file KisAutoLevelsWidget.cpp.

87{
88 return m_ui.buttonHighlightsColor->color();
89}

References m_ui.

◆ outputMidtonesColor()

KoColor KisAutoLevelsWidget::outputMidtonesColor ( ) const

Get the color used to move the midtones towards.

Definition at line 91 of file KisAutoLevelsWidget.cpp.

92{
93 return m_ui.buttonMidtonesColor->color();
94}

References m_ui.

◆ outputShadowsColor()

KoColor KisAutoLevelsWidget::outputShadowsColor ( ) const

Get the color used to move the shadows towards.

Definition at line 81 of file KisAutoLevelsWidget.cpp.

82{
83 return m_ui.buttonShadowsColor->color();
84}

References m_ui.

◆ parametersChanged

void KisAutoLevelsWidget::parametersChanged ( )
signal

◆ setHighlightsClipping

void KisAutoLevelsWidget::setHighlightsClipping ( qreal newHighlightsClipping)
slot

Set the normalized percentage used to clip the highlights.

Definition at line 106 of file KisAutoLevelsWidget.cpp.

107{
108 m_ui.sliderHighlightsClipping->setValue(newHighlightsClipping);
109}

References m_ui.

◆ setHighlightsColor

void KisAutoLevelsWidget::setHighlightsColor ( const KoColor & newHighlightsColor)
slot

Set the color used to move the highlights towards.

Definition at line 131 of file KisAutoLevelsWidget.cpp.

132{
133 m_ui.buttonHighlightsColor->setColor(newHighlightsColor);
134}

References m_ui.

◆ setMaximumInputBlackAndWhiteOffset

void KisAutoLevelsWidget::setMaximumInputBlackAndWhiteOffset ( qreal newMaximumInputBlackAndWhiteOffset)
slot

Set the normalized maximum value that the black/white point can be moved from the default position of 0.0/1.0.

Definition at line 111 of file KisAutoLevelsWidget.cpp.

112{
113 m_ui.sliderShadowsAndLightsMaximumOffset->setValue(newMaximumInputBlackAndWhiteOffset);
114}

References m_ui.

◆ setMidtonesAdjustmentAmount

void KisAutoLevelsWidget::setMidtonesAdjustmentAmount ( qreal newMidtonesAdjustmentAmount)
slot

Set how much the reference midtone point is deviated from the center of the histogram to the median/mean (depending on the midtone adjustment method selected)

Definition at line 121 of file KisAutoLevelsWidget.cpp.

122{
123 m_ui.sliderMidtonesAdjustmentAmount->setValue(newMidtonesAdjustmentAmount);
124}

References m_ui.

◆ setMidtonesAdjustmentMethod

void KisAutoLevelsWidget::setMidtonesAdjustmentMethod ( KisAutoLevels::MidtonesAdjustmentMethod newMethod)
slot

Set the method used to adjust the midtones.

Definition at line 116 of file KisAutoLevelsWidget.cpp.

117{
118 m_ui.comboBoxMidtonesMethod->setCurrentIndex(static_cast<int>(newMethod));
119}

References m_ui.

◆ setMidtonesColor

void KisAutoLevelsWidget::setMidtonesColor ( const KoColor & newMidtonesColor)
slot

Set the color used to move the midtones towards.

Definition at line 136 of file KisAutoLevelsWidget.cpp.

137{
138 m_ui.buttonMidtonesColor->setColor(newMidtonesColor);
139}

References m_ui.

◆ setShadowsAndHighlightsAdjustmentMethod

void KisAutoLevelsWidget::setShadowsAndHighlightsAdjustmentMethod ( KisAutoLevels::ShadowsAndHighlightsAdjustmentMethod newMethod)
slot

Set the method used to adjust the contrast.

Definition at line 96 of file KisAutoLevelsWidget.cpp.

97{
98 m_ui.comboBoxShadowsAndLightsMethod->setCurrentIndex(static_cast<int>(newMethod));
99}

References m_ui.

◆ setShadowsClipping

void KisAutoLevelsWidget::setShadowsClipping ( qreal newShadowsClipping)
slot

Set the normalized percentage used to clip the shadows.

Definition at line 101 of file KisAutoLevelsWidget.cpp.

102{
103 m_ui.sliderShadowsClipping->setValue(newShadowsClipping);
104}

References m_ui.

◆ setShadowsColor

void KisAutoLevelsWidget::setShadowsColor ( const KoColor & newShadowsColor)
slot

Set the color used to move the shadows towards.

Definition at line 126 of file KisAutoLevelsWidget.cpp.

127{
128 m_ui.buttonShadowsColor->setColor(newShadowsColor);
129}

References m_ui, and KoColor::setColor().

◆ shadowsAndHighlightsAdjustmentMethod()

KisAutoLevels::ShadowsAndHighlightsAdjustmentMethod KisAutoLevelsWidget::shadowsAndHighlightsAdjustmentMethod ( ) const

Get the method used to adjust the contrast.

Definition at line 51 of file KisAutoLevelsWidget.cpp.

52{
53 return static_cast<KisAutoLevels::ShadowsAndHighlightsAdjustmentMethod>(m_ui.comboBoxShadowsAndLightsMethod->currentIndex());
54}
ShadowsAndHighlightsAdjustmentMethod
The different methods to enhance the contrast.

References m_ui.

◆ shadowsClipping()

qreal KisAutoLevelsWidget::shadowsClipping ( ) const

Get the normalized percentage used to clip the shadows.

Definition at line 56 of file KisAutoLevelsWidget.cpp.

57{
58 return m_ui.sliderShadowsClipping->value();
59}

References m_ui.

◆ unlockShadowsAndHighlightsAdjustmentMethod

void KisAutoLevelsWidget::unlockShadowsAndHighlightsAdjustmentMethod ( )
slot

Enables the contrast method combo box, allowing the user to choose any of the methods.

Definition at line 146 of file KisAutoLevelsWidget.cpp.

147{
148 m_ui.comboBoxShadowsAndLightsMethod->setEnabled(true);
149}

References m_ui.

Member Data Documentation

◆ m_ui

Ui_KisAutoLevelsWidget KisAutoLevelsWidget::m_ui
private

Definition at line 126 of file KisAutoLevelsWidget.h.


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