File indexing completed on 2024-12-22 04:10:16
0001 /* 0002 * SPDX-FileCopyrightText: 2007 Boudewijn Rempt boud @valdyas.org 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "kis_histogram_test.h" 0008 0009 #include <simpletest.h> 0010 #include <KoColorSpace.h> 0011 #include <KoColorSpaceRegistry.h> 0012 #include <KoHistogramProducer.h> 0013 #include "kis_paint_device.h" 0014 #include "kis_histogram.h" 0015 #include "kis_paint_layer.h" 0016 #include "kis_types.h" 0017 #include "testimage.h" 0018 0019 void KisHistogramTest::testCreation() 0020 { 0021 const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8(); 0022 KisPaintDeviceSP dev = new KisPaintDevice(cs); 0023 QList<QString> producers = KoHistogramProducerFactoryRegistry::instance()->keysCompatibleWith(cs); 0024 Q_FOREACH (const QString &id, producers) { 0025 if (id.contains("YCBCR")) { 0026 continue; 0027 } 0028 KoHistogramProducer *producer = KoHistogramProducerFactoryRegistry::instance()->get(id)->generate(); 0029 if (producer) { 0030 KisHistogram test(dev, QRect(0, 0, 100, 100), producer, LINEAR); 0031 Q_UNUSED(test); 0032 } 0033 //delete producer; 0034 } 0035 } 0036 0037 0038 KISTEST_MAIN(KisHistogramTest)