1
Index: koffice-2.2.2/libs/flake/tools/KoPathSegmentChangeStrategy.cpp
2
===================================================================
3
--- koffice-2.2.2.orig/libs/flake/tools/KoPathSegmentChangeStrategy.cpp 2010-09-19 13:58:58.265669003 +0900
4
+++ koffice-2.2.2/libs/flake/tools/KoPathSegmentChangeStrategy.cpp 2010-09-19 13:59:06.705668995 +0900
7
const qreal eps = std::numeric_limits<qreal>::epsilon();
8
// force segment parameter range to avoid division by zero
9
- m_segmentParam = qBound(eps, m_segmentParam, 1.0-eps);
10
+ m_segmentParam = qBound(eps, m_segmentParam, (qreal) 1.0-eps);
12
m_path = segment.pathShape;
13
m_segment = m_path->segmentByIndex(segment.pointIndex);
14
Index: koffice-2.2.2/libs/flake/KoShape.cpp
15
===================================================================
16
--- koffice-2.2.2.orig/libs/flake/KoShape.cpp 2010-09-19 13:58:58.305669005 +0900
17
+++ koffice-2.2.2/libs/flake/KoShape.cpp 2010-09-19 13:59:06.705668995 +0900
19
void KoShape::setTransparency(qreal transparency)
22
- d->transparency = qBound<qreal>(0.0, transparency, 1.0);
23
+ d->transparency = qBound<qreal>((qreal) 0.0, transparency, (qreal) 1.0);
26
qreal KoShape::transparency(bool recursive) const
27
Index: koffice-2.2.2/karbon/plugins/filtereffects/ColorMatrixEffect.cpp
28
===================================================================
29
--- koffice-2.2.2.orig/karbon/plugins/filtereffects/ColorMatrixEffect.cpp 2010-09-19 13:58:58.335669003 +0900
30
+++ koffice-2.2.2/karbon/plugins/filtereffects/ColorMatrixEffect.cpp 2010-09-19 13:59:06.715669002 +0900
32
void ColorMatrixEffect::setSaturate(qreal value)
35
- m_value = qBound(0.0, value, 1.0);
36
+ m_value = qBound((qreal) 0.0, value, (qreal) 1.0);
43
// set pre-multiplied color values on destination image
44
- dst[row*w+col] = qRgba(static_cast<quint8>(qBound(0.0, dr * da, 255.0)),
45
- static_cast<quint8>(qBound(0.0, dg * da, 255.0)),
46
- static_cast<quint8>(qBound(0.0, db * da, 255.0)),
47
- static_cast<quint8>(qBound(0.0, da, 255.0)));
48
+ dst[row*w+col] = qRgba(static_cast<quint8>(qBound((qreal) 0.0, dr * da, (qreal) 255.0)),
49
+ static_cast<quint8>(qBound((qreal) 0.0, dg * da, (qreal) 255.0)),
50
+ static_cast<quint8>(qBound((qreal) 0.0, db * da, (qreal) 255.0)),
51
+ static_cast<quint8>(qBound((qreal) 0.0, da, (qreal) 255.0)));
55
Index: koffice-2.2.2/karbon/plugins/filtereffects/ComponentTransferEffect.cpp
56
===================================================================
57
--- koffice-2.2.2.orig/karbon/plugins/filtereffects/ComponentTransferEffect.cpp 2010-09-19 13:58:58.355668993 +0900
58
+++ koffice-2.2.2/karbon/plugins/filtereffects/ComponentTransferEffect.cpp 2010-09-19 13:59:06.725669006 +0900
62
// set pre-multiplied color values on destination image
63
- dst[pixel] = qRgba(static_cast<quint8>(qBound(0.0, dr * da, 255.0)),
64
- static_cast<quint8>(qBound(0.0, dg * da, 255.0)),
65
- static_cast<quint8>(qBound(0.0, db * da, 255.0)),
66
- static_cast<quint8>(qBound(0.0, da, 255.0)));
67
+ dst[pixel] = qRgba(static_cast<quint8>(qBound((qreal) 0.0, dr * da, (qreal) 255.0)),
68
+ static_cast<quint8>(qBound((qreal) 0.0, dg * da, (qreal) 255.0)),
69
+ static_cast<quint8>(qBound((qreal) 0.0, db * da, (qreal) 255.0)),
70
+ static_cast<quint8>(qBound((qreal) 0.0, da, (qreal) 255.0)));
74
Index: koffice-2.2.2/karbon/plugins/filtereffects/CompositeEffect.cpp
75
===================================================================
76
--- koffice-2.2.2.orig/karbon/plugins/filtereffects/CompositeEffect.cpp 2010-09-19 13:58:58.395669006 +0900
77
+++ koffice-2.2.2/karbon/plugins/filtereffects/CompositeEffect.cpp 2010-09-19 13:59:06.725669006 +0900
81
// set pre-multiplied color values on destination image
82
- d = qRgba(static_cast<quint8>(qBound(0.0, dr * da, 255.0)),
83
- static_cast<quint8>(qBound(0.0, dg * da, 255.0)),
84
- static_cast<quint8>(qBound(0.0, db * da, 255.0)),
85
- static_cast<quint8>(qBound(0.0, da, 255.0)));
86
+ d = qRgba(static_cast<quint8>(qBound((qreal) 0.0, dr * da, (qreal) 255.0)),
87
+ static_cast<quint8>(qBound((qreal) 0.0, dg * da, (qreal) 255.0)),
88
+ static_cast<quint8>(qBound((qreal) 0.0, db * da, (qreal) 255.0)),
89
+ static_cast<quint8>(qBound((qreal) 0.0, da, (qreal) 255.0)));
93
Index: koffice-2.2.2/krita/image/kis_cubic_curve.cpp
94
===================================================================
95
--- koffice-2.2.2.orig/krita/image/kis_cubic_curve.cpp 2010-09-19 13:58:58.695668996 +0900
96
+++ koffice-2.2.2/krita/image/kis_cubic_curve.cpp 2010-09-19 13:59:06.745668998 +0900
99
x = qBound(spline.begin(), x, spline.end());
100
qreal y = spline.getValue(x);
101
- return qBound(0.0, y, 1.0);
102
+ return qBound((qreal) 0.0, y, (qreal) 1.0);
105
template<typename _T_, typename _T2_>
106
Index: koffice-2.2.2/krita/plugins/paintops/dynadraw/dyna_brush.cpp
107
===================================================================
108
--- koffice-2.2.2.orig/krita/plugins/paintops/dynadraw/dyna_brush.cpp 2010-09-19 13:58:59.255668996 +0900
109
+++ koffice-2.2.2/krita/plugins/paintops/dynadraw/dyna_brush.cpp 2010-09-19 13:59:06.755668999 +0900
111
qreal screenX = m_cursorFilter.velocityX() * m_image->width();
112
qreal screenY = m_cursorFilter.velocityY() * m_image->height();
113
qreal speed = sqrt(screenX * screenX + screenY * screenY);
114
- speed = qBound(0.0, speed , m_properties->circleRadius * 2.0);
115
+ speed = qBound((qreal) 0.0, speed , m_properties->circleRadius * (qreal) 2.0);
117
drawCircle(painter, prev.x(), prev.y() , m_properties->circleRadius + speed, 2 * m_properties->circleRadius + speed);
118
//painter.paintEllipse(prevl.x(), prevl.y(), qAbs((prevl - prevr).x()), qAbs((prevl - prevr).y()) );
119
Index: koffice-2.2.2/krita/plugins/paintops/spray/spray_brush.cpp
120
===================================================================
121
--- koffice-2.2.2.orig/krita/plugins/paintops/spray/spray_brush.cpp 2010-09-19 13:59:00.515668996 +0900
122
+++ koffice-2.2.2/krita/plugins/paintops/spray/spray_brush.cpp 2010-09-19 13:59:06.765669000 +0900
124
if ( m_properties->randomRotation ){
126
if ( m_properties->gaussian ) {
127
- rotation = linearInterpolation(rotation ,M_PI * 2.0 * qBound(0.0, m_rand->nextGaussian(0.0, 0.50) , 1.0), m_properties->randomRotationWeight );
128
+ rotation = linearInterpolation(rotation ,M_PI * 2.0 * qBound((qreal) 0.0, m_rand->nextGaussian(0.0, 0.50) , (qreal) 1.0), m_properties->randomRotationWeight );
130
rotation = linearInterpolation(rotation, M_PI * 2.0 * drand48(), m_properties->randomRotationWeight );
134
// generate random length
135
if ( m_properties->gaussian ) {
136
- length = qBound(0.0, m_rand->nextGaussian(0.0, 0.50) , 1.0);
137
+ length = qBound((qreal) 0.0, m_rand->nextGaussian(0.0, 0.50) , (qreal) 1.0);
141
Index: koffice-2.2.2/krita/image/kis_base_mask_generator.cpp
142
===================================================================
143
--- koffice-2.2.2.orig/krita/image/kis_base_mask_generator.cpp 2010-09-19 13:58:58.845668993 +0900
144
+++ koffice-2.2.2/krita/image/kis_base_mask_generator.cpp 2010-09-19 13:59:06.775669001 +0900
146
#include "kis_circle_mask_generator.h"
147
#include "kis_rect_mask_generator.h"
149
-KisMaskGenerator::KisMaskGenerator(double radius, double ratio, double fh, double fv, int spikes, Type type) : d(new Private)
150
+KisMaskGenerator::KisMaskGenerator(qreal radius, qreal ratio, qreal fh, qreal fv, int spikes, Type type) : d(new Private)
152
d->m_radius = radius;
156
KisMaskGenerator* KisMaskGenerator::fromXML(const QDomElement& elt)
158
- double radius = elt.attribute("radius", "1.0").toDouble();
159
- double ratio = elt.attribute("ratio", "1.0").toDouble();
160
- double hfade = elt.attribute("hfade", "0.0").toDouble();
161
- double vfade = elt.attribute("vfade", "0.0").toDouble();
162
+ qreal radius = (qreal) elt.attribute("radius", "1.0").toDouble();
163
+ qreal ratio = (qreal) elt.attribute("ratio", "1.0").toDouble();
164
+ qreal hfade = (qreal) elt.attribute("hfade", "0.0").toDouble();
165
+ qreal vfade = (qreal) elt.attribute("vfade", "0.0").toDouble();
166
int spikes = elt.attribute("spikes", "2").toInt();
167
QString typeShape = elt.attribute("type", "circle");
173
-double KisMaskGenerator::width() const
174
+qreal KisMaskGenerator::width() const
179
-double KisMaskGenerator::height() const
180
+qreal KisMaskGenerator::height() const
182
if (d->m_spikes == 2) {
183
return d->m_radius * d->m_ratio;
184
Index: koffice-2.2.2/krita/image/kis_rect_mask_generator.h
185
===================================================================
186
--- koffice-2.2.2.orig/krita/image/kis_rect_mask_generator.h 2010-09-19 13:58:59.035669003 +0900
187
+++ koffice-2.2.2/krita/image/kis_rect_mask_generator.h 2010-09-19 13:59:06.785669002 +0900
192
- KisRectangleMaskGenerator(double radius, double ratio, double fh, double fv, int spikes);
193
+ KisRectangleMaskGenerator(qreal radius, qreal ratio, qreal fh, qreal fv, int spikes);
194
virtual ~KisRectangleMaskGenerator();
196
- virtual quint8 valueAt(double x, double y) const;
197
+ virtual quint8 valueAt(qreal x, qreal y) const;
199
virtual void toXML(QDomDocument& , QDomElement&) const;
201
Index: koffice-2.2.2/krita/image/kis_rect_mask_generator.cpp
202
===================================================================
203
--- koffice-2.2.2.orig/krita/image/kis_rect_mask_generator.cpp 2010-09-19 13:58:58.875669009 +0900
204
+++ koffice-2.2.2/krita/image/kis_rect_mask_generator.cpp 2010-09-19 13:59:06.795669005 +0900
206
#include <QDomDocument>
208
struct KisRectangleMaskGenerator::Private {
213
-KisRectangleMaskGenerator::KisRectangleMaskGenerator(double radius, double ratio, double fh, double fv, int spikes)
214
+KisRectangleMaskGenerator::KisRectangleMaskGenerator(qreal radius, qreal ratio, qreal fh, qreal fv, int spikes)
215
: KisMaskGenerator(radius, ratio, fh, fv, spikes, RECTANGLE), d(new Private)
217
if (KisMaskGenerator::d->m_fv == 0 &&
222
-quint8 KisRectangleMaskGenerator::valueAt(double x, double y) const
223
+quint8 KisRectangleMaskGenerator::valueAt(qreal x, qreal y) const
226
if (KisMaskGenerator::d->m_empty) return 255;
227
- double xr = qAbs(x /*- m_xcenter*/) / width();
228
- double yr = qAbs(y /*- m_ycenter*/) / height();
229
+ qreal xr = qAbs(x /*- m_xcenter*/) / width();
230
+ qreal yr = qAbs(y /*- m_ycenter*/) / height();
231
if (xr > KisMaskGenerator::d->m_fh || yr > KisMaskGenerator::d->m_fv) {
232
if (yr <= ((xr - KisMaskGenerator::d->m_fh) * d->m_c + KisMaskGenerator::d->m_fv)) {
233
return (uchar)(255 *(xr - 0.5 * KisMaskGenerator::d->m_fh) / (1.0 - 0.5 * KisMaskGenerator::d->m_fh));
234
Index: koffice-2.2.2/krita/image/kis_circle_mask_generator.cpp
235
===================================================================
236
--- koffice-2.2.2.orig/krita/image/kis_circle_mask_generator.cpp 2010-09-19 13:58:58.725669005 +0900
237
+++ koffice-2.2.2/krita/image/kis_circle_mask_generator.cpp 2010-09-19 13:59:06.795669005 +0900
239
#include <QDomDocument>
241
struct KisCircleMaskGenerator::Private {
242
- double xcoef, ycoef;
243
- double xfadecoef, yfadecoef;
244
- double cachedSpikesAngle;
245
+ qreal xcoef, ycoef;
246
+ qreal xfadecoef, yfadecoef;
247
+ qreal cachedSpikesAngle;
250
-KisCircleMaskGenerator::KisCircleMaskGenerator(double radius, double ratio, double fh, double fv, int spikes)
251
+KisCircleMaskGenerator::KisCircleMaskGenerator(qreal radius, qreal ratio, qreal fh, qreal fv, int spikes)
252
: KisMaskGenerator(radius, ratio, fh, fv, spikes, CIRCLE), d(new Private)
254
d->xcoef = 2.0 / width();
259
-quint8 KisCircleMaskGenerator::valueAt(double x, double y) const
260
+quint8 KisCircleMaskGenerator::valueAt(qreal x, qreal y) const
262
if (KisMaskGenerator::d->m_empty) return 255;
263
- double xr = (x /*- m_xcenter*/);
264
- double yr = fabs(y /*- m_ycenter*/);
265
+ qreal xr = (x /*- m_xcenter*/);
266
+ qreal yr = fabs(y /*- m_ycenter*/);
268
if (KisMaskGenerator::d->m_spikes > 2) {
269
- double angle = (KisFastMath::atan2(yr, xr));
270
+ qreal angle = (KisFastMath::atan2(yr, xr));
272
while (angle > d->cachedSpikesAngle ){
273
- double sx = xr, sy = yr;
274
+ qreal sx = xr, sy = yr;
276
xr = KisMaskGenerator::d->cs * sx - KisMaskGenerator::d->ss * sy;
277
yr = KisMaskGenerator::d->ss * sx + KisMaskGenerator::d->cs * sy;
282
- double n = norme(xr * d->xcoef, yr * d->ycoef);
283
+ qreal n = norme(xr * d->xcoef, yr * d->ycoef);
288
- double normeFade = norme(xr * d->xfadecoef, yr * d->yfadecoef);
289
+ qreal normeFade = norme(xr * d->xfadecoef, yr * d->yfadecoef);
293
// xle stands for x-coordinate limit exterior
294
// yle stands for y-coordinate limit exterior
295
// we are computing the coordinate on the external ellipse in order to compute
298
yle = yr > 0 ? 1 / d->ycoef : -1 / d->ycoef;
300
- double c = yr / (double)xr;
302
xle = sqrt(1 / norme(d->xcoef, c * d->ycoef));
303
xle = xr > 0 ? xle : -xle;
306
// On the internal limit of the fade area, normeFade is equal to 1
307
- double normeFadeLimitE = norme(xle * d->xfadecoef, yle * d->yfadecoef);
308
+ qreal normeFadeLimitE = norme(xle * d->xfadecoef, yle * d->yfadecoef);
309
return (uchar)(255 *(normeFade - 1) / (normeFadeLimitE - 1));
312
Index: koffice-2.2.2/krita/ui/kis_autogradient.cc
313
===================================================================
314
--- koffice-2.2.2.orig/krita/ui/kis_autogradient.cc 2010-09-19 13:59:00.685669005 +0900
315
+++ koffice-2.2.2/krita/ui/kis_autogradient.cc 2010-09-19 13:59:06.815669001 +0900
317
KoGradientSegment* segment = gradientSlider->selectedSegment();
319
KoColor c(segment->startColor().toQColor(), segment->startColor().colorSpace());
320
- c.setOpacity(value / 100.0);
321
+ c.setOpacity(value / (qreal) 100.0);
322
segment->setStartColor(c);
324
gradientSlider->repaint();
325
Index: koffice-2.2.2/krita/ui/tool/kis_tool_paint.cc
326
===================================================================
327
--- koffice-2.2.2.orig/krita/ui/tool/kis_tool_paint.cc 2010-09-19 13:59:00.715669003 +0900
328
+++ koffice-2.2.2/krita/ui/tool/kis_tool_paint.cc 2010-09-19 13:59:06.825669002 +0900
330
void KisToolPaint::setupPaintAction(KisRecordedPaintAction* action)
332
KisTool::setupPaintAction(action);
333
- action->setOpacity(m_opacity / 255.0);
334
+ action->setOpacity(m_opacity / (qreal) 255.0);
336
action->setCompositeOp(m_compositeOp->id());
338
Index: koffice-2.2.2/krita/ui/recorder/kis_recorded_paint_action_editor.cc
339
===================================================================
340
--- koffice-2.2.2.orig/krita/ui/recorder/kis_recorded_paint_action_editor.cc 2010-09-19 13:59:00.755669005 +0900
341
+++ koffice-2.2.2/krita/ui/recorder/kis_recorded_paint_action_editor.cc 2010-09-19 13:59:06.855669001 +0900
344
m_action->setPaintColor(m_paintColorPopup->currentKoColor());
345
m_action->setBackgroundColor(m_backgroundColorPopup->currentKoColor());
346
- m_action->setOpacity(m_actionEditor->opacity->value() / 100.0);
347
+ m_action->setOpacity(m_actionEditor->opacity->value() / (qreal) 100.0);
349
emit(actionEdited());
351
Index: koffice-2.2.2/krita/plugins/filters/colors/kis_color_to_alpha.cpp
352
===================================================================
353
--- koffice-2.2.2.orig/krita/plugins/filters/colors/kis_color_to_alpha.cpp 2010-09-19 13:59:00.655668996 +0900
354
+++ koffice-2.2.2/krita/plugins/filters/colors/kis_color_to_alpha.cpp 2010-09-19 13:59:06.865669002 +0900
356
if (srcIt.isSelected()) {
357
quint8 d = cs->difference(color, srcIt.oldRawData());
358
if (d >= threshold) {
359
- cs->setOpacity(dstIt.rawData(), 1.0, 1);
360
+ cs->setOpacity(dstIt.rawData(), (qreal) 1.0, 1);
362
cs->setOpacity(dstIt.rawData(), d / thresholdF, 1);
364
Index: koffice-2.2.2/krita/plugins/tools/defaulttools/kis_tool_gradient.cc
365
===================================================================
366
--- koffice-2.2.2.orig/krita/plugins/tools/defaulttools/kis_tool_gradient.cc 2010-09-19 13:58:59.075669005 +0900
367
+++ koffice-2.2.2/krita/plugins/tools/defaulttools/kis_tool_gradient.cc 2010-09-19 13:59:06.875669005 +0900
372
-void KisToolGradient::slotSetAntiAliasThreshold(double value)
373
+void KisToolGradient::slotSetAntiAliasThreshold(qreal value)
375
m_antiAliasThreshold = value;
377
Index: koffice-2.2.2/krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_time.h
378
===================================================================
379
--- koffice-2.2.2.orig/krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_time.h 2010-09-19 13:58:59.605668996 +0900
380
+++ koffice-2.2.2/krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_time.h 2010-09-19 13:59:06.885669000 +0900
383
KisDynamicSensorTime();
384
virtual ~KisDynamicSensorTime() { }
385
- virtual double parameter(const KisPaintInformation&);
386
+ virtual qreal parameter(const KisPaintInformation&);
387
virtual void reset();
388
virtual QWidget* createConfigurationWidget(QWidget* parent, KisSensorSelector*);
390
Index: koffice-2.2.2/krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_distance.h
391
===================================================================
392
--- koffice-2.2.2.orig/krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_distance.h 2010-09-19 13:58:59.635669005 +0900
393
+++ koffice-2.2.2/krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_distance.h 2010-09-19 13:59:06.885669000 +0900
396
KisDynamicSensorDistance();
397
virtual ~KisDynamicSensorDistance() { }
398
- virtual double parameter(const KisPaintInformation&);
399
+ virtual qreal parameter(const KisPaintInformation&);
400
virtual void reset();
401
virtual QWidget* createConfigurationWidget(QWidget* parent, KisSensorSelector*);
404
virtual void toXML(QDomDocument&, QDomElement&) const;
405
virtual void fromXML(const QDomElement&);
412
Index: koffice-2.2.2/krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_distance.cc
413
===================================================================
414
--- koffice-2.2.2.orig/krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_distance.cc 2010-09-19 13:58:59.545668993 +0900
415
+++ koffice-2.2.2/krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_distance.cc 2010-09-19 13:59:06.895669001 +0900
420
-double KisDynamicSensorDistance::parameter(const KisPaintInformation& pi)
421
+qreal KisDynamicSensorDistance::parameter(const KisPaintInformation& pi)
423
m_time += pi.movement().norm();
424
if (m_time > m_length) {
425
Index: koffice-2.2.2/krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_time.cc
426
===================================================================
427
--- koffice-2.2.2.orig/krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_time.cc 2010-09-19 13:58:59.565669005 +0900
428
+++ koffice-2.2.2/krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_time.cc 2010-09-19 13:59:06.895669001 +0900
433
-double KisDynamicSensorTime::parameter(const KisPaintInformation& pi)
434
+qreal KisDynamicSensorTime::parameter(const KisPaintInformation& pi)
436
m_time += pi.currentTime() - m_lastTime;
437
m_lastTime = pi.currentTime();
438
Index: koffice-2.2.2/krita/plugins/paintops/deform/deform_brush.cpp
439
===================================================================
440
--- koffice-2.2.2.orig/krita/plugins/paintops/deform/deform_brush.cpp 2010-09-19 13:58:59.445669006 +0900
441
+++ koffice-2.2.2/krita/plugins/paintops/deform/deform_brush.cpp 2010-09-19 13:59:06.895669001 +0900
443
for (int x = 0; x < dstWidth; x++){
444
maskX = x - m_centerX;
445
maskY = y - m_centerY;
446
- double rmaskX = cosa * maskX - sina * maskY;
447
- double rmaskY = sina * maskX + cosa * maskY;
448
+ qreal rmaskX = cosa * maskX - sina * maskY;
449
+ qreal rmaskY = sina * maskX + cosa * maskY;
452
distance = norme(rmaskX * m_majorAxis, rmaskY * m_minorAxis);
453
Index: koffice-2.2.2/krita/plugins/paintops/defaultpaintops/pen/kis_penop.cpp
454
===================================================================
455
--- koffice-2.2.2.orig/krita/plugins/paintops/defaultpaintops/pen/kis_penop.cpp 2010-09-19 13:59:00.055669005 +0900
456
+++ koffice-2.2.2/krita/plugins/paintops/defaultpaintops/pen/kis_penop.cpp 2010-09-19 13:59:06.905669002 +0900
461
-double KisPenOp::paintAt(const KisPaintInformation& info)
462
+qreal KisPenOp::paintAt(const KisPaintInformation& info)
464
if (!painter()->device()) return 1.0;
467
if (! brush->canPaintFor(info))
470
- double scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
471
+ qreal scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
472
if ((scale * brush->width()) <= 0.01 || (scale * brush->height()) <= 0.01) return spacing(scale);
474
KisPaintDeviceSP device = painter()->device();
475
Index: koffice-2.2.2/krita/plugins/paintops/defaultpaintops/brush/kis_brushop.cpp
476
===================================================================
477
--- koffice-2.2.2.orig/krita/plugins/paintops/defaultpaintops/brush/kis_brushop.cpp 2010-09-19 13:58:59.985669005 +0900
478
+++ koffice-2.2.2/krita/plugins/paintops/defaultpaintops/brush/kis_brushop.cpp 2010-09-19 13:59:06.905669002 +0900
480
delete m_colorSource;
483
-double KisBrushOp::paintAt(const KisPaintInformation& info)
484
+qreal KisBrushOp::paintAt(const KisPaintInformation& info)
486
if (!painter()->device()) return 1.0;
489
if (!brush->canPaintFor(info))
492
- double scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
493
+ qreal scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
494
if ((scale * brush->width()) <= 0.01 || (scale * brush->height()) <= 0.01) return spacing(scale);
496
KisPaintDeviceSP device = painter()->device();
498
- double rotation = m_rotationOption.apply(info);
499
+ qreal rotation = m_rotationOption.apply(info);
501
QPointF hotSpot = brush->hotSpot(scale, scale, rotation);
502
QPointF pt = info.pos() - hotSpot;
504
// is where the dab will be positioned and the fractional part determines
505
// the sub-pixel positioning.
513
splitCoordinate(pt.x(), &x, &xFraction);
514
splitCoordinate(pt.y(), &y, &yFraction);
515
Index: koffice-2.2.2/krita/plugins/paintops/defaultpaintops/brush/kis_brushop.h
516
===================================================================
517
--- koffice-2.2.2.orig/krita/plugins/paintops/defaultpaintops/brush/kis_brushop.h 2010-09-19 13:58:59.955668996 +0900
518
+++ koffice-2.2.2/krita/plugins/paintops/defaultpaintops/brush/kis_brushop.h 2010-09-19 13:59:06.915669005 +0900
520
KisBrushOp(const KisBrushBasedPaintOpSettings *settings, KisPainter * painter, KisImageWSP image);
521
virtual ~KisBrushOp();
523
- double paintAt(const KisPaintInformation& info);
524
+ qreal paintAt(const KisPaintInformation& info);
527
KisColorSource* m_colorSource;
528
Index: koffice-2.2.2/krita/plugins/paintops/defaultpaintops/duplicate/kis_duplicateop.cpp
529
===================================================================
530
--- koffice-2.2.2.orig/krita/plugins/paintops/defaultpaintops/duplicate/kis_duplicateop.cpp 2010-09-19 13:58:59.785669009 +0900
531
+++ koffice-2.2.2/krita/plugins/paintops/defaultpaintops/duplicate/kis_duplicateop.cpp 2010-09-19 13:59:06.915669005 +0900
536
-double KisDuplicateOp::minimizeEnergy(const double* m, double* sol, int w, int h)
537
+qreal KisDuplicateOp::minimizeEnergy(const qreal* m, qreal* sol, int w, int h)
539
int rowstride = 3 * w;
541
- memcpy(sol, m, 3* sizeof(double) * w);
543
+ memcpy(sol, m, 3* sizeof(qreal) * w);
546
for (int i = 1; i < h - 1; i++) {
547
- memcpy(sol, m, 3* sizeof(double));
548
+ memcpy(sol, m, 3* sizeof(qreal));
550
for (int j = 3; j < rowstride - 3; j++) {
553
*sol = ((*(m - 3) + *(m + 3) + *(m - rowstride) + *(m + rowstride)) + 2 * *m) / 6;
554
- double diff = *sol - tmp;
555
+ qreal diff = *sol - tmp;
559
- memcpy(sol, m, 3* sizeof(double));
560
+ memcpy(sol, m, 3* sizeof(qreal));
563
- memcpy(sol, m, 3* sizeof(double) * w);
564
+ memcpy(sol, m, 3* sizeof(qreal) * w);
568
#define CLAMP(x,l,u) ((x)<(l)?(l):((x)>(u)?(u):(x)))
571
-double KisDuplicateOp::paintAt(const KisPaintInformation& info)
572
+qreal KisDuplicateOp::paintAt(const KisPaintInformation& info)
574
if (!painter()) return 1.0;
577
if (! brush->canPaintFor(info))
580
- double scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
581
+ qreal scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
582
QPointF hotSpot = brush->hotSpot(scale, scale);
583
QPointF pt = info.pos() - hotSpot;
586
// is where the dab will be positioned and the fractional part determines
587
// the sub-pixel positioning.
595
splitCoordinate(pt.x(), &x, &xFraction);
596
splitCoordinate(pt.y(), &y, &yFraction);
597
@@ -226,19 +226,19 @@
599
quint16 dataDevice[4];
600
quint16 dataSrcDev[4];
601
- double* matrix = new double[ 3 * sw * sh ];
602
+ qreal* matrix = new qreal[ 3 * sw * sh ];
604
const KoColorSpace* deviceCs = source()->colorSpace();
605
KisHLineConstIteratorPixel deviceIt = source()->createHLineConstIterator(x, y, sw);
606
KisHLineIteratorPixel srcDevIt = m_srcdev->createHLineIterator(0, 0, sw);
607
- double* matrixIt = &matrix[0];
608
+ qreal* matrixIt = &matrix[0];
609
for (int j = 0; j < sh; j++) {
610
for (int i = 0; !srcDevIt.isDone(); i++) {
611
deviceCs->toLabA16(deviceIt.rawData(), (quint8*)dataDevice, 1);
612
deviceCs->toLabA16(srcDevIt.rawData(), (quint8*)dataSrcDev, 1);
614
for (int k = 0; k < 3; k++) {
615
- matrixIt[k] = dataDevice[k] / (double)qMax((int)dataSrcDev [k], 1);
616
+ matrixIt[k] = dataDevice[k] / (qreal)qMax((int)dataSrcDev [k], 1);
620
@@ -250,11 +250,11 @@
625
- double* solution = new double [ 3 * sw * sh ];
627
+ qreal* solution = new qreal [ 3 * sw * sh ];
629
err = minimizeEnergy(&matrix[0], &solution[0], sw, sh);
630
- memcpy(&matrix[0], &solution[0], sw * sh * 3 * sizeof(double));
631
+ memcpy(&matrix[0], &solution[0], sw * sh * 3 * sizeof(qreal));
633
} while (err < 0.00001 && iter < 100);
635
Index: koffice-2.2.2/krita/plugins/paintops/defaultpaintops/duplicate/kis_duplicateop.h
636
===================================================================
637
--- koffice-2.2.2.orig/krita/plugins/paintops/defaultpaintops/duplicate/kis_duplicateop.h 2010-09-19 13:58:59.825668993 +0900
638
+++ koffice-2.2.2/krita/plugins/paintops/defaultpaintops/duplicate/kis_duplicateop.h 2010-09-19 13:59:06.915669005 +0900
641
virtual ~KisDuplicateOp();
643
- double paintAt(const KisPaintInformation& info);
644
+ qreal paintAt(const KisPaintInformation& info);
648
- double minimizeEnergy(const double* m, double* sol, int w, int h);
649
+ qreal minimizeEnergy(const qreal* m, qreal* sol, int w, int h);
653
Index: koffice-2.2.2/krita/plugins/paintops/defaultpaintops/eraser/kis_eraseop.cpp
654
===================================================================
655
--- koffice-2.2.2.orig/krita/plugins/paintops/defaultpaintops/eraser/kis_eraseop.cpp 2010-09-19 13:58:59.725669006 +0900
656
+++ koffice-2.2.2/krita/plugins/paintops/defaultpaintops/eraser/kis_eraseop.cpp 2010-09-19 13:59:06.915669005 +0900
661
-double KisEraseOp::paintAt(const KisPaintInformation& info)
662
+qreal KisEraseOp::paintAt(const KisPaintInformation& info)
664
// Erasing is traditionally in paint applications one of two things:
665
// either it is painting in the 'background' color, or it is replacing
667
if (! brush->canPaintFor(info))
670
- double scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
671
+ qreal scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
672
if ((scale * brush->width()) <= 0.01 || (scale * brush->height()) <= 0.01) return spacing(scale);
674
KisPaintDeviceSP device = painter()->device();
676
QPointF pt = info.pos() - hotSpot;
685
splitCoordinate(pt.x(), &x, &xFraction);
686
splitCoordinate(pt.y(), &y, &yFraction);
687
Index: koffice-2.2.2/krita/plugins/paintops/defaultpaintops/eraser/kis_eraseop.h
688
===================================================================
689
--- koffice-2.2.2.orig/krita/plugins/paintops/defaultpaintops/eraser/kis_eraseop.h 2010-09-19 13:58:59.755668993 +0900
690
+++ koffice-2.2.2/krita/plugins/paintops/defaultpaintops/eraser/kis_eraseop.h 2010-09-19 13:59:06.915669005 +0900
692
KisEraseOp(const KisBrushBasedPaintOpSettings *settings, KisPainter * painter, KisImageWSP image);
693
virtual ~KisEraseOp();
695
- double paintAt(const KisPaintInformation& info);
696
+ qreal paintAt(const KisPaintInformation& info);
699
KisPressureOpacityOption m_opacityOption;
700
Index: koffice-2.2.2/krita/plugins/paintops/defaultpaintops/pen/kis_penop.h
701
===================================================================
702
--- koffice-2.2.2.orig/krita/plugins/paintops/defaultpaintops/pen/kis_penop.h 2010-09-19 13:59:00.015669003 +0900
703
+++ koffice-2.2.2/krita/plugins/paintops/defaultpaintops/pen/kis_penop.h 2010-09-19 13:59:06.915669005 +0900
705
KisPenOp(const KisBrushBasedPaintOpSettings *settings, KisPainter * painter, KisImageWSP image);
708
- double paintAt(const KisPaintInformation& info);
709
+ qreal paintAt(const KisPaintInformation& info);
712
KisPressureOpacityOption m_opacityOption;
713
Index: koffice-2.2.2/krita/image/brushengine/kis_paintop.h
714
===================================================================
715
--- koffice-2.2.2.orig/krita/image/brushengine/kis_paintop.h 2010-09-19 13:58:58.515669005 +0900
716
+++ koffice-2.2.2/krita/image/brushengine/kis_paintop.h 2010-09-19 13:59:06.935669001 +0900
718
* The distance between two calls of the paintAt is always specified by spacing;
719
* xSpacing and ySpacing is 1.0 by default, negative values causes infinite loops (it is checked by Q_ASSERT)
721
- virtual double paintAt(const KisPaintInformation& info) = 0;
722
+ virtual qreal paintAt(const KisPaintInformation& info) = 0;
725
* A painterly paintop must have a PainterlyInformation structure,
730
- static double scaleForPressure(double pressure);
731
+ static qreal scaleForPressure(qreal pressure);
733
KisFixedPaintDeviceSP cachedDab();
734
KisFixedPaintDeviceSP cachedDab(const KoColorSpace *cs);
737
* Split the coordinate into whole + fraction, where fraction is always >= 0.
739
- virtual void splitCoordinate(double coordinate, qint32 *whole, double *fraction)const ;
740
+ virtual void splitCoordinate(qreal coordinate, qint32 *whole, qreal *fraction)const ;
743
* Return the painter this paintop is owned by
744
Index: koffice-2.2.2/krita/image/kis_painter.h
745
===================================================================
746
--- koffice-2.2.2.orig/krita/image/kis_painter.h 2010-09-19 13:58:58.825669003 +0900
747
+++ koffice-2.2.2/krita/image/kis_painter.h 2010-09-19 13:59:06.935669001 +0900
748
@@ -256,10 +256,10 @@
749
* @param w the rectangle width
750
* @param h the rectangle height
752
- void paintRect(const double x,
756
+ void paintRect(const qreal x,
762
* Paint the ellipse that fills the given rectangle.
763
@@ -276,10 +276,10 @@
764
* @param w the rectangle width
765
* @param h the rectangle height
767
- void paintEllipse(const double x,
771
+ void paintEllipse(const qreal x,
777
* Paint the polygon with the points given in points. It automatically closes the polygon
779
void paintPolygon(const vQPointF& points);
781
/** Draw a spot at pos using the currently set paint op, brush and color */
782
- double paintAt(const KisPaintInformation &pos);
783
+ qreal paintAt(const KisPaintInformation &pos);
786
* Stroke the given QPainterPath.
787
Index: koffice-2.2.2/krita/image/tests/kis_paintop_test.cpp
788
===================================================================
789
--- koffice-2.2.2.orig/krita/image/tests/kis_paintop_test.cpp 2010-09-19 13:58:58.935669005 +0900
790
+++ koffice-2.2.2/krita/image/tests/kis_paintop_test.cpp 2010-09-19 13:59:06.935669001 +0900
795
- double paintAt(const KisPaintInformation&) {
796
+ qreal paintAt(const KisPaintInformation&) {
799
- double spacing(double&, double&, double, double) const {
800
+ qreal spacing(qreal&, qreal&, qreal, qreal) const {
804
Index: koffice-2.2.2/krita/image/brushengine/kis_paint_information.h
805
===================================================================
806
--- koffice-2.2.2.orig/krita/image/brushengine/kis_paint_information.h 2010-09-19 13:58:58.605669006 +0900
807
+++ koffice-2.2.2/krita/image/brushengine/kis_paint_information.h 2010-09-19 13:59:06.935669001 +0900
811
KisPaintInformation(const QPointF & pos = QPointF(),
812
- double pressure = PRESSURE_DEFAULT,
813
- double xTilt = 0.0,
814
- double yTilt = 0.0,
815
+ qreal pressure = PRESSURE_DEFAULT,
818
const KisVector2D& movement = nullKisVector2D(),
819
- double rotation = 0.0,
820
- double tangentialPressure = 0.0,
821
+ qreal rotation = 0.0,
822
+ qreal tangentialPressure = 0.0,
825
KisPaintInformation(const KisPaintInformation& rhs);
827
void setPos(const QPointF& p);
829
/// The pressure of the value (from 0.0 to 1.0)
830
- double pressure() const;
831
+ qreal pressure() const;
834
- void setPressure(double p);
835
+ void setPressure(qreal p);
837
/// The tilt of the pen on the horizontal axis (from 0.0 to 1.0)
838
- double xTilt() const;
839
+ qreal xTilt() const;
841
/// The tilt of the pen on the vertical axis (from 0.0 to 1.0)
842
- double yTilt() const;
843
+ qreal yTilt() const;
845
/// The movement of the pen is equal to current position minus the last position of the call to paintAt
846
KisVector2D movement() const;
848
/// Rotation computed from the movement
849
- double angle() const;
850
+ qreal angle() const;
852
/// rotation as given by the tablet event
853
- double rotation() const;
854
+ qreal rotation() const;
856
/// tangential pressure (i.e., rate for an airbrush device)
857
- double tangentialPressure() const;
858
+ qreal tangentialPressure() const;
860
/// Number of ms since the begining of the stroke
861
int currentTime() const;
863
static KisPaintInformation fromXML(const QDomElement&);
865
/// (1-t) * p1 + t * p2
866
- static KisPaintInformation mix(const QPointF& p, double t, const KisPaintInformation& p1, const KisPaintInformation& p2, const KisVector2D& movement);
867
+ static KisPaintInformation mix(const QPointF& p, qreal t, const KisPaintInformation& p1, const KisPaintInformation& p2, const KisVector2D& movement);
871
Index: koffice-2.2.2/krita/image/kis_convolution_kernel.h
872
===================================================================
873
--- koffice-2.2.2.orig/krita/image/kis_convolution_kernel.h 2010-09-19 13:58:58.465669006 +0900
874
+++ koffice-2.2.2/krita/image/kis_convolution_kernel.h 2010-09-19 13:59:06.935669001 +0900
876
const Matrix<qreal, Dynamic, Dynamic> * data() const;
878
static KisConvolutionKernelSP fromQImage(const QImage& image);
879
- static KisConvolutionKernelSP fromMaskGenerator(KisMaskGenerator *, double angle = 0.0);
880
+ static KisConvolutionKernelSP fromMaskGenerator(KisMaskGenerator *, qreal angle = 0.0);
881
static KisConvolutionKernelSP fromMatrix(Matrix<qreal, Dynamic, Dynamic> matrix, qreal offset, qreal factor);
884
Index: koffice-2.2.2/krita/image/kis_filter_strategy.h
885
===================================================================
886
--- koffice-2.2.2.orig/krita/image/kis_filter_strategy.h 2010-09-19 13:58:58.435668997 +0900
887
+++ koffice-2.2.2/krita/image/kis_filter_strategy.h 2010-09-19 13:59:06.935669001 +0900
892
- virtual double valueAt(double /*t*/) const {
893
+ virtual qreal valueAt(qreal /*t*/) const {
896
virtual qint32 intValueAt(qint32 t) const {
897
return qint32(255*valueAt(t / 256.0));
903
qint32 intSupport() {
910
qint32 intSupportVal;
914
virtual ~KisHermiteFilterStrategy() {}
916
virtual qint32 intValueAt(qint32 t) const;
917
- virtual double valueAt(double t) const;
918
+ virtual qreal valueAt(qreal t) const;
921
class KRITAIMAGE_EXPORT KisBicubicFilterStrategy : public KisFilterStrategy
923
virtual ~KisBoxFilterStrategy() {}
925
virtual qint32 intValueAt(qint32 t) const;
926
- virtual double valueAt(double t) const;
927
+ virtual qreal valueAt(qreal t) const;
928
virtual bool boxSpecial() {
932
virtual ~KisTriangleFilterStrategy() {}
934
virtual qint32 intValueAt(qint32 t) const;
935
- virtual double valueAt(double t) const;
936
+ virtual qreal valueAt(qreal t) const;
939
class KRITAIMAGE_EXPORT KisBellFilterStrategy : public KisFilterStrategy
942
virtual ~KisBellFilterStrategy() {}
944
- virtual double valueAt(double t) const;
945
+ virtual qreal valueAt(qreal t) const;
948
class KRITAIMAGE_EXPORT KisBSplineFilterStrategy : public KisFilterStrategy
951
virtual ~KisBSplineFilterStrategy() {}
953
- virtual double valueAt(double t) const;
954
+ virtual qreal valueAt(qreal t) const;
957
class KRITAIMAGE_EXPORT KisLanczos3FilterStrategy : public KisFilterStrategy
960
virtual ~KisLanczos3FilterStrategy() {}
962
- virtual double valueAt(double t) const;
963
+ virtual qreal valueAt(qreal t) const;
965
- double sinc(double x) const;
966
+ qreal sinc(qreal x) const;
969
class KRITAIMAGE_EXPORT KisMitchellFilterStrategy : public KisFilterStrategy
972
virtual ~KisMitchellFilterStrategy() {}
974
- virtual double valueAt(double t) const;
975
+ virtual qreal valueAt(qreal t) const;
978
class KRITAIMAGE_EXPORT KisFilterStrategyRegistry : public KoGenericRegistry<KisFilterStrategy *>
979
Index: koffice-2.2.2/krita/image/kis_painter.cc
980
===================================================================
981
--- koffice-2.2.2.orig/krita/image/kis_painter.cc 2010-09-19 13:58:58.995668997 +0900
982
+++ koffice-2.2.2/krita/image/kis_painter.cc 2010-09-19 13:59:06.945669002 +0900
983
@@ -694,10 +694,10 @@
984
paintPolygon(points);
987
-void KisPainter::paintRect(const double x,
991
+void KisPainter::paintRect(const qreal x,
996
paintRect(QRectF(x, y, w, h));
1000
// See http://www.whizkidtech.redprince.net/bezier/circle/ for explanation.
1001
// kappa = (4/3*(sqrt(2)-1))
1002
- const double kappa = 0.5522847498;
1003
- const double lx = (r.width() / 2) * kappa;
1004
- const double ly = (r.height() / 2) * kappa;
1005
+ const qreal kappa = 0.5522847498;
1006
+ const qreal lx = (r.width() / 2) * kappa;
1007
+ const qreal ly = (r.height() / 2) * kappa;
1009
QPointF center = r.center();
1011
@@ -744,15 +744,15 @@
1012
paintPolygon(points);
1015
-void KisPainter::paintEllipse(const double x,
1019
+void KisPainter::paintEllipse(const qreal x,
1024
paintEllipse(QRectF(x, y, w, h));
1027
-double KisPainter::paintAt(const KisPaintInformation& pi)
1028
+qreal KisPainter::paintAt(const KisPaintInformation& pi)
1030
if (!d->paintOp || !d->paintOp->canPaint()) return 0.0;
1031
return d->paintOp->paintAt(pi);
1032
Index: koffice-2.2.2/krita/image/kis_shear_visitor.h
1033
===================================================================
1034
--- koffice-2.2.2.orig/krita/image/kis_shear_visitor.h 2010-09-19 13:58:58.635668993 +0900
1035
+++ koffice-2.2.2/krita/image/kis_shear_visitor.h 2010-09-19 13:59:06.945669002 +0900
1038
using KisNodeVisitor::visit;
1040
- KisShearVisitor(double xshear, double yshear, KoUpdater *progress)
1041
+ KisShearVisitor(qreal xshear, qreal yshear, KoUpdater *progress)
1042
: m_xshear(xshear), m_yshear(yshear), m_progress(progress), m_strategy(0), m_undo(0) {}
1044
void setStrategy(KisFilterStrategy* strategy) {
1045
@@ -125,12 +125,12 @@
1049
- void KRITAIMAGE_EXPORT shear(KisPaintDeviceSP dev, double angleX, double angleY, KoUpdater *progress);
1050
- KisPaintDeviceSP xShear(KisPaintDeviceSP src, double shearX, KoUpdater *progress);
1051
- KisPaintDeviceSP yShear(KisPaintDeviceSP src, double shearY, KoUpdater *progress);
1052
+ void KRITAIMAGE_EXPORT shear(KisPaintDeviceSP dev, qreal angleX, qreal angleY, KoUpdater *progress);
1053
+ KisPaintDeviceSP xShear(KisPaintDeviceSP src, qreal shearX, KoUpdater *progress);
1054
+ KisPaintDeviceSP yShear(KisPaintDeviceSP src, qreal shearY, KoUpdater *progress);
1060
KoUpdater* m_progress;
1061
KisFilterStrategy* m_strategy;
1062
KisUndoAdapter* m_undo;
1063
Index: koffice-2.2.2/krita/image/kis_transform_visitor.h
1064
===================================================================
1065
--- koffice-2.2.2.orig/krita/image/kis_transform_visitor.h 2010-09-19 13:58:58.485668996 +0900
1066
+++ koffice-2.2.2/krita/image/kis_transform_visitor.h 2010-09-19 13:59:06.945669002 +0900
1069
using KisNodeVisitor::visit;
1071
- KisTransformVisitor(KisImageWSP image, double xscale, double yscale,
1072
- double /*xshear*/, double /*yshear*/, double angle,
1073
+ KisTransformVisitor(KisImageWSP image, qreal xscale, qreal yscale,
1074
+ qreal /*xshear*/, qreal /*yshear*/, qreal angle,
1075
qint32 tx, qint32 ty, KoUpdater *progress, KisFilterStrategy *filter)
1078
@@ -147,10 +147,10 @@
1082
- double m_sx, m_sy;
1085
KisFilterStrategy *m_filter;
1088
KoUpdater *m_progress;
1089
KisImageWSP m_image;
1091
Index: koffice-2.2.2/krita/image/brushengine/kis_paint_information.cc
1092
===================================================================
1093
--- koffice-2.2.2.orig/krita/image/brushengine/kis_paint_information.cc 2010-09-19 13:58:58.575668997 +0900
1094
+++ koffice-2.2.2/krita/image/brushengine/kis_paint_information.cc 2010-09-19 13:59:06.945669002 +0900
1096
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1105
KisVector2D movement;
1108
- double tangentialPressure;
1111
+ qreal tangentialPressure;
1115
-KisPaintInformation::KisPaintInformation(const QPointF & pos_, double pressure_,
1116
- double xTilt_, double yTilt_,
1117
+KisPaintInformation::KisPaintInformation(const QPointF & pos_, qreal pressure_,
1118
+ qreal xTilt_, qreal yTilt_,
1119
const KisVector2D& movement_,
1121
- double tangentialPressure_,
1123
+ qreal tangentialPressure_,
1129
KisPaintInformation KisPaintInformation::fromXML(const QDomElement& e)
1131
- double pointX = e.attribute("pointX", "0.0").toDouble();
1132
- double pointY = e.attribute("pointY", "0.0").toDouble();
1133
- double pressure = e.attribute("pressure", "0.0").toDouble();
1134
- double rotation = e.attribute("rotation", "0.0").toDouble();
1135
- double tangentialPressure = e.attribute("tangentialPressure", "0.0").toDouble();
1136
- double xTilt = e.attribute("xTilt", "0.0").toDouble();
1137
- double yTilt = e.attribute("yTilt", "0.0").toDouble();
1138
- double movementX = e.attribute("movementX", "0.0").toDouble();
1139
- double movementY = e.attribute("movementY", "0.0").toDouble();
1140
+ qreal pointX = (qreal) e.attribute("pointX", "0.0").toDouble();
1141
+ qreal pointY = (qreal) e.attribute("pointY", "0.0").toDouble();
1142
+ qreal pressure = (qreal) e.attribute("pressure", "0.0").toDouble();
1143
+ qreal rotation = (qreal) e.attribute("rotation", "0.0").toDouble();
1144
+ qreal tangentialPressure = (qreal) e.attribute("tangentialPressure", "0.0").toDouble();
1145
+ qreal xTilt = (qreal) e.attribute("xTilt", "0.0").toDouble();
1146
+ qreal yTilt = (qreal) e.attribute("yTilt", "0.0").toDouble();
1147
+ qreal movementX = (qreal) e.attribute("movementX", "0.0").toDouble();
1148
+ qreal movementY = (qreal) e.attribute("movementY", "0.0").toDouble();
1149
int time = e.attribute("time", "0").toInt();
1151
return KisPaintInformation(QPointF(pointX, pointY), pressure, xTilt, yTilt, KisVector2D(movementX, movementY),
1152
@@ -108,22 +108,22 @@
1156
-double KisPaintInformation::pressure() const
1157
+qreal KisPaintInformation::pressure() const
1162
-void KisPaintInformation::setPressure(double p)
1163
+void KisPaintInformation::setPressure(qreal p)
1168
-double KisPaintInformation::xTilt() const
1169
+qreal KisPaintInformation::xTilt() const
1174
-double KisPaintInformation::yTilt() const
1175
+qreal KisPaintInformation::yTilt() const
1179
@@ -133,17 +133,17 @@
1183
-double KisPaintInformation::angle() const
1184
+qreal KisPaintInformation::angle() const
1189
-double KisPaintInformation::rotation() const
1190
+qreal KisPaintInformation::rotation() const
1195
-double KisPaintInformation::tangentialPressure() const
1196
+qreal KisPaintInformation::tangentialPressure() const
1198
return d->tangentialPressure;
1200
@@ -171,13 +171,13 @@
1204
-KisPaintInformation KisPaintInformation::mix(const QPointF& p, double t, const KisPaintInformation& pi1, const KisPaintInformation& pi2, const KisVector2D& movement)
1205
+KisPaintInformation KisPaintInformation::mix(const QPointF& p, qreal t, const KisPaintInformation& pi1, const KisPaintInformation& pi2, const KisVector2D& movement)
1207
- double pressure = (1 - t) * pi1.pressure() + t * pi2.pressure();
1208
- double xTilt = (1 - t) * pi1.xTilt() + t * pi2.xTilt();
1209
- double yTilt = (1 - t) * pi1.yTilt() + t * pi2.yTilt();
1210
- double rotation = (1 - t) * pi1.rotation() + t * pi2.rotation();
1211
- double tangentialPressure = (1 - t) * pi1.tangentialPressure() + t * pi2.tangentialPressure();
1212
+ qreal pressure = (1 - t) * pi1.pressure() + t * pi2.pressure();
1213
+ qreal xTilt = (1 - t) * pi1.xTilt() + t * pi2.xTilt();
1214
+ qreal yTilt = (1 - t) * pi1.yTilt() + t * pi2.yTilt();
1215
+ qreal rotation = (1 - t) * pi1.rotation() + t * pi2.rotation();
1216
+ qreal tangentialPressure = (1 - t) * pi1.tangentialPressure() + t * pi2.tangentialPressure();
1217
int time = (1 - t) * pi1.currentTime() + t * pi2.currentTime();
1218
return KisPaintInformation(p, pressure, xTilt, yTilt, movement, rotation, tangentialPressure, time);
1220
Index: koffice-2.2.2/krita/image/brushengine/kis_paintop.cc
1221
===================================================================
1222
--- koffice-2.2.2.orig/krita/image/brushengine/kis_paintop.cc 2010-09-19 13:58:58.545669003 +0900
1223
+++ koffice-2.2.2/krita/image/brushengine/kis_paintop.cc 2010-09-19 13:59:06.945669002 +0900
1228
-void KisPaintOp::splitCoordinate(double coordinate, qint32 *whole, double *fraction) const
1229
+void KisPaintOp::splitCoordinate(qreal coordinate, qint32 *whole, qreal *fraction) const
1231
qint32 i = static_cast<qint32>(coordinate);
1237
- double f = coordinate - i;
1238
+ qreal f = coordinate - i;
1242
@@ -160,18 +160,18 @@
1244
Q_ASSERT(savedDist.distance >= 0);
1246
- double endDist = dragVec.norm();
1247
- double currentDist = savedDist.distance;
1248
+ qreal endDist = dragVec.norm();
1249
+ qreal currentDist = savedDist.distance;
1251
dragVec.normalize();
1252
KisVector2D step(0, 0);
1254
- double sp = savedDist.spacing;
1255
+ qreal sp = savedDist.spacing;
1256
while (currentDist < endDist) {
1258
QPointF p = toQPointF(start + currentDist * dragVec);
1260
- double t = currentDist / endDist;
1261
+ qreal t = currentDist / endDist;
1263
KisVector2D movement;
1266
return d->painter->device();
1269
-double KisPaintOp::scaleForPressure(double pressure)
1270
+qreal KisPaintOp::scaleForPressure(qreal pressure)
1272
- double scale = pressure / PRESSURE_DEFAULT;
1273
+ qreal scale = pressure / PRESSURE_DEFAULT;
1277
Index: koffice-2.2.2/krita/image/kis_convolution_kernel.cc
1278
===================================================================
1279
--- koffice-2.2.2.orig/krita/image/kis_convolution_kernel.cc 2010-09-19 13:58:58.905668996 +0900
1280
+++ koffice-2.2.2/krita/image/kis_convolution_kernel.cc 2010-09-19 13:59:06.955669005 +0900
1285
-KisConvolutionKernelSP KisConvolutionKernel::fromMaskGenerator(KisMaskGenerator* kmg, double angle)
1286
+KisConvolutionKernelSP KisConvolutionKernel::fromMaskGenerator(KisMaskGenerator* kmg, qreal angle)
1290
@@ -113,10 +113,10 @@
1292
KisConvolutionKernelSP kernel = new KisConvolutionKernel(width, height, 0, 0);
1294
- double cosa = cos(angle);
1295
- double sina = sin(angle);
1296
- double xc = 0.5 * width - 0.5;
1297
- double yc = 0.5 * height - 0.5;
1298
+ qreal cosa = cos(angle);
1299
+ qreal sina = sin(angle);
1300
+ qreal xc = 0.5 * width - 0.5;
1301
+ qreal yc = 0.5 * height - 0.5;
1303
Matrix<qreal, Dynamic, Dynamic>& data = kernel->data();
1305
@@ -124,10 +124,10 @@
1306
// dbgImage << ppVar(xc) << ppVar(yc);
1307
for (int r = 0; r < height; ++r) {
1308
for (int c = 0; c < width; ++c) {
1309
- double x_ = (c - xc);
1310
- double y_ = (r - yc);
1311
- double x = cosa * x_ - sina * y_;
1312
- double y = sina * x_ + cosa * y_;
1313
+ qreal x_ = (c - xc);
1314
+ qreal y_ = (r - yc);
1315
+ qreal x = cosa * x_ - sina * y_;
1316
+ qreal y = sina * x_ + cosa * y_;
1317
// dbgImage << ppVar(x) << ppVar(y) << ppVar(x_) << ppVar(y_) << ppVar( kmg->interpolatedValueAt( x,y) );
1318
uint value = 255 - kmg->valueAt(x, y);
1320
Index: koffice-2.2.2/krita/image/kis_filter_strategy.cc
1321
===================================================================
1322
--- koffice-2.2.2.orig/krita/image/kis_filter_strategy.cc 2010-09-19 13:58:58.965669003 +0900
1323
+++ koffice-2.2.2/krita/image/kis_filter_strategy.cc 2010-09-19 13:59:06.955669005 +0900
1326
#include "kis_debug.h"
1328
-double KisHermiteFilterStrategy::valueAt(double t) const
1329
+qreal KisHermiteFilterStrategy::valueAt(qreal t) const
1331
/* f(t) = 2|t|^3 - 3|t|^2 + 1, -1 <= t <= 1 */
1332
if (t < 0.0) t = -t;
1337
-double KisBoxFilterStrategy::valueAt(double t) const
1338
+qreal KisBoxFilterStrategy::valueAt(qreal t) const
1340
if ((t > -0.5) && (t <= 0.5)) return(1.0);
1346
-double KisTriangleFilterStrategy::valueAt(double t) const
1347
+qreal KisTriangleFilterStrategy::valueAt(qreal t) const
1349
if (t < 0.0) t = -t;
1350
if (t < 1.0) return(1.0 - t);
1355
-double KisBellFilterStrategy::valueAt(double t) const
1356
+qreal KisBellFilterStrategy::valueAt(qreal t) const
1359
if (t < .5) return(.75 - (t * t));
1364
-double KisBSplineFilterStrategy::valueAt(double t) const
1365
+qreal KisBSplineFilterStrategy::valueAt(qreal t) const
1372
@@ -142,26 +142,26 @@
1376
-double KisLanczos3FilterStrategy::valueAt(double t) const
1377
+qreal KisLanczos3FilterStrategy::valueAt(qreal t) const
1380
if (t < 3.0) return(sinc(t) * sinc(t / 3.0));
1384
-double KisLanczos3FilterStrategy::sinc(double x) const
1385
+qreal KisLanczos3FilterStrategy::sinc(qreal x) const
1387
- const double pi = 3.1415926535897932385;
1388
+ const qreal pi = 3.1415926535897932385;
1390
if (x != 0) return(sin(x) / x);
1394
-double KisMitchellFilterStrategy::valueAt(double t) const
1395
+qreal KisMitchellFilterStrategy::valueAt(qreal t) const
1397
- const double B = 1.0 / 3.0;
1398
- const double C = 1.0 / 3.0;
1400
+ const qreal B = 1.0 / 3.0;
1401
+ const qreal C = 1.0 / 3.0;
1406
Index: koffice-2.2.2/krita/image/kis_shear_visitor.cpp
1407
===================================================================
1408
--- koffice-2.2.2.orig/krita/image/kis_shear_visitor.cpp 2010-09-19 13:58:58.765668996 +0900
1409
+++ koffice-2.2.2/krita/image/kis_shear_visitor.cpp 2010-09-19 13:59:06.955669005 +0900
1411
#include "kis_image.h"
1412
#include "krita_export.h"
1414
-void KisShearVisitor::shear(KisPaintDeviceSP dev, double angleX, double angleY, KoUpdater *progress)
1415
+void KisShearVisitor::shear(KisPaintDeviceSP dev, qreal angleX, qreal angleY, KoUpdater *progress)
1417
- const double pi = 3.1415926535897932385;
1418
- double thetaX = angleX * pi / 180;
1419
- double shearX = tan(thetaX);
1420
- double thetaY = angleY * pi / 180;
1421
- double shearY = tan(thetaY);
1422
+ const qreal pi = 3.1415926535897932385;
1423
+ qreal thetaX = angleX * pi / 180;
1424
+ qreal shearX = tan(thetaX);
1425
+ qreal thetaY = angleY * pi / 180;
1426
+ qreal shearY = tan(thetaY);
1428
QRect r = dev->exactBounds();
1429
progress->setRange(0, r.height() + r.width());
1434
-KisPaintDeviceSP KisShearVisitor::xShear(KisPaintDeviceSP src, double shearX, KoUpdater *progress)
1435
+KisPaintDeviceSP KisShearVisitor::xShear(KisPaintDeviceSP src, qreal shearX, KoUpdater *progress)
1437
KisPaintDeviceSP dst = KisPaintDeviceSP(new KisPaintDevice(src->colorSpace()));
1438
dst->setX(src->x());
1441
QRect r = src->exactBounds();
1443
- double displacement;
1444
+ qreal displacement;
1445
qint32 displacementInt;
1449
KoMixColorsOp * mixOp = src->colorSpace()->mixColorsOp();
1455
-KisPaintDeviceSP KisShearVisitor::yShear(KisPaintDeviceSP src, double shearY, KoUpdater *progress)
1456
+KisPaintDeviceSP KisShearVisitor::yShear(KisPaintDeviceSP src, qreal shearY, KoUpdater *progress)
1458
int start = progress->progress();
1462
QRect r = src->exactBounds();
1464
- double displacement;
1465
+ qreal displacement;
1466
qint32 displacementInt;
1470
for (qint32 x = r.left(); x <= r.right(); x++) {
1472
Index: koffice-2.2.2/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.h
1473
===================================================================
1474
--- koffice-2.2.2.orig/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.h 2010-09-19 13:58:59.895668993 +0900
1475
+++ koffice-2.2.2/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.h 2010-09-19 13:59:06.955669005 +0900
1477
KisSmudgeOp(const KisBrushBasedPaintOpSettings *settings, KisPainter * painter, KisImageWSP image);
1478
virtual ~KisSmudgeOp();
1480
- double paintAt(const KisPaintInformation& info);
1481
+ qreal paintAt(const KisPaintInformation& info);
1485
Index: koffice-2.2.2/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.cpp
1486
===================================================================
1487
--- koffice-2.2.2.orig/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.cpp 2010-09-19 13:58:59.855669009 +0900
1488
+++ koffice-2.2.2/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.cpp 2010-09-19 13:59:06.955669005 +0900
1493
-double KisSmudgeOp::paintAt(const KisPaintInformation& info)
1494
+qreal KisSmudgeOp::paintAt(const KisPaintInformation& info)
1496
if (!painter()->device()) return 1.0;
1499
if (! brush->canPaintFor(info))
1502
- double scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
1503
+ qreal scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
1504
if ((scale * brush->width()) <= 0.01 || (scale * brush->height()) <= 0.01) return 1.0;
1506
KisPaintDeviceSP device = painter()->device();
1508
// is where the dab will be positioned and the fractional part determines
1509
// the sub-pixel positioning.
1517
splitCoordinate(pt.x(), &x, &xFraction);
1518
splitCoordinate(pt.y(), &y, &yFraction);
1519
Index: koffice-2.2.2/krita/plugins/paintops/hairy/kis_hairy_paintop.h
1520
===================================================================
1521
--- koffice-2.2.2.orig/krita/plugins/paintops/hairy/kis_hairy_paintop.h 2010-09-19 13:58:59.165669006 +0900
1522
+++ koffice-2.2.2/krita/plugins/paintops/hairy/kis_hairy_paintop.h 2010-09-19 13:59:06.955669005 +0900
1525
KisHairyPaintOp(const KisBrushBasedPaintOpSettings *settings, KisPainter * painter, KisImageWSP image);
1527
- double paintAt(const KisPaintInformation& info);
1528
+ qreal paintAt(const KisPaintInformation& info);
1529
KisDistanceInformation paintLine(const KisPaintInformation &pi1, const KisPaintInformation &pi2, const KisDistanceInformation& savedDist);
1532
Index: koffice-2.2.2/krita/plugins/paintops/hairy/kis_hairy_paintop.cpp
1533
===================================================================
1534
--- koffice-2.2.2.orig/krita/plugins/paintops/hairy/kis_hairy_paintop.cpp 2010-09-19 13:58:59.135668997 +0900
1535
+++ koffice-2.2.2/krita/plugins/paintops/hairy/kis_hairy_paintop.cpp 2010-09-19 13:59:06.955669005 +0900
1540
-double KisHairyPaintOp::paintAt(const KisPaintInformation& info)
1541
+qreal KisHairyPaintOp::paintAt(const KisPaintInformation& info)
1545
Index: koffice-2.2.2/krita/plugins/paintops/chalk/kis_chalk_paintop.h
1546
===================================================================
1547
--- koffice-2.2.2.orig/krita/plugins/paintops/chalk/kis_chalk_paintop.h 2010-09-19 13:59:00.295669003 +0900
1548
+++ koffice-2.2.2/krita/plugins/paintops/chalk/kis_chalk_paintop.h 2010-09-19 13:59:06.965669000 +0900
1550
KisChalkPaintOp(const KisChalkPaintOpSettings *settings, KisPainter * painter, KisImageWSP image);
1551
virtual ~KisChalkPaintOp();
1553
- double paintAt(const KisPaintInformation& info);
1554
+ qreal paintAt(const KisPaintInformation& info);
1556
virtual bool incremental() const {
1558
Index: koffice-2.2.2/krita/plugins/paintops/chalk/kis_chalk_paintop.cpp
1559
===================================================================
1560
--- koffice-2.2.2.orig/krita/plugins/paintops/chalk/kis_chalk_paintop.cpp 2010-09-19 13:59:00.325668997 +0900
1561
+++ koffice-2.2.2/krita/plugins/paintops/chalk/kis_chalk_paintop.cpp 2010-09-19 13:59:06.965669000 +0900
1563
delete m_chalkBrush;
1566
-double KisChalkPaintOp::paintAt(const KisPaintInformation& info)
1567
+qreal KisChalkPaintOp::paintAt(const KisPaintInformation& info)
1569
if (!painter()) return 1;
1571
Index: koffice-2.2.2/krita/plugins/paintops/complexop/kis_complexop.h
1572
===================================================================
1573
--- koffice-2.2.2.orig/krita/plugins/paintops/complexop/kis_complexop.h 2010-09-19 13:59:00.155669003 +0900
1574
+++ koffice-2.2.2/krita/plugins/paintops/complexop/kis_complexop.h 2010-09-19 13:59:06.965669000 +0900
1576
KisComplexOp(const KisComplexOpSettings *settings, KisPainter * painter, KisImageWSP image);
1577
virtual ~KisComplexOp();
1579
- double paintAt(const KisPaintInformation& info);
1580
+ qreal paintAt(const KisPaintInformation& info);
1584
Index: koffice-2.2.2/krita/plugins/paintops/curvebrush/kis_curve_paintop.h
1585
===================================================================
1586
--- koffice-2.2.2.orig/krita/plugins/paintops/curvebrush/kis_curve_paintop.h 2010-09-19 13:58:59.385669003 +0900
1587
+++ koffice-2.2.2/krita/plugins/paintops/curvebrush/kis_curve_paintop.h 2010-09-19 13:59:06.965669000 +0900
1592
- double paintAt(const KisPaintInformation& info);
1593
+ qreal paintAt(const KisPaintInformation& info);
1594
KisDistanceInformation paintLine(const KisPaintInformation &pi1, const KisPaintInformation &pi2, const KisDistanceInformation& savedDist);
1597
Index: koffice-2.2.2/krita/plugins/paintops/deform/kis_deform_paintop.h
1598
===================================================================
1599
--- koffice-2.2.2.orig/krita/plugins/paintops/deform/kis_deform_paintop.h 2010-09-19 13:58:59.475668993 +0900
1600
+++ koffice-2.2.2/krita/plugins/paintops/deform/kis_deform_paintop.h 2010-09-19 13:59:06.975669001 +0900
1602
return m_useMovementPaint;
1605
- double paintAt(const KisPaintInformation& info);
1606
- double spacing(double pressure) const;
1607
+ qreal paintAt(const KisPaintInformation& info);
1608
+ qreal spacing(qreal pressure) const;
1612
Index: koffice-2.2.2/krita/plugins/paintops/dynadraw/kis_dyna_paintop.h
1613
===================================================================
1614
--- koffice-2.2.2.orig/krita/plugins/paintops/dynadraw/kis_dyna_paintop.h 2010-09-19 13:58:59.205668997 +0900
1615
+++ koffice-2.2.2/krita/plugins/paintops/dynadraw/kis_dyna_paintop.h 2010-09-19 13:59:06.975669001 +0900
1617
KisDynaPaintOp(const KisDynaPaintOpSettings *settings, KisPainter * painter, KisImageWSP image);
1618
virtual ~KisDynaPaintOp();
1620
- double paintAt(const KisPaintInformation& info);
1621
+ qreal paintAt(const KisPaintInformation& info);
1622
KisDistanceInformation paintLine(const KisPaintInformation &pi1, const KisPaintInformation &pi2, const KisDistanceInformation& savedDist);
1624
virtual bool incremental() const {
1625
Index: koffice-2.2.2/krita/plugins/paintops/experiment/kis_experiment_paintop.h
1626
===================================================================
1627
--- koffice-2.2.2.orig/krita/plugins/paintops/experiment/kis_experiment_paintop.h 2010-09-19 13:59:00.425669006 +0900
1628
+++ koffice-2.2.2/krita/plugins/paintops/experiment/kis_experiment_paintop.h 2010-09-19 13:59:06.975669001 +0900
1630
KisExperimentPaintOp(const KisExperimentPaintOpSettings *settings, KisPainter * painter, KisImageSP image);
1631
virtual ~KisExperimentPaintOp();
1633
- double spacing(double & xSpacing, double & ySpacing, double pressure1, double pressure2) const;
1634
- double paintAt(const KisPaintInformation& info);
1635
+ qreal spacing(qreal & xSpacing, qreal & ySpacing, qreal pressure1, qreal pressure2) const;
1636
+ qreal paintAt(const KisPaintInformation& info);
1638
virtual bool incremental() const {
1644
- double m_xSpacing, m_ySpacing, m_spacing;
1645
+ qreal m_xSpacing, m_ySpacing, m_spacing;
1646
QRect m_previousDab;
1649
Index: koffice-2.2.2/krita/plugins/paintops/filterop/kis_filterop.h
1650
===================================================================
1651
--- koffice-2.2.2.orig/krita/plugins/paintops/filterop/kis_filterop.h 2010-09-19 13:58:59.695668997 +0900
1652
+++ koffice-2.2.2/krita/plugins/paintops/filterop/kis_filterop.h 2010-09-19 13:59:06.975669001 +0900
1654
KisFilterOp(const KisFilterOpSettings *settings, KisPainter * painter, KisImageWSP image);
1655
virtual ~KisFilterOp();
1657
- double paintAt(const KisPaintInformation& info);
1658
+ qreal paintAt(const KisPaintInformation& info);
1662
Index: koffice-2.2.2/krita/plugins/paintops/gridbrush/kis_grid_paintop.h
1663
===================================================================
1664
--- koffice-2.2.2.orig/krita/plugins/paintops/gridbrush/kis_grid_paintop.h 2010-09-19 13:59:00.225669003 +0900
1665
+++ koffice-2.2.2/krita/plugins/paintops/gridbrush/kis_grid_paintop.h 2010-09-19 13:59:06.975669001 +0900
1667
KisGridPaintOp(const KisGridPaintOpSettings *settings, KisPainter * painter, KisImageWSP image);
1668
virtual ~KisGridPaintOp();
1670
- double paintAt(const KisPaintInformation& info);
1671
+ qreal paintAt(const KisPaintInformation& info);
1673
virtual bool incremental() const {
1676
KisImageWSP m_image;
1677
KisPaintDeviceSP m_dab;
1678
KisPainter* m_painter;
1679
- double m_xSpacing;
1680
- double m_ySpacing;
1686
KisGridProperties m_properties;
1687
KisColorProperties m_colorProperties;
1688
Index: koffice-2.2.2/krita/plugins/paintops/mypaint/mypaint_paintop.h
1689
===================================================================
1690
--- koffice-2.2.2.orig/krita/plugins/paintops/mypaint/mypaint_paintop.h 2010-09-19 13:59:00.125669005 +0900
1691
+++ koffice-2.2.2/krita/plugins/paintops/mypaint/mypaint_paintop.h 2010-09-19 13:59:06.975669001 +0900
1694
virtual bool incremental() const { return true; }
1696
- double paintAt(const KisPaintInformation& info);
1697
- double spacing(double & xSpacing, double & ySpacing, double pressure1, double pressure2) const;
1698
+ qreal paintAt(const KisPaintInformation& info);
1699
+ qreal spacing(qreal & xSpacing, qreal & ySpacing, qreal pressure1, qreal pressure2) const;
1700
KisDistanceInformation paintLine(const KisPaintInformation &pi1, const KisPaintInformation &pi2, const KisDistanceInformation& savedDist);
1703
Index: koffice-2.2.2/krita/plugins/paintops/particle/kis_particle_paintop.h
1704
===================================================================
1705
--- koffice-2.2.2.orig/krita/plugins/paintops/particle/kis_particle_paintop.h 2010-09-19 13:58:59.325668996 +0900
1706
+++ koffice-2.2.2/krita/plugins/paintops/particle/kis_particle_paintop.h 2010-09-19 13:59:06.975669001 +0900
1708
KisParticlePaintOp(const KisParticlePaintOpSettings *settings, KisPainter * painter, KisImageWSP image);
1709
virtual ~KisParticlePaintOp();
1711
- virtual double paintAt(const KisPaintInformation& info);
1712
+ virtual qreal paintAt(const KisPaintInformation& info);
1713
virtual KisDistanceInformation paintLine(const KisPaintInformation& pi1, const KisPaintInformation& pi2, const KisDistanceInformation& savedDist = KisDistanceInformation());
1715
virtual bool incremental() const {
1716
Index: koffice-2.2.2/krita/plugins/paintops/softbrush/kis_soft_paintop.h
1717
===================================================================
1718
--- koffice-2.2.2.orig/krita/plugins/paintops/softbrush/kis_soft_paintop.h 2010-09-19 13:59:00.395668997 +0900
1719
+++ koffice-2.2.2/krita/plugins/paintops/softbrush/kis_soft_paintop.h 2010-09-19 13:59:06.975669001 +0900
1721
KisSoftPaintOp(const KisSoftPaintOpSettings *settings, KisPainter * painter, KisImageWSP image);
1722
virtual ~KisSoftPaintOp();
1724
- double paintAt(const KisPaintInformation& info);
1725
+ qreal paintAt(const KisPaintInformation& info);
1727
virtual bool incremental() const {
1730
- double spacing(double & xSpacing, double & ySpacing, double pressure1, double pressure2) const;
1731
+ qreal spacing(qreal & xSpacing, qreal & ySpacing, qreal pressure1, qreal pressure2) const;
1734
const KisSoftPaintOpSettings* m_settings;
1735
Index: koffice-2.2.2/krita/plugins/paintops/spray/kis_spray_paintop.h
1736
===================================================================
1737
--- koffice-2.2.2.orig/krita/plugins/paintops/spray/kis_spray_paintop.h 2010-09-19 13:59:00.485669009 +0900
1738
+++ koffice-2.2.2/krita/plugins/paintops/spray/kis_spray_paintop.h 2010-09-19 13:59:06.975669001 +0900
1740
KisSprayPaintOp(const KisSprayPaintOpSettings *settings, KisPainter * painter, KisImageWSP image);
1741
virtual ~KisSprayPaintOp();
1743
- double paintAt(const KisPaintInformation& info);
1744
+ qreal paintAt(const KisPaintInformation& info);
1746
virtual bool incremental() const {
1749
KisImageWSP m_image;
1750
KisPaintDeviceSP m_dab;
1751
SprayBrush m_sprayBrush;
1752
- double m_xSpacing, m_ySpacing, m_spacing;
1753
+ qreal m_xSpacing, m_ySpacing, m_spacing;
1754
KisPressureRotationOption m_rotationOption;
1755
KisPressureSizeOption m_sizeOption;
1756
KisPressureOpacityOption m_opacityOption;
1757
Index: koffice-2.2.2/krita/plugins/paintops/dynadraw/kis_dyna_paintop.cpp
1758
===================================================================
1759
--- koffice-2.2.2.orig/krita/plugins/paintops/dynadraw/kis_dyna_paintop.cpp 2010-09-19 13:58:59.235669006 +0900
1760
+++ koffice-2.2.2/krita/plugins/paintops/dynadraw/kis_dyna_paintop.cpp 2010-09-19 13:59:06.985669002 +0900
1762
return KisDistanceInformation(0, dragVec.norm());
1765
-double KisDynaPaintOp::paintAt(const KisPaintInformation& info)
1766
+qreal KisDynaPaintOp::paintAt(const KisPaintInformation& info)
1770
Index: koffice-2.2.2/krita/plugins/paintops/complexop/kis_complexop.cpp
1771
===================================================================
1772
--- koffice-2.2.2.orig/krita/plugins/paintops/complexop/kis_complexop.cpp 2010-09-19 13:59:00.195669005 +0900
1773
+++ koffice-2.2.2/krita/plugins/paintops/complexop/kis_complexop.cpp 2010-09-19 13:59:06.985669002 +0900
1778
-double KisComplexOp::paintAt(const KisPaintInformation& info)
1779
+qreal KisComplexOp::paintAt(const KisPaintInformation& info)
1781
dbgPlugins << "KisComplexOp::paintAt" << 1;
1782
if (!painter()->device()) return 1.0;
1787
- double scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
1788
+ qreal scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
1790
KisPaintDeviceSP device = painter()->device();
1793
// is where the dab will be positioned and the fractional part determines
1794
// the sub-pixel positioning.
1802
splitCoordinate(pt.x(), &x, &xFraction);
1803
splitCoordinate(pt.y(), &y, &yFraction);
1804
Index: koffice-2.2.2/krita/plugins/paintops/curvebrush/kis_curve_paintop.cpp
1805
===================================================================
1806
--- koffice-2.2.2.orig/krita/plugins/paintops/curvebrush/kis_curve_paintop.cpp 2010-09-19 13:58:59.415668997 +0900
1807
+++ koffice-2.2.2/krita/plugins/paintops/curvebrush/kis_curve_paintop.cpp 2010-09-19 13:59:06.985669002 +0900
1812
-double KisCurvePaintOp::paintAt(const KisPaintInformation& info)
1813
+qreal KisCurvePaintOp::paintAt(const KisPaintInformation& info)
1817
Index: koffice-2.2.2/krita/plugins/paintops/deform/kis_deform_paintop.cpp
1818
===================================================================
1819
--- koffice-2.2.2.orig/krita/plugins/paintops/deform/kis_deform_paintop.cpp 2010-09-19 13:58:59.515669006 +0900
1820
+++ koffice-2.2.2/krita/plugins/paintops/deform/kis_deform_paintop.cpp 2010-09-19 13:59:06.985669002 +0900
1825
-double KisDeformPaintOp::paintAt(const KisPaintInformation& info)
1826
+qreal KisDeformPaintOp::paintAt(const KisPaintInformation& info)
1828
if (!painter()) return m_spacing;
1829
if (!m_dev) return m_spacing;
1831
KisFixedPaintDeviceSP dab = cachedDab(painter()->device()->colorSpace());
1840
QPointF pt = info.pos();
1841
if (m_sizeProperties.jitterEnabled){
1846
-double KisDeformPaintOp::spacing(double pressure) const
1847
+qreal KisDeformPaintOp::spacing(qreal pressure) const
1851
Index: koffice-2.2.2/krita/plugins/paintops/experiment/kis_experiment_paintop.cpp
1852
===================================================================
1853
--- koffice-2.2.2.orig/krita/plugins/paintops/experiment/kis_experiment_paintop.cpp 2010-09-19 13:59:00.455668993 +0900
1854
+++ koffice-2.2.2/krita/plugins/paintops/experiment/kis_experiment_paintop.cpp 2010-09-19 13:59:06.985669002 +0900
1859
-double KisExperimentPaintOp::paintAt(const KisPaintInformation& info)
1860
+qreal KisExperimentPaintOp::paintAt(const KisPaintInformation& info)
1862
if (!painter()) return m_spacing;
1864
Index: koffice-2.2.2/krita/plugins/paintops/filterop/kis_filterop.cpp
1865
===================================================================
1866
--- koffice-2.2.2.orig/krita/plugins/paintops/filterop/kis_filterop.cpp 2010-09-19 13:58:59.665669003 +0900
1867
+++ koffice-2.2.2/krita/plugins/paintops/filterop/kis_filterop.cpp 2010-09-19 13:59:06.985669002 +0900
1872
-double KisFilterOp::paintAt(const KisPaintInformation& info)
1873
+qreal KisFilterOp::paintAt(const KisPaintInformation& info)
1878
if (! brush->canPaintFor(info))
1881
- double scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
1882
+ qreal scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
1883
if ((scale * brush->width()) <= 0.01 || (scale * brush->height()) <= 0.01) return spacing(scale);
1885
QPointF hotSpot = brush->hotSpot(scale, scale);
1887
// is where the dab will be positioned and the fractional part determines
1888
// the sub-pixel positioning.
1896
splitCoordinate(pt.x(), &x, &xFraction);
1897
splitCoordinate(pt.y(), &y, &yFraction);
1898
Index: koffice-2.2.2/krita/plugins/paintops/gridbrush/kis_grid_paintop.cpp
1899
===================================================================
1900
--- koffice-2.2.2.orig/krita/plugins/paintops/gridbrush/kis_grid_paintop.cpp 2010-09-19 13:59:00.255668997 +0900
1901
+++ koffice-2.2.2/krita/plugins/paintops/gridbrush/kis_grid_paintop.cpp 2010-09-19 13:59:06.985669002 +0900
1906
-double KisGridPaintOp::paintAt(const KisPaintInformation& info)
1907
+qreal KisGridPaintOp::paintAt(const KisPaintInformation& info)
1911
Index: koffice-2.2.2/krita/plugins/paintops/mypaint/mypaint_paintop.cpp
1912
===================================================================
1913
--- koffice-2.2.2.orig/krita/plugins/paintops/mypaint/mypaint_paintop.cpp 2010-09-19 13:59:00.085669003 +0900
1914
+++ koffice-2.2.2/krita/plugins/paintops/mypaint/mypaint_paintop.cpp 2010-09-19 13:59:06.985669002 +0900
1919
-double MyPaint::paintAt(const KisPaintInformation& info)
1920
+qreal MyPaint::paintAt(const KisPaintInformation& info)
1922
if (m_mypaintThinksStrokeHasEnded) {
1923
m_settings->brush()->new_stroke();
1928
- double(m_eventTime.elapsed()) / 1000);
1929
+ qreal(m_eventTime.elapsed()) / 1000);
1934
m_mypaintThinksStrokeHasEnded = m_brush->stroke_to(m_surface,
1935
pi1.pos().x(), pi1.pos().y(),
1937
- double(m_eventTime.elapsed()) / 1000);
1938
+ qreal(m_eventTime.elapsed()) / 1000);
1939
if (m_mypaintThinksStrokeHasEnded) {
1940
m_brush->new_stroke();
1942
m_mypaintThinksStrokeHasEnded = m_brush->stroke_to(m_surface,
1943
pi2.pos().x(), pi2.pos().y(),
1945
- double(m_eventTime.elapsed()) / 1000);
1946
+ qreal(m_eventTime.elapsed()) / 1000);
1948
// not sure what to do with these...
1949
KisVector2D end = toKisVector2D(pi2.pos());
1950
Index: koffice-2.2.2/krita/plugins/paintops/particle/kis_particle_paintop.cpp
1951
===================================================================
1952
--- koffice-2.2.2.orig/krita/plugins/paintops/particle/kis_particle_paintop.cpp 2010-09-19 13:58:59.355669005 +0900
1953
+++ koffice-2.2.2/krita/plugins/paintops/particle/kis_particle_paintop.cpp 2010-09-19 13:59:06.985669002 +0900
1958
-double KisParticlePaintOp::paintAt(const KisPaintInformation& info)
1959
+qreal KisParticlePaintOp::paintAt(const KisPaintInformation& info)
1961
return paintLine(info, info).spacing;
1963
Index: koffice-2.2.2/krita/plugins/paintops/softbrush/kis_soft_paintop.cpp
1964
===================================================================
1965
--- koffice-2.2.2.orig/krita/plugins/paintops/softbrush/kis_soft_paintop.cpp 2010-09-19 13:59:00.355669006 +0900
1966
+++ koffice-2.2.2/krita/plugins/paintops/softbrush/kis_soft_paintop.cpp 2010-09-19 14:29:07.425669001 +0900
1968
m_color = painter->paintColor();
1970
// compute spacing for brush
1971
- m_xSpacing = qMax(0.5,m_sizeProperties.spacing * m_sizeProperties.diameter * m_sizeProperties.scale);
1972
- m_ySpacing = qMax(0.5,m_sizeProperties.spacing * m_sizeProperties.diameter * m_sizeProperties.aspect * m_sizeProperties.scale);
1973
+ m_xSpacing = qMax((qreal) 0.5,m_sizeProperties.spacing * m_sizeProperties.diameter * m_sizeProperties.scale);
1974
+ m_ySpacing = qMax((qreal) 0.5,m_sizeProperties.spacing * m_sizeProperties.diameter * m_sizeProperties.aspect * m_sizeProperties.scale);
1975
m_spacing = qMax(m_xSpacing, m_ySpacing);
1979
delete m_gaussBrush.distMask;
1982
-double KisSoftPaintOp::paintAt(const KisPaintInformation& info)
1983
+qreal KisSoftPaintOp::paintAt(const KisPaintInformation& info)
1985
if (!painter()) return m_spacing;
1988
KisFixedPaintDeviceSP dab = cachedDab(painter()->device()->colorSpace());
1997
QPointF pt = info.pos();
1998
if (m_sizeProperties.jitterEnabled){
1999
Index: koffice-2.2.2/krita/plugins/paintops/spray/kis_spray_paintop.cpp
2000
===================================================================
2001
--- koffice-2.2.2.orig/krita/plugins/paintops/spray/kis_spray_paintop.cpp 2010-09-19 13:59:00.575669003 +0900
2002
+++ koffice-2.2.2/krita/plugins/paintops/spray/kis_spray_paintop.cpp 2010-09-19 13:59:06.995669005 +0900
2007
-double KisSprayPaintOp::paintAt(const KisPaintInformation& info)
2008
+qreal KisSprayPaintOp::paintAt(const KisPaintInformation& info)
2016
- double rotation = m_rotationOption.apply(info);
2017
+ qreal rotation = m_rotationOption.apply(info);
2018
quint8 origOpacity = m_opacityOption.apply(painter(), info);
2019
- double scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
2020
+ qreal scale = KisPaintOp::scaleForPressure(m_sizeOption.apply(info));
2022
m_sprayBrush.paint( m_dab,
2023
m_settings->node()->paintDevice(),
2024
Index: koffice-2.2.2/krita/plugins/paintops/spray/random_gauss.cpp
2025
===================================================================
2026
--- koffice-2.2.2.orig/krita/plugins/paintops/spray/random_gauss.cpp 2010-09-19 13:59:00.615669005 +0900
2027
+++ koffice-2.2.2/krita/plugins/paintops/spray/random_gauss.cpp 2010-09-19 13:59:06.995669005 +0900
2029
#include "random_gauss.h"
2032
-double RandomGauss::nextGaussian(double mean, double sigma)
2033
+qreal RandomGauss::nextGaussian(qreal mean, qreal sigma)
2037
return (m_gauss + mean) * sigma;
2043
v1 = 2.0 * drand48() - 1.0;
2044
v2 = 2.0 * drand48() - 1.0;
2045
s = v1 * v1 + v2 * v2;
2048
- double norm = sqrt(-2.0 * log(s) / s);
2049
+ qreal norm = sqrt(-2.0 * log(s) / s);
2050
m_gauss = v2 * norm;
2053
Index: koffice-2.2.2/krita/plugins/paintops/spray/random_gauss.h
2054
===================================================================
2055
--- koffice-2.2.2.orig/krita/plugins/paintops/spray/random_gauss.h 2010-09-19 13:59:00.545669005 +0900
2056
+++ koffice-2.2.2/krita/plugins/paintops/spray/random_gauss.h 2010-09-19 13:59:06.995669005 +0900
2058
#define RANDOM_GAUSS_H_
2061
+#include <QtGlobal>
2063
#if defined(_WIN32) || defined(_WIN64)
2064
#define srand48 srand
2074
* Generates a random Gaussian value with the mean and sigma
2076
- double nextGaussian(double mean = 0.0, double sigma = 1.0);
2077
+ qreal nextGaussian(qreal mean = 0.0, qreal sigma = 1.0);
2081
Index: koffice-2.2.2/krita/plugins/colorspaces/ctlcs/KoCtlMixColorsOp.cpp
2082
===================================================================
2083
--- koffice-2.2.2.orig/krita/plugins/colorspaces/ctlcs/KoCtlMixColorsOp.cpp 2010-09-19 15:47:22.585669001 +0900
2084
+++ koffice-2.2.2/krita/plugins/colorspaces/ctlcs/KoCtlMixColorsOp.cpp 2010-09-19 15:53:12.185669001 +0900
2087
int alphaPos = m_colorSpace->alphaPos();
2088
// Compute the total for each channel by summing each colors multiplied by the weightlabcache
2089
- double totalAlpha = 0.0;
2090
+ qreal totalAlpha = 0.0;
2092
const quint8* color = *colors;
2093
double alphaTimesWeight;
2094
Index: koffice-2.2.2/filters/libmsooxml/MsooXmlUtils.cpp
2095
===================================================================
2096
--- koffice-2.2.2.orig/filters/libmsooxml/MsooXmlUtils.cpp 2010-09-19 18:31:51.325668995 +0900
2097
+++ koffice-2.2.2/filters/libmsooxml/MsooXmlUtils.cpp 2010-09-19 19:46:48.845669001 +0900
2098
@@ -1050,7 +1050,7 @@
2101
static QString ST_TwipsMeasure_to_ODF_with_unit(const QString& value,
2102
- double (*convertFromTwips)(double), const char* unit)
2103
+ qreal (*convertFromTwips)(qreal), const char* unit)
2105
if (value.isEmpty())