Code

Connector tool: make connectors avoid the convex hull of shapes.
[inkscape.git] / src / color-profile.h
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> getProfileDirs();
37 #if ENABLE_LCMS
38     static cmsHPROFILE getSRGBProfile();
40     icColorSpaceSignature getColorSpace() const {return _profileSpace;}
41     icProfileClassSignature getProfileClass() const {return _profileClass;}
42     cmsHTRANSFORM getTransfToSRGB8();
43     cmsHTRANSFORM getTransfFromSRGB8();
44 #endif // ENABLE_LCMS
46     gchar* href;
47     gchar* local;
48     gchar* name;
49     gchar* intentStr;
50     guint rendering_intent;
51 #if ENABLE_LCMS
52     cmsHPROFILE profHandle;
53 #endif // ENABLE_LCMS
55 private:
56     static void init( ColorProfile *cprof );
58     static void release( SPObject *object );
59     static void build( SPObject *object, SPDocument *document, Inkscape::XML::Node *repr );
60     static void set( SPObject *object, unsigned key, gchar const *value );
61     static Inkscape::XML::Node *write( SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags );
62 #if ENABLE_LCMS
63     static DWORD _getInputFormat( icColorSpaceSignature space );
64     void _clearProfile();
66     static cmsHPROFILE _sRGBProf;
68     icProfileClassSignature _profileClass;
69     icColorSpaceSignature _profileSpace;
70     cmsHTRANSFORM _transf;
71     cmsHTRANSFORM _revTransf;
72 #endif // ENABLE_LCMS
73 };
75 } // namespace Inkscape
77 #endif // !SEEN_COLOR_PROFILE_H
79 /*
80   Local Variables:
81   mode:c++
82   c-file-style:"stroustrup"
83   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
84   indent-tabs-mode:nil
85   fill-column:99
86   End:
87 */
88 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :