Commit 71ac4050 authored by Emmet O'Neill's avatar Emmet O'Neill

Wave Filter: Corrected axis association.

Horizontal wave controls now affect the wave that 'travels' left to right.
Vertical wave controls now affect the wave that 'travels' from top to bottom.
parent 9975294e
......@@ -138,29 +138,30 @@ void KisFilterWave::processImpl(KisPaintDeviceSP device,
int verticalamplitude = (config && config->getProperty("verticalamplitude", value)) ? value.toInt() : 4;
int verticalshape = (config && config->getProperty("verticalshape", value)) ? value.toInt() : 0;
KisWaveCurve* horizontalcurve;
if (horizontalshape == 1)
horizontalcurve = new KisTriangleWaveCurve(horizontalamplitude, horizontalwavelength, horizontalshift);
KisWaveCurve* verticalWave;
if (verticalshape == 1)
verticalWave = new KisTriangleWaveCurve(verticalamplitude, verticalwavelength, verticalshift);
else
horizontalcurve = new KisSinusoidalWaveCurve(horizontalamplitude, horizontalwavelength, horizontalshift);
verticalWave = new KisSinusoidalWaveCurve(verticalamplitude, verticalwavelength, verticalshift);
KisWaveCurve* verticalcurve;
if (verticalshape == 1)
verticalcurve = new KisTriangleWaveCurve(verticalamplitude, verticalwavelength, verticalshift);
KisWaveCurve* horizontalWave;
if (horizontalshape == 1)
horizontalWave = new KisTriangleWaveCurve(horizontalamplitude, horizontalwavelength, horizontalshift);
else
verticalcurve = new KisSinusoidalWaveCurve(verticalamplitude, verticalwavelength, verticalshift);
horizontalWave = new KisSinusoidalWaveCurve(horizontalamplitude, horizontalwavelength, horizontalshift);
KisSequentialIteratorProgress dstIt(device, applyRect, progressUpdater);
KisRandomSubAccessorSP srcRSA = device->createRandomSubAccessor();
while (dstIt.nextPixel()) {
double xv = horizontalcurve->valueAt(dstIt.y(), dstIt.x());
double yv = verticalcurve->valueAt(dstIt.x(), dstIt.y());
srcRSA->moveTo(QPointF(xv, yv));
srcRSA->sampledOldRawData(dstIt.rawData());
KisSequentialIteratorProgress destination(device, applyRect, progressUpdater);
KisRandomSubAccessorSP source = device->createRandomSubAccessor();
while (destination.nextPixel()) {
double xv = verticalWave->valueAt(destination.y(), destination.x());
double yv = horizontalWave->valueAt(destination.x(), destination.y());
source->moveTo(QPointF(xv, yv));
source->sampledOldRawData(destination.rawData());
}
delete horizontalcurve;
delete verticalcurve;
delete verticalWave;
delete horizontalWave;
}
QRect KisFilterWave::neededRect(const QRect& rect, const KisFilterConfigurationSP config, int lod) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment