39 this->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
40 m_d->layout =
new QFormLayout(
this);
64 m_d->layout =
new QFormLayout(
this);
66 Q_FOREACH(QObject *o,
m_d->labels) {
69 Q_FOREACH(QObject *o,
m_d->spinBoxList) {
72 Q_FOREACH(QObject *o,
m_d->doubleSpinBoxList) {
77 m_d->spinBoxList.clear();
78 m_d->doubleSpinBoxList.clear();
82 QString inputLabel = channel->
name() +
":";
83 QLabel *inlb =
new QLabel(
this);
85 inlb->setText(inputLabel);
90 input->setMaximum(0xFF);
91 m_d->spinBoxList.append(input);
94 inlb->setVisible(
false);
95 input->setVisible(
false);
96 input->blockSignals(
true);
99 m_d->layout->addRow(inlb, input);
105 input->setMinimum(0);
106 input->setMaximum(0xFFFF);
107 m_d->spinBoxList.append(input);
110 inlb->setVisible(
false);
111 input->setVisible(
false);
112 input->blockSignals(
true);
115 m_d->layout->addRow(inlb,input);
121 input->setMinimum(0);
122 input->setMaximum(0xFFFFFFFF);
123 m_d->spinBoxList.append(input);
126 inlb->setVisible(
false);
127 input->setVisible(
false);
128 input->blockSignals(
true);
131 m_d->layout->addRow(inlb,input);
137 half m_uiMin, m_uiMax;
147 input->setMinimum(m_uiMin);
148 input->setMaximum(m_uiMax);
149 input->setSingleStep(0.1);
150 m_d->doubleSpinBoxList.append(input);
153 inlb->setVisible(
false);
154 input->setVisible(
false);
155 input->blockSignals(
true);
158 m_d->layout->addRow(inlb,input);
164 float m_uiMin, m_uiMax;
174 input->setMinimum(m_uiMin);
175 input->setMaximum(m_uiMax);
176 input->setSingleStep(0.1);
177 m_d->doubleSpinBoxList.append(input);
180 inlb->setVisible(
false);
181 input->setVisible(
false);
182 input->blockSignals(
true);
185 m_d->layout->addRow(inlb,input);
199 int channelcount =
m_d->cs->channelCount();
200 QVector <float> channelValues(channelcount);
201 channelValues.fill(1.0);
204 for (
int i = 0; i < (int)qAbs(
m_d->cs->colorChannelCount()); i++) {
209 int value =
m_d->spinBoxList.at(i)->value();
220 channelValues[channelposition] =
m_d->doubleSpinBoxList.at(i)->value();
225 m_d->cs->fromNormalisedChannelsValue(newColor.
data(), channelValues);
228 m_d->color = newColor;
239 int channelcount =
m_d->cs->channelCount();
240 QVector <float> channelValues(channelcount);
241 channelValues.fill(1.0);
242 m_d->cs->normalisedChannelsValue(
m_d->color.data(), channelValues);
250 for (i=0; i<
m_d->spinBoxList.size(); i++) {
251 m_d->spinBoxList.at(i)->blockSignals(
true);
253 for (i=0; i<
m_d->doubleSpinBoxList.size(); i++) {
254 m_d->doubleSpinBoxList.at(i)->blockSignals(
true);
257 for (i = 0; i < (int)qAbs(
m_d->cs->colorChannelCount()); i++) {
261 m_d->spinBoxList.at(i)->setValue(
value);
267 float value = channels.at(i)->getUIMin() + channelValues[channelposition] * channels.at(i)->getUIUnitValue();
268 m_d->doubleSpinBoxList.at(i)->setValue(
value);
272 for (i=0; i<
m_d->spinBoxList.size(); i++) {
273 m_d->spinBoxList.at(i)->blockSignals(
false);
275 for (i=0; i<
m_d->doubleSpinBoxList.size(); i++) {
276 m_d->doubleSpinBoxList.at(i)->blockSignals(
false);
float value(const T *src, size_t ch)
const KoID CMYKAColorModelID("CMYKA", ki18n("CMYK/Alpha"))
const KoID LABAColorModelID("LABA", ki18n("L*a*b*/Alpha"))
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
The KisDoubleParseSpinBox class is a cleverer doubleSpinBox, able to parse arithmetic expressions.
The KisIntParseSpinBox class is a cleverer SpinBox, able to parse arithmetic expressions.
void sigNewColor(KoColor color)
~KisSpinboxColorSelector() override
void createColorFromSpinboxValues()
void slotSetColor(KoColor color)
void updateSpinboxesWithNewValues()
void slotSetColorSpace(const KoColorSpace *cs)
KisSpinboxColorSelector(QWidget *parent)
void slotUpdateFromSpinBoxes()
const QScopedPointer< Private > m_d
@ ALPHA
The channel represents the opacity of a pixel.
@ UINT8
use this for an unsigned integer 8bits channel
@ UINT16
use this for an integer 16bits channel
@ FLOAT32
use this for a float 32bits channel
@ FLOAT16
use this for a float 16bits channel
@ UINT32
use this for an unsigned integer 21bits channel
@ FLOAT64
use this for a float 64bits channel
enumChannelType channelType() const
static int displayPositionToChannelIndex(int displayPosition, const QList< KoChannelInfo * > &channels)
enumChannelValueType channelValueType() const
static QList< KoChannelInfo * > displayOrderSorted(const QList< KoChannelInfo * > &channels)
double getUIMin(void) const
double getUIMax(void) const
static _Tdst scaleToA(_T a)
virtual KoID colorModelId() const =0
void setOpacity(quint8 alpha)
QList< KisIntParseSpinBox * > spinBoxList
QList< KisDoubleParseSpinBox * > doubleSpinBoxList