14 , ui(new Ui_WidgetConvertHeightToNormalMap)
19 QVBoxLayout *layout =
new QVBoxLayout(
this);
20 layout->addWidget(
new QLabel(i18n(
"Height to Normal Map does not work on this colorspace.")));
26 m_types <<
"prewitt"<<
"sobol"<<
"simple";
29 swizzle<<
"X+" <<
"X-" <<
"Y+" <<
"Y-" <<
"Z+" <<
"Z-";
39 ui->cmbChannel->addItem(channels.at(c)->name());
42 ui->btnAspect->setKeepAspectRatio(
false);
43 ui->sldHorizontalRadius->setRange(1.0, 100.0, 2);
44 ui->sldHorizontalRadius->setSingleStep(0.01);
45 ui->sldHorizontalRadius->setPrefix(i18n(
"Horizontal Radius:"));
48 ui->sldVerticalRadius->setRange(1.0, 100.0, 2);
49 ui->sldVerticalRadius->setSingleStep(0.01);
50 ui->sldVerticalRadius->setPrefix(i18n(
"Vertical Radius:"));
74 config->setProperty(
"horizRadius",
ui->sldHorizontalRadius->value());
75 config->setProperty(
"vertRadius",
ui->sldVerticalRadius->value());
76 config->setProperty(
"type",
m_types.at(
ui->cmbType->currentIndex()));
77 config->setProperty(
"lockAspect",
ui->btnAspect->keepAspectRatio());
78 config->setProperty(
"channelToConvert",
ui->cmbChannel->currentIndex());
79 config->setProperty(
"redSwizzle",
ui->cmbRed->currentIndex());
80 config->setProperty(
"greenSwizzle",
ui->cmbGreen->currentIndex());
81 config->setProperty(
"blueSwizzle",
ui->cmbBlue->currentIndex());
90 ui->sldHorizontalRadius->setValue(config->getFloat(
"horizRadius", 1.0));
91 ui->sldVerticalRadius->setValue(config->getFloat(
"vertRadius", 1.0));
93 if (
m_types.contains(config->getString(
"type",
"prewitt"))){
94 index =
m_types.indexOf(config->getString(
"type",
"sobol"));
96 ui->cmbType->setCurrentIndex(index);
97 ui->cmbChannel->setCurrentIndex(config->getInt(
"channelToConvert", 0));
98 ui->btnAspect->setKeepAspectRatio(config->getBool(
"lockAspect",
false));
99 ui->cmbRed->setCurrentIndex(config->getInt(
"redSwizzle",
xPlus));
100 ui->cmbGreen->setCurrentIndex(config->getInt(
"greenSwizzle",
yPlus));
101 ui->cmbBlue->setCurrentIndex(config->getInt(
"blueSwizzle",
zPlus));
106 ui->sldHorizontalRadius->blockSignals(
true);
107 ui->sldHorizontalRadius->setValue(r);
108 ui->sldHorizontalRadius->blockSignals(
false);
110 if (
ui->btnAspect->keepAspectRatio()) {
111 ui->sldVerticalRadius->blockSignals(
true);
112 ui->sldVerticalRadius->setValue(r);
113 ui->sldVerticalRadius->blockSignals(
false);
119 ui->sldVerticalRadius->blockSignals(
true);
120 ui->sldVerticalRadius->setValue(r);
121 ui->sldVerticalRadius->blockSignals(
false);
123 if (
ui->btnAspect->keepAspectRatio()) {
124 ui->sldHorizontalRadius->blockSignals(
true);
125 ui->sldHorizontalRadius->setValue(r);
126 ui->sldHorizontalRadius->blockSignals(
false);