Commit 80e31248 authored by Cyrille Berger's avatar Cyrille Berger
Browse files

forward port: slightly saner defaults and formula

svn path=/trunk/koffice/; revision=600506
parent b9e8f898
......@@ -64,10 +64,10 @@ void KisUnsharpFilter::process(const KisPaintDeviceSP src, const QPoint& srcTopL
if(!config) config = new KisFilterConfiguration(id().id(), 1);
QVariant value;
uint halfSize = (config->getProperty("halfSize", value)) ? value.toUInt() : 4;
uint halfSize = (config->getProperty("halfSize", value)) ? value.toUInt() : 5;
uint size = 2 * halfSize + 1;
double amount = (config->getProperty("amount", value)) ? value.toDouble() : 0.1;
uint threshold = (config->getProperty("threshold", value)) ? value.toUInt() : 20;
double amount = (config->getProperty("amount", value)) ? value.toDouble() : 0.5;
uint threshold = (config->getProperty("threshold", value)) ? value.toUInt() : 10;
kDebug() << " brush size = " << size << " " << halfSize << endl;
KisAutobrushShape* kas = new KisAutobrushCircleShape(size, size , halfSize, halfSize);
......@@ -100,9 +100,12 @@ void KisUnsharpFilter::process(const KisPaintDeviceSP src, const QPoint& srcTopL
int pixelsProcessed = 0;
Q_INT32 weights[2];
weights[0] = 128;
/* weights[0] = 128;
Q_INT32 factor = (Q_UINT32) 128 / amount;
weights[1] = (factor - 128);
weights[1] = (factor - 128);*/
Q_INT32 factor = 128;
weights[0] = factor * ( 1. + amount);
weights[1] = -factor * amount;
kDebug() << (int) weights[0] << " " << (int)weights[1] << " " << factor << endl;
for( int j = 0; j < areaSize.height(); j++)
{
......
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