summaryrefslogtreecommitdiffstats
path: root/kipi-plugins/batchprocessimages/effectoptionsdialog.cpp
blob: 745d3f8973b0bab47aa900b0826ff2b174d49234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
/* ============================================================
 *
 * This file is a part of kipi-plugins project
 * http://www.kipi-plugins.org
 *
 * Date        : 2004-10-01
 * Description : a kipi plugin to batch process images
 *
 * Copyright (C) 2004-2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
 * Public License as published by the Free Software Foundation;
 * either version 2, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * ============================================================ */

// Include files for TQt

#include <tqvbox.h>
#include <tqlayout.h>
#include <tqwidget.h>
#include <tqwhatsthis.h>
#include <tqlabel.h>
#include <tqpushbutton.h>
#include <tqgroupbox.h>
#include <tqcombobox.h>
#include <tqcolor.h>

// Include files for KDE

#include <klocale.h>
#include <knuminput.h>
#include <kcolorbutton.h>

// Local includes

#include "effectoptionsdialog.h"
#include "effectoptionsdialog.moc"

namespace KIPIBatchProcessImagesPlugin
{

EffectOptionsDialog::EffectOptionsDialog(TQWidget *parent, int EffectType)
                        : KDialogBase( parent, "EffectOptionsDialog", true,
                          i18n("Effect Options"), Ok|Cancel, Ok, false)
{
    TQWidget* box = new TQWidget( this );
    setMainWidget(box);
    TQVBoxLayout *dvlay = new TQVBoxLayout( box, 10, spacingHint() );
    TQString whatsThis;

    if (EffectType == 0) // Adaptive threshold
       {
       TQLabel *m_label_latWidth = new TQLabel (i18n("Width:"), box);
       dvlay->addWidget( m_label_latWidth );
       m_latWidth = new KIntNumInput(50, box);
       m_latWidth->setRange(0, 200, 1, true );
       TQWhatsThis::add( m_latWidth, i18n("<p>Select here the value which represents the width "
                                         "of the local neighborhood.") );
       m_label_latWidth->setBuddy( m_latWidth );
       dvlay->addWidget( m_latWidth );

       TQLabel *m_label_latHeight = new TQLabel (i18n("Height:"), box);
       dvlay->addWidget( m_label_latHeight );
       m_latHeight = new KIntNumInput(50, box);
       m_latHeight->setRange(0, 200, 1, true );
       TQWhatsThis::add( m_latHeight, i18n("<p>Select here the value which represents the height of "
                                          "the local neighborhood.") );
       m_label_latHeight->setBuddy( m_latHeight );
       dvlay->addWidget( m_latHeight );

       TQLabel *m_label_latOffset = new TQLabel (i18n("Offset:"), box);
       dvlay->addWidget( m_label_latOffset );
       m_latOffset = new KIntNumInput(1, box);
       m_latOffset->setRange(0, 200, 1, true );
       TQWhatsThis::add( m_latOffset, i18n("<p>Select here the value which represents the mean offset.") );
       m_label_latOffset->setBuddy( m_latOffset );
       dvlay->addWidget( m_latOffset );
       }

    if (EffectType == 1) // Charcoal
       {
       TQLabel *m_label_charcoalRadius = new TQLabel (i18n("Radius:"), box);
       dvlay->addWidget( m_label_charcoalRadius );
       m_charcoalRadius = new KIntNumInput(3, box);
       m_charcoalRadius->setRange(0, 20, 1, true );
       TQWhatsThis::add( m_charcoalRadius, i18n("<p>Select here the value which represents the "
                                               "radius of the pixel neighborhood.") );
       m_label_charcoalRadius->setBuddy( m_charcoalRadius );
       dvlay->addWidget( m_charcoalRadius );

       TQLabel *m_label_charcoalDeviation = new TQLabel (i18n("Deviation:"), box);
       dvlay->addWidget( m_label_charcoalDeviation );
       m_charcoalDeviation = new KIntNumInput(3, box);
       m_charcoalDeviation->setRange(0, 20, 1, true );
       TQWhatsThis::add( m_charcoalDeviation, i18n("<p>Select here the value which represents the "
                                                  "standard deviation of the Gaussian, in pixels.") );
       m_label_charcoalDeviation->setBuddy( m_charcoalDeviation );
       dvlay->addWidget( m_charcoalDeviation );
       }

    if (EffectType == 2) // Detect edges
       {
       TQLabel *m_label_edgeRadius = new TQLabel (i18n("Radius:"), box);
       dvlay->addWidget( m_label_edgeRadius );
       m_edgeRadius = new KIntNumInput(3, box);
       m_edgeRadius->setRange(0, 20, 1, true );
       TQWhatsThis::add( m_edgeRadius, i18n("<p>Select here the value which represents the radius of "
                                           "the pixel neighborhood. Radius defines the radius of the "
                                           "convolution filter. If you use a radius of 0 the algorithm selects "
                                           "a suitable radius.") );
       m_label_edgeRadius->setBuddy( m_edgeRadius );
       dvlay->addWidget( m_edgeRadius );
       }

    if (EffectType == 3) // Emboss
       {
       TQLabel *m_label_embossRadius = new TQLabel (i18n("Radius:"), box);
       dvlay->addWidget( m_label_embossRadius );
       m_embossRadius = new KIntNumInput(3, box);
       m_embossRadius->setRange(0, 20, 1, true );
       TQWhatsThis::add( m_embossRadius, i18n("<p>Select here the value which represents the radius of the "
                                             "pixel neighborhood. For reasonable results, radius should be "
                                             "larger than deviation. If you use a radius of 0 the algorithm "
                                             "selects a suitable radius.") );
       m_label_embossRadius->setBuddy( m_embossRadius );
       dvlay->addWidget( m_embossRadius );

       TQLabel *m_label_embossDeviation = new TQLabel (i18n("Deviation:"), box);
       dvlay->addWidget( m_label_embossDeviation );
       m_embossDeviation = new KIntNumInput(3, box);
       m_embossDeviation->setRange(0, 20, 1, true );
       TQWhatsThis::add( m_embossDeviation, i18n("<p>Select here the value which represents the standard "
                                                "deviation of the Gaussian, in pixels.") );
       m_label_embossDeviation->setBuddy( m_embossDeviation );
       dvlay->addWidget( m_embossDeviation );
       }

    if (EffectType == 4) // Implode
       {
       TQLabel *m_label_implodeFactor = new TQLabel (i18n("Factor:"), box);
       dvlay->addWidget( m_label_implodeFactor );
       m_implodeFactor = new KIntNumInput(1, box);
       m_implodeFactor->setRange(0, 20, 1, true );
       TQWhatsThis::add( m_implodeFactor, i18n("<p>Select here the value which represents the extent of "
                                              "the implosion.") );
       m_label_implodeFactor->setBuddy( m_implodeFactor );
       dvlay->addWidget( m_implodeFactor );
       }

    if (EffectType == 5) // Paint
       {
       TQLabel *m_label_paintRadius = new TQLabel (i18n("Radius:"), box);
       dvlay->addWidget( m_label_paintRadius );
       m_paintRadius = new KIntNumInput(3, box);
       m_paintRadius->setRange(0, 20, 1, true );
       TQWhatsThis::add( m_paintRadius, i18n("<p>Select here the value which represents the radius of "
                                            "the circular neighborhood. Each pixel is replaced by the "
                                            "most frequent color occurring in a circular region defined "
                                            "by the radius.") );
       m_label_paintRadius->setBuddy( m_paintRadius );
       dvlay->addWidget( m_paintRadius );
       }

    if (EffectType == 6) // Shade light
       {
       TQLabel *m_label_shadeAzimuth = new TQLabel (i18n("Azimuth:"), box);
       dvlay->addWidget( m_label_shadeAzimuth );
       m_shadeAzimuth = new KIntNumInput(40, box);
       m_shadeAzimuth->setRange(0, 360, 1, true );
       TQWhatsThis::add( m_shadeAzimuth, i18n("<p>Select here the value which represents the azimuth of "
                                             "the light source direction. The azimuth is measured in degrees "
                                             "above the x axis.") );
       m_label_shadeAzimuth->setBuddy( m_shadeAzimuth );
       dvlay->addWidget( m_shadeAzimuth );

       TQLabel *m_label_shadeElevation = new TQLabel (i18n("Elevation:"), box);
       dvlay->addWidget( m_label_shadeElevation );
       m_shadeElevation = new KIntNumInput(40, box);
       m_shadeElevation->setRange(0, 500, 1, true );
       TQWhatsThis::add( m_shadeElevation, i18n("<p>Select here the value which represents the elevation of "
                                               "the light source direction. The elevation is measured in "
                                               "pixels above the Z axis.") );
       m_label_shadeElevation->setBuddy( m_shadeElevation );
       dvlay->addWidget( m_shadeElevation );
       }

    if (EffectType == 7) // Solarize
       {
       TQLabel *m_label_solarizeFactor = new TQLabel (i18n("Factor:"), box);
       dvlay->addWidget( m_label_solarizeFactor );
       m_solarizeFactor = new KIntNumInput(3, box);
       m_solarizeFactor->setRange(0, 99, 1, true );
       TQWhatsThis::add( m_solarizeFactor, i18n("<p>Select here the value which represents the percent-"
                                               "threshold of the solarize intensity.") );
       m_label_solarizeFactor->setBuddy( m_solarizeFactor );
       dvlay->addWidget( m_solarizeFactor );
       }

    if (EffectType == 8) // Spread
       {
       TQLabel *m_label_spreadRadius = new TQLabel (i18n("Radius:"), box);
       dvlay->addWidget( m_label_spreadRadius );
       m_spreadRadius = new KIntNumInput(10, box);
       m_spreadRadius->setRange(0, 200, 1, true );
       TQWhatsThis::add( m_spreadRadius, i18n("<p>Select here the value which represents the random "
                                             "pixel in a neighborhood of this extent.") );
       m_label_spreadRadius->setBuddy( m_spreadRadius );
       dvlay->addWidget( m_spreadRadius );
       }

    if (EffectType == 9) // Swirl
       {
       TQLabel *m_label_swirlDegrees = new TQLabel (i18n("Degrees:"), box);
       dvlay->addWidget( m_label_swirlDegrees );
       m_swirlDegrees = new KIntNumInput(45, box);
       m_swirlDegrees->setRange(0, 360, 1, true );
       TQWhatsThis::add( m_swirlDegrees, i18n("<p>Select here the value which represents the tightness of "
                                             "the swirling effect. You get a more dramatic effect as the "
                                             "degrees move from 1 to 360.") );
       m_label_swirlDegrees->setBuddy( m_swirlDegrees );
       dvlay->addWidget( m_swirlDegrees );
       }

    if (EffectType == 10) // Wave
       {
       TQLabel *m_label_waveAmplitude = new TQLabel (i18n("Amplitude:"), box);
       dvlay->addWidget( m_label_waveAmplitude );
       m_waveAmplitude = new KIntNumInput(50, box);
       m_waveAmplitude->setRange(0, 200, 1, true );
       TQWhatsThis::add( m_waveAmplitude, i18n("<p>Select here the value which represents the amplitude of "
                                              "the sine wave.") );
       m_label_waveAmplitude->setBuddy( m_waveAmplitude );
       dvlay->addWidget( m_waveAmplitude );

       TQLabel *m_label_waveLenght = new TQLabel (i18n("Length:"), box);
       dvlay->addWidget( m_label_waveLenght );
       m_waveLenght = new KIntNumInput(100, box);
       m_waveLenght->setRange(0, 200, 1, true );
       TQWhatsThis::add( m_waveLenght, i18n("<p>Select here the value which represents the wave length "
                                           "of the sine wave.") );
       m_label_waveLenght->setBuddy( m_waveLenght );
       dvlay->addWidget( m_waveLenght );
       }
}

EffectOptionsDialog::~EffectOptionsDialog()
{
}

}  // NameSpace KIPIBatchProcessImagesPlugin