Code

Moving functionality into <color-profile>
[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 #if ENABLE_LCMS
11 #include <lcms.h>
12 #endif // ENABLE_LCMS
14 namespace Inkscape {
16 enum {
17     RENDERING_INTENT_UNKNOWN = 0,
18     RENDERING_INTENT_AUTO = 1,
19     RENDERING_INTENT_PERCEPTUAL = 2,
20     RENDERING_INTENT_RELATIVE_COLORIMETRIC = 3,
21     RENDERING_INTENT_SATURATION = 4,
22     RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5
23 };
25 /// The SPColorProfile vtable.
26 struct ColorProfileClass {
27     SPObjectClass parent_class;
28 };
30 /** Color Profile. */
31 struct ColorProfile : public SPObject {
32     static GType getType();
33     static void classInit( ColorProfileClass *klass );
35 #if ENABLE_LCMS
36     static cmsHPROFILE getSRGBProfile();
38     icColorSpaceSignature getColorSpace() const {return _profileSpace;}
39     icProfileClassSignature getProfileClass() const {return _profileClass;}
40     cmsHTRANSFORM getTransfToSRGB8();
41     cmsHTRANSFORM getTransfFromSRGB8();
42 #endif // ENABLE_LCMS
44     gchar* href;
45     gchar* local;
46     gchar* name;
47     gchar* intentStr;
48     guint rendering_intent;
49 #if ENABLE_LCMS
50     cmsHPROFILE profHandle;
51 #endif // ENABLE_LCMS
53 private:
54     static void init( ColorProfile *cprof );
56     static void release( SPObject *object );
57     static void build( SPObject *object, SPDocument *document, Inkscape::XML::Node *repr );
58     static void set( SPObject *object, unsigned key, gchar const *value );
59     static Inkscape::XML::Node *write( SPObject *object, Inkscape::XML::Node *repr, guint flags );
60 #if ENABLE_LCMS
61     static DWORD _getInputFormat( icColorSpaceSignature space );
62     void _clearProfile();
64     static cmsHPROFILE _sRGBProf;
66     icProfileClassSignature _profileClass;
67     icColorSpaceSignature _profileSpace;
68     cmsHTRANSFORM _transf;
69     cmsHTRANSFORM _revTransf;
70 #endif // ENABLE_LCMS
71 };
73 } // namespace Inkscape
75 #endif // !SEEN_COLOR_PROFILE_H
77 /*
78   Local Variables:
79   mode:c++
80   c-file-style:"stroustrup"
81   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
82   indent-tabs-mode:nil
83   fill-column:99
84   End:
85 */
86 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :