chalk

kis_colorspace_factory_registry.h
1/*
2 * Copyright (c) 2003 Patrick Julien <freak@codepimps.org>
3 * Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifndef KIS_COLORSPACE_FACTORY_REGISTRY_H_
21#define KIS_COLORSPACE_FACTORY_REGISTRY_H_
22#include "tqobject.h"
23#include "kis_generic_registry.h"
24#include "kis_colorspace.h"
25
26class TQStringList;
28
35class KisColorSpaceFactoryRegistry : public TQObject, public KisGenericRegistry<KisColorSpaceFactory *> {
36
37
38 TQ_OBJECT
39
40
41public:
42
51 KisColorSpaceFactoryRegistry(TQStringList profileFileNames);
52
54
58 void addProfile(KisProfile * p);
59
64 KisProfile * getProfileByName(const TQString & name);
65
69 TQValueVector<KisProfile *> profilesFor(KisColorSpaceFactory * cs);
70
71 TQValueVector<KisProfile *> profilesFor(KisID id);
72
76 KisColorSpace * getColorSpace(const KisID & csID, const TQString & profileName);
77
81 KisColorSpace * getColorSpace(const KisID & csID, const KisProfile * profile);
82
87
92
100
104 TQValueVector<KisPaintDeviceAction *> paintDeviceActionsFor(KisColorSpace* cs);
105
106private:
110
111private:
112
113 TQMap<TQString, KisProfile * > m_profileMap;
114 TQMap<TQString, KisColorSpace * > m_csMap;
115 typedef TQValueVector<KisPaintDeviceAction *> PaintActionVector;
116 TQMap<KisID, PaintActionVector> m_paintDevActionMap;
117 KisColorSpace *m_alphaCs;
118};
119
120#endif // KIS_COLORSPACE_FACTORY_REGISTRY_H_
121
TQValueVector< KisProfile * > profilesFor(KisColorSpaceFactory *cs)
Return the vector of profiles for this colorspacefactory.
TQValueVector< KisPaintDeviceAction * > paintDeviceActionsFor(KisColorSpace *cs)
Get a list of KisConstructPaintDeviceAction for a colorspace.
KisColorSpace * getAlpha8()
Convenience method to get the often used alpha colorspace.
KisColorSpaceFactoryRegistry(TQStringList profileFileNames)
Create a new colorspacefactory registry.
KisColorSpace * getRGB8()
Convenience method to get an RGB colorspace with the default lcms profile.
KisColorSpace * getColorSpace(const KisID &csID, const TQString &profileName)
Return the colorspace + profile as named, or NULL if impossible combination.
KisProfile * getProfileByName(const TQString &name)
Return the profile associated with the given product name, or 0.
void addProfile(KisProfile *p)
Add the profile to the list.
void addPaintDeviceAction(KisColorSpace *cs, KisPaintDeviceAction *action)
add a KisConstructPaintDeviceAction to the registry for a colorspace
A colorspace is the definition of a certain color model in Chalk.
Chalk has a large number of extensible resources.
Definition kis_id.h:57
Defines an action to do with a paint device.