Commit 01193ad5 authored by Lukáš Tvrdý's avatar Lukáš Tvrdý

Add projection benchmark. Loads image, call refreshGraph() to compute...

Add projection benchmark. Loads image, call refreshGraph() to compute projection and save to another file.
Native fileformat used.

svn path=/trunk/koffice/; revision=1080123
parent e5f3c8c3
......@@ -9,9 +9,13 @@ add_definitions(-DFILES_OUTPUT_DIR="\\"${CMAKE_CURRENT_BINARY_DIR}\\"")
set(kis_datamanager_benchmark_SRCS kis_datamanager_benchmark.cpp)
set(kis_iterator_benchmark_SRCS kis_hline_iterator_benchmark.cpp)
set(kis_projection_benchmark_SRCS kis_projection_benchmark.cpp)
kde4_add_unit_test(KisDatamanagerBenchmark TESTNAME krita-benchmarks-KisDataManager ${kis_datamanager_benchmark_SRCS})
kde4_add_unit_test(KisHLineIteratorBenchmark TESTNAME krita-benchmarks-KisHLineIterator ${kis_iterator_benchmark_SRCS})
kde4_add_unit_test(KisProjectionBenchmark TESTNAME krita-benchmarks-KisProjectionBenchmark ${kis_projection_benchmark_SRCS})
target_link_libraries(KisDatamanagerBenchmark ${KDE4_KDEUI_LIBS} kritaimage ${QT_QTTEST_LIBRARY})
target_link_libraries(KisHLineIteratorBenchmark ${KDE4_KDEUI_LIBS} kritaimage ${QT_QTTEST_LIBRARY})
target_link_libraries(KisProjectionBenchmark ${KDE4_KDEUI_LIBS} kritaimage kritaui ${QT_QTTEST_LIBRARY})
\ No newline at end of file
/*
* Copyright (c) 2010 Lukáš Tvrdý lukast.dev@gmail.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <qtest_kde.h>
#include "kis_projection_benchmark.h"
#include "kis_benchmark_values.h"
#include "kis_iterators_pixel.h"
#include "kis_paint_device.h"
#include <KoColorSpace.h>
#include <KoColorSpaceRegistry.h>
#include <KoColor.h>
#include "kis_doc2.h"
#include <kis_image.h>
void KisProjectionBenchmark::initTestCase()
{
}
void KisProjectionBenchmark::cleanupTestCase()
{
}
void KisProjectionBenchmark::benchmarkProjection()
{
QBENCHMARK{
KisDoc2 doc;
doc.loadNativeFormat(QString(FILES_DATA_DIR) + QDir::separator() + "load_test.kra");
doc.image()->refreshGraph();
doc.saveNativeFormat(QString(FILES_OUTPUT_DIR) + QDir::separator() + "save_test.kra");
}
}
QTEST_KDEMAIN(KisProjectionBenchmark, GUI)
#include "kis_projection_benchmark.moc"
/*
* Copyright (c) 2010 Lukáš Tvrdý lukast.dev@gmail.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KIS_PROJECTION_BENCHMARK_H
#define KIS_PROJECTION_BENCHMARK_H
#include <QtTest/QtTest>
/// loads the image, computes the projection and saves it to another file
class KisProjectionBenchmark : public QObject
{
Q_OBJECT
private slots:
void initTestCase();
void cleanupTestCase();
void benchmarkProjection();
};
#endif
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