Commit 9dbe090a authored by Boudewijn Rempt's avatar Boudewijn Rempt

Also use the registry for the filter strategies in the Node class

parent e8df0184
......@@ -512,25 +512,9 @@ void Node::scaleNode(int width, int height, QString strategy)
if (!qobject_cast<KisLayer*>(d->node.data())) return;
if (!d->node->parent()) return;
KisFilterStrategy *actualStrategy;
if (strategy == "hermite") {
actualStrategy = new KisHermiteFilterStrategy();
} else if (strategy == "bicubic") {
actualStrategy = new KisBicubicFilterStrategy();
} else if (strategy == "box") {
actualStrategy = new KisBoxFilterStrategy();
} else if (strategy == "bilinear") {
actualStrategy = new KisBilinearFilterStrategy();
} else if (strategy == "bell") {
actualStrategy = new KisBellFilterStrategy();
} else if (strategy == "bspline") {
actualStrategy = new KisBSplineFilterStrategy();
} else if (strategy == "lanczos3") {
actualStrategy = new KisLanczos3FilterStrategy();
} else if (strategy == "mitchell") {
actualStrategy = new KisMitchellFilterStrategy();
}
KisFilterStrategy *actualStrategy = KisFilterStrategyRegistry::instance()->get(strategy);
if (!actualStrategy) actualStrategy = KisFilterStrategyRegistry::instance()->get("Bicubic");
d->image->scaleNode(d->node, width, height, actualStrategy);
}
......
......@@ -458,14 +458,14 @@ public Q_SLOTS:
* @param height
* @param strategy the scaling strategy. There's several ones amongst these that aren't available in the regular UI.
* <ul>
* <li>hermite</li>
* <li>bicubic - Adds pixels using the color of surrounding pixels. Produces smoother tonal gradations than Bilinear.</li>
* <li>box - Replicate pixels in the image. Preserves all the original detail, but can produce jagged effects.</li>
* <li>bilinear - Adds pixels averaging the color values of surrounding pixels. Produces medium quality results when the image is scaled from half to two times the original size.</li>
* <li>bell</li>
* <li>bspline</li>
* <li>lanczos3 - Offers similar results than Bicubic, but maybe a little bit sharper. Can produce light and dark halos along strong edges.</li>
* <li>mitchell</li>
* <li>Hermite</li>
* <li>Bicubic - Adds pixels using the color of surrounding pixels. Produces smoother tonal gradations than Bilinear.</li>
* <li>Box - Replicate pixels in the image. Preserves all the original detail, but can produce jagged effects.</li>
* <li>Bilinear - Adds pixels averaging the color values of surrounding pixels. Produces medium quality results when the image is scaled from half to two times the original size.</li>
* <li>Bell</li>
* <li>BSpline</li>
* <li>Lanczos3 - Offers similar results than Bicubic, but maybe a little bit sharper. Can produce light and dark halos along strong edges.</li>
* <li>Mitchell</li>
* </ul>
*/
void scaleNode(int width, int height, QString strategy);
......
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