Commit f37bba84 authored by Lukáš Tvrdý's avatar Lukáš Tvrdý

Fix Brightness/Contrast filter.

svn path=/trunk/koffice/; revision=1081025
parent 456116f9
......@@ -45,7 +45,7 @@ void KisBContrastBenchmark::initTestCase()
{
m_colorSpace = KoColorSpaceRegistry::instance()->rgb8();
m_device = new KisPaintDevice(m_colorSpace);
m_color = new KoColor(m_colorSpace);
m_color = KoColor(m_colorSpace);
QColor qcolor(Qt::red);
srand(31524744);
......@@ -58,8 +58,8 @@ void KisBContrastBenchmark::initTestCase()
g = rand() % 255;
b = rand() % 255;
m_color->fromQColor(QColor(r,g,b));
memcpy(it.rawData(), m_color->data(), m_colorSpace->pixelSize());
m_color.fromQColor(QColor(r,g,b));
memcpy(it.rawData(), m_color.data(), m_colorSpace->pixelSize());
++it;
}
......@@ -70,12 +70,12 @@ void KisBContrastBenchmark::cleanupTestCase()
}
void KisBContrastBenchmark::benchmarkProjection()
void KisBContrastBenchmark::benchmarkFilter()
{
KisFilterSP filter = KisFilterRegistry::instance()->value("brightnesscontrast");
KisFilterConfiguration * kfc = filter->defaultConfiguration(m_device);
/* // Get the predefined configuration from a file
// Get the predefined configuration from a file
QFile file(QString(FILES_DATA_DIR) + QDir::separator() + filter->id() + ".cfg");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
file.open(QIODevice::WriteOnly | QIODevice::Text);
......@@ -87,7 +87,7 @@ void KisBContrastBenchmark::benchmarkProjection()
s = in.readAll();
kfc->fromXML(s);
}
*/
KisConstProcessingInformation src(m_device, QPoint(0, 0), 0);
KisProcessingInformation dst(m_device, QPoint(0, 0), 0);
......
......@@ -19,6 +19,9 @@
#ifndef KIS_BCONTRAST_BENCHMARK_H
#define KIS_BCONTRAST_BENCHMARK_H
#include <KoColor.h>
#include <kis_types.h>
#include <QtTest/QtTest>
class KisPaintDevice;
......@@ -30,14 +33,15 @@ class KisBContrastBenchmark : public QObject
Q_OBJECT
private:
const KoColorSpace * m_colorSpace;
KisPaintDevice * m_device;
KoColor * m_color;
KoColor m_color;
KisPaintDeviceSP m_device;
private slots:
void initTestCase();
void cleanupTestCase();
void benchmarkProjection();
void benchmarkFilter();
};
......
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