Krita Source Code Documentation
Loading...
Searching...
No Matches
KoHistogramProducer.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2005 Bart Coppens <kde@bartcoppens.be>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6
8
9#include <QList>
10#include <QGlobalStatic>
11
12#include <KoID.h>
13
15
16#include "KoColorSpace.h"
17
19
23
28
34
36{
37 QList<QString> list;
38 QList<float> preferredList;
39 Q_FOREACH (const QString &id, keys()) {
41
42 if (f->isCompatibleWith(colorSpace, isStrict)) {
43 float preferred = f->preferrednessLevelWith(colorSpace);
44 QList<float>::iterator pit = preferredList.begin();
45 QList<float>::iterator pend = preferredList.end();
46 QList<QString>::iterator lit = list.begin();
47
48 while (pit != pend && preferred <= *pit) {
49 ++pit;
50 ++lit;
51 }
52
53 list.insert(lit, id);
54 preferredList.insert(pit, preferred);
55 }
56 }
57 return list;
58}
Q_GLOBAL_STATIC(KisStoragePluginRegistry, s_instance)
const KoHistogramProducerFactory * value(const QString &id) const
QList< KoHistogramProducerFactory * > values() const
QList< QString > keysCompatibleWith(const KoColorSpace *colorSpace, bool isStrict=false) const
returns a list, sorted by preference: higher preference comes first
static KoHistogramProducerFactoryRegistry * instance()