Commit e3fdeeb5 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix KisAllFilterTest

1) Updated configs and reference images
2) Fix Small Tiles filter to take correct bounding rect
3) Fix Small Tiles filter to clear the area before processing
4) Fix the test to set default bounds correctly and to reuse
   standard QImage comparison function with fuzziness
parent 9d313acd
......@@ -61,7 +61,7 @@ KisSmallTilesFilter::KisSmallTilesFilter() : KisFilter(id(), FiltersCategoryMapI
}
void KisSmallTilesFilter::processImpl(KisPaintDeviceSP device,
const QRect& /*applyRect*/,
const QRect& applyRect,
const KisFilterConfigurationSP config,
KoUpdater* progressUpdater
) const
......@@ -69,16 +69,18 @@ void KisSmallTilesFilter::processImpl(KisPaintDeviceSP device,
Q_ASSERT(!device.isNull());
//read the filter configuration values from the KisFilterConfiguration object
quint32 numberOfTiles = config->getInt("numberOfTiles", 2);
const quint32 numberOfTiles = config->getInt("numberOfTiles", 2);
QRect srcRect = device->exactBounds();
const QRect srcRect = applyRect;
int w = static_cast<int>(srcRect.width() / numberOfTiles);
int h = static_cast<int>(srcRect.height() / numberOfTiles);
const int w = static_cast<int>(srcRect.width() / numberOfTiles);
const int h = static_cast<int>(srcRect.height() / numberOfTiles);
KisPaintDeviceSP tile = device->createThumbnailDevice(srcRect.width() / numberOfTiles, srcRect.height() / numberOfTiles);
KisPaintDeviceSP tile = device->createThumbnailDevice(w, h);
if (tile.isNull()) return;
device->clear(applyRect);
KisPainter gc(device);
gc.setCompositeOp(COMPOSITE_COPY);
......
......@@ -7,7 +7,7 @@
]]></param>
<param type="color" name="power"><![CDATA[<!DOCTYPE color>
<color>
<RGB g="1" b="1" r="1" space="sRGB built-in"/>
<RGB g="1.2" b="0.8" r="0.3" space="sRGB built-in"/>
</color>
]]></param>
<param type="color" name="slope"><![CDATA[<!DOCTYPE color>
......
<!DOCTYPE params>
<params version="0"/>
<params version="0">
<param name="type" type="internal">0</param>
<param name="exposure" type="internal">2.0</param>
</params>
<!DOCTYPE params>
<params version="0">
<param type="internal" name="cyan_red_highlights">0</param>
<param type="internal" name="cyan_red_midtones">0</param>
<param type="internal" name="cyan_red_midtones">80</param>
<param type="internal" name="cyan_red_shadows">0</param>
<param type="internal" name="magenta_blue_highlights">0</param>
<param type="internal" name="magenta_blue_midtones">0</param>
<param type="internal" name="magenta_blue_shadows">0</param>
<param type="internal" name="preserve_luminosity">true</param>
<param type="internal" name="yellow_green_highlights">0</param>
<param type="internal" name="yellow_green_midtones">0</param>
<param type="internal" name="yellow_green_midtones">80</param>
<param type="internal" name="yellow_green_shadows">0</param>
</params>
<!DOCTYPE params>
<params>
<param name="targetcolor" ><![CDATA[#ffffff]]></param>
<param name="threshold" ><![CDATA[0]]></param>
<param name="threshold" ><![CDATA[50]]></param>
</params>
<!DOCTYPE params>
<params version="1">
<param name="nTransfers">0</param>
<param name="nTransfers">8</param>
<param name="curve0">0,0.5;1,0.5;</param>
<param name="curve1">0,0.5;0.844548,0.709804;1,0.5;</param>
<param name="curve2">0,0.5;1,0.5;</param>
<param name="curve3">0,0.5;1,0.5;</param>
<param name="curve4">0,0.5;1,0.5;</param>
<param name="curve5">0,0.5;1,0.5;</param>
<param name="curve6">0,0.5;1,0.5;</param>
<param name="curve7">0,0.5;1,0.5;</param>
<param name="driver0">7</param>
<param name="driver1">7</param>
<param name="driver2">7</param>
<param name="driver3">7</param>
<param name="driver4">7</param>
<param name="driver5">7</param>
<param name="driver6">7</param>
<param name="driver7">7</param>
</params>
<!DOCTYPE params>
<params version="0"/>
<params version="0">
<param name="type" type="internal">0</param>
<param name="exposure" type="internal">2.0</param>
</params>
<!DOCTYPE params>
<params version="1">
<param type="internal" name="blueSwizzle">4</param>
<param type="internal" name="channelToConvert">0</param>
<param type="internal" name="greenSwizzle">2</param>
<param type="internal" name="horizRadius">1</param>
<param type="internal" name="lockAspect">true</param>
<param type="internal" name="redSwizzle">0</param>
<param type="string" name="type"><![CDATA[sobol]]></param>
<param type="internal" name="vertRadius">1</param>
</params>
......@@ -3,4 +3,4 @@
<param name="h" ><![CDATA[2]]></param>
<param name="s" ><![CDATA[20]]></param>
<param name="v" ><![CDATA[40]]></param>
<params/>
</params>
<!DOCTYPE params>
<params version="0">
<param type="internal" name="LFactor">1</param>
<param type="internal" name="aFactor">1</param>
<param type="internal" name="alphaSteps">1</param>
<param type="internal" name="bFactor">1</param>
<param type="internal" name="colorLimit">32</param>
<param type="bytearray" name="paletteGen">AAAAAAH//////////wAAAf//////////AAAB//////////8AAAH//////////wAAAf///////wAAAAAB////////AAAAAAH///////8AAAAAAf///////wAAAAAB//+goKCgpKQAAAH//6CgoKCkpAAAAf//oKCgoKSkAAAB//+goKCgpKQAAAH//wAAAAAAAAAAAf//AAAAAAAAAAAB//8AAAAAAAAAAAH//wAAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAAAAAQAAAAEAAAABAAAAAIA</param>
<param type="internal" name="reduceColorsEnabled">false</param>
</params>
<!DOCTYPE params>
<params version="1">
<param type="internal" name="halfHeight">5</param>
<param type="internal" name="halfWidth">5</param>
<param type="internal" name="irisRadius">5</param>
<param type="internal" name="irisRotation">0</param>
<param type="string" name="irisShape"><![CDATA[Pentagon (5)]]></param>
</params>
<!DOCTYPE params>
<params version="1">
<param type="internal" name="blackvalue">0</param>
<param type="internal" name="gammavalue">4.583</param>
<param type="internal" name="outblackvalue">0</param>
<param type="internal" name="outwhitevalue">255</param>
<param type="internal" name="whitevalue">255</param>
</params>
<!DOCTYPE params>
<params version="1">
<param type="internal" name="blurAngle">0</param>
<param type="internal" name="blurLength">5</param>
</params>
<!DOCTYPE params>
<params version="0"/>
<!DOCTYPE params>
<params/>
<params version="1">
<param name="nTransfers">8</param>
<param name="curve0">0,0;0.218097,0.561594;0.798144,0.101449;1,1;</param>
<param name="curve1">0,0;1,1;</param>
<param name="curve2">0,0;0.696056,0.402174;1,1;</param>
<param name="curve3">0,0;1,1;</param>
<param name="curve4">0,0;1,1;</param>
<param name="curve5">0,0;1,1;</param>
<param name="curve6">0,0;1,1;</param>
<param name="curve7">0,0;1,1;</param>
</params>
<!DOCTYPE params>
<params version="2">
<param type="internal" name="Azimuth0">50</param>
<param type="internal" name="Azimuth1">100</param>
<param type="internal" name="Azimuth2">150</param>
<param type="internal" name="Azimuth3">200</param>
<param type="internal" name="Inclination0">25</param>
<param type="internal" name="Inclination1">20</param>
<param type="internal" name="Inclination2">30</param>
<param type="internal" name="Inclination3">40</param>
<param type="internal" name="ambientReflectivity">0.2</param>
<param type="internal" name="diffuseReflectivity">0.5</param>
<param type="internal" name="diffuseReflectivityIsEnabled">true</param>
<param type="internal" name="illuminantColor0">#ffff00</param>
<param type="internal" name="illuminantColor1">#ff0000</param>
<param type="internal" name="illuminantColor2">#0000ff</param>
<param type="internal" name="illuminantColor3">#00ff00</param>
<param type="internal" name="illuminantIsEnabled0">true</param>
<param type="internal" name="illuminantIsEnabled1">true</param>
<param type="internal" name="illuminantIsEnabled2">false</param>
<param type="internal" name="illuminantIsEnabled3">false</param>
<param type="internal" name="shinynessExponent">2</param>
<param type="internal" name="specularReflectivity">0.3</param>
<param type="internal" name="specularReflectivityIsEnabled">true</param>
<param type="internal" name="useNormalMapIsEnabled">false</param>
</params>
<!DOCTYPE params>
<params version="0">
<param type="internal" name="steps">16</param>
</params>
<!DOCTYPE params>
<params version="1">
<param type="internal" name="threshold">128</param>
</params>
......@@ -28,7 +28,6 @@ class KisAllFilterTest : public QObject
private Q_SLOTS:
void testAllFilters();
void testAllFiltersNoTransaction();
void testAllFiltersSrcNotIsDev();
void testAllFiltersWithSelections();
};
......
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