1 #ifndef SEEN_COLOR_PROFILE_H
2 #define SEEN_COLOR_PROFILE_H
4 /** \file
5 * SPColorProfile: SVG <color-profile> implementation
6 */
8 #include <glib/gtypes.h>
9 #include <sp-object.h>
10 #include <glibmm/ustring.h>
11 #if ENABLE_LCMS
12 #include <lcms.h>
13 #endif // ENABLE_LCMS
15 namespace Inkscape {
17 enum {
18 RENDERING_INTENT_UNKNOWN = 0,
19 RENDERING_INTENT_AUTO = 1,
20 RENDERING_INTENT_PERCEPTUAL = 2,
21 RENDERING_INTENT_RELATIVE_COLORIMETRIC = 3,
22 RENDERING_INTENT_SATURATION = 4,
23 RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5
24 };
26 /// The SPColorProfile vtable.
27 struct ColorProfileClass {
28 SPObjectClass parent_class;
29 };
31 /** Color Profile. */
32 struct ColorProfile : public SPObject {
33 static GType getType();
34 static void classInit( ColorProfileClass *klass );
36 static std::list<Glib::ustring> getBaseProfileDirs();
37 static std::list<Glib::ustring> getProfileFiles();
38 #if ENABLE_LCMS
39 static cmsHPROFILE getSRGBProfile();
40 static cmsHPROFILE getNULLProfile();
42 icColorSpaceSignature getColorSpace() const {return _profileSpace;}
43 icProfileClassSignature getProfileClass() const {return _profileClass;}
44 cmsHTRANSFORM getTransfToSRGB8();
45 cmsHTRANSFORM getTransfFromSRGB8();
46 cmsHTRANSFORM getTransfGamutCheck();
47 bool GamutCheck(SPColor color);
49 #endif // ENABLE_LCMS
51 gchar* href;
52 gchar* local;
53 gchar* name;
54 gchar* intentStr;
55 guint rendering_intent;
56 #if ENABLE_LCMS
57 cmsHPROFILE profHandle;
58 #endif // ENABLE_LCMS
60 private:
61 static void init( ColorProfile *cprof );
63 static void release( SPObject *object );
64 static void build( SPObject *object, SPDocument *document, Inkscape::XML::Node *repr );
65 static void set( SPObject *object, unsigned key, gchar const *value );
66 static Inkscape::XML::Node *write( SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags );
67 #if ENABLE_LCMS
68 static DWORD _getInputFormat( icColorSpaceSignature space );
69 void _clearProfile();
71 static cmsHPROFILE _sRGBProf;
72 static cmsHPROFILE _NullProf;
74 icProfileClassSignature _profileClass;
75 icColorSpaceSignature _profileSpace;
76 cmsHTRANSFORM _transf;
77 cmsHTRANSFORM _revTransf;
78 cmsHTRANSFORM _gamutTransf;
79 #endif // ENABLE_LCMS
80 };
82 } // namespace Inkscape
84 #endif // !SEEN_COLOR_PROFILE_H
86 /*
87 Local Variables:
88 mode:c++
89 c-file-style:"stroustrup"
90 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
91 indent-tabs-mode:nil
92 fill-column:99
93 End:
94 */
95 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :