Code

non-lcms build fixes
[inkscape.git] / src / color-profile.cpp
3 #include "xml/repr.h"
4 #include "color-profile.h"
5 #include "color-profile-fns.h"
6 #include "attributes.h"
7 #include "inkscape.h"
8 #include "document.h"
9 #include "prefs-utils.h"
11 #include "dom/uri.h"
13 //#define DEBUG_LCMS
15 #include <glib/gstdio.h>
16 #include <sys/fcntl.h>
18 #ifdef DEBUG_LCMS
19 #include <gtk/gtkmessagedialog.h>
20 #endif // DEBUG_LCMS
22 using Inkscape::ColorProfile;
23 using Inkscape::ColorProfileClass;
25 namespace Inkscape
26 {
27 static void colorprofile_class_init( ColorProfileClass *klass );
28 static void colorprofile_init( ColorProfile *cprof );
30 static void colorprofile_release( SPObject *object );
31 static void colorprofile_build( SPObject *object, SPDocument *document, Inkscape::XML::Node *repr );
32 static void colorprofile_set( SPObject *object, unsigned key, gchar const *value );
33 static Inkscape::XML::Node *colorprofile_write( SPObject *object, Inkscape::XML::Node *repr, guint flags );
35 #if ENABLE_LCMS
36 static cmsHPROFILE colorprofile_get_system_profile_handle();
37 static cmsHPROFILE colorprofile_get_proof_profile_handle();
38 #endif // ENABLE_LCMS
39 }
41 #ifdef DEBUG_LCMS
42 extern guint update_in_progress;
43 #define DEBUG_MESSAGE(key, ...) \
44 {\
45     gint dump = prefs_get_int_attribute_limited("options.scislac", #key, 0, 0, 1);\
46     gint dumpD = prefs_get_int_attribute_limited("options.scislac", #key"D", 0, 0, 1);\
47     gint dumpD2 = prefs_get_int_attribute_limited("options.scislac", #key"D2", 0, 0, 1);\
48     dumpD &= ( (update_in_progress == 0) || dumpD2 );\
49     if ( dump )\
50     {\
51         g_message( __VA_ARGS__ );\
52 \
53     }\
54     if ( dumpD )\
55     {\
56         GtkWidget *dialog = gtk_message_dialog_new(NULL,\
57                                                    GTK_DIALOG_DESTROY_WITH_PARENT, \
58                                                    GTK_MESSAGE_INFO,    \
59                                                    GTK_BUTTONS_OK,      \
60                                                    __VA_ARGS__          \
61                                                    );\
62         g_signal_connect_swapped(dialog, "response",\
63                                  G_CALLBACK(gtk_widget_destroy),        \
64                                  dialog);                               \
65         gtk_widget_show_all( dialog );\
66     }\
67 }
68 #endif // DEBUG_LCMS
70 static SPObject *cprof_parent_class;
72 /**
73  * Register ColorProfile class and return its type.
74  */
75 GType Inkscape::colorprofile_get_type()
76 {
77     static GType type = 0;
78     if (!type) {
79         GTypeInfo info = {
80             sizeof(ColorProfileClass),
81             NULL, NULL,
82             (GClassInitFunc) colorprofile_class_init,
83             NULL, NULL,
84             sizeof(ColorProfile),
85             16,
86             (GInstanceInitFunc) colorprofile_init,
87             NULL,   /* value_table */
88         };
89         type = g_type_register_static( SP_TYPE_OBJECT, "ColorProfile", &info, static_cast<GTypeFlags>(0) );
90     }
91     return type;
92 }
94 /**
95  * ColorProfile vtable initialization.
96  */
97 static void Inkscape::colorprofile_class_init( ColorProfileClass *klass )
98 {
99     SPObjectClass *sp_object_class = reinterpret_cast<SPObjectClass *>(klass);
101     cprof_parent_class = static_cast<SPObject*>(g_type_class_ref(SP_TYPE_OBJECT));
103     sp_object_class->release = colorprofile_release;
104     sp_object_class->build = colorprofile_build;
105     sp_object_class->set = colorprofile_set;
106     sp_object_class->write = colorprofile_write;
109 /**
110  * Callback for ColorProfile object initialization.
111  */
112 static void Inkscape::colorprofile_init( ColorProfile *cprof )
114     cprof->href = 0;
115     cprof->local = 0;
116     cprof->name = 0;
117     cprof->intentStr = 0;
118     cprof->rendering_intent = Inkscape::RENDERING_INTENT_UNKNOWN;
119 #if ENABLE_LCMS
120     cprof->profHandle = 0;
121 #endif // ENABLE_LCMS
124 /**
125  * Callback: free object
126  */
127 static void Inkscape::colorprofile_release( SPObject *object )
129     ColorProfile *cprof = COLORPROFILE(object);
130     if ( cprof->href ) {
131         g_free( cprof->href );
132         cprof->href = 0;
133     }
135     if ( cprof->local ) {
136         g_free( cprof->local );
137         cprof->local = 0;
138     }
140     if ( cprof->name ) {
141         g_free( cprof->name );
142         cprof->name = 0;
143     }
145     if ( cprof->intentStr ) {
146         g_free( cprof->intentStr );
147         cprof->intentStr = 0;
148     }
150 #if ENABLE_LCMS
151     if ( cprof->profHandle ) {
152         cmsCloseProfile( cprof->profHandle );
153         cprof->profHandle = 0;
154     }
155 #endif // ENABLE_LCMS
158 /**
159  * Callback: set attributes from associated repr.
160  */
161 static void Inkscape::colorprofile_build( SPObject *object, SPDocument *document, Inkscape::XML::Node *repr )
163     ColorProfile *cprof = COLORPROFILE(object);
164     g_assert(cprof->href == 0);
165     g_assert(cprof->local == 0);
166     g_assert(cprof->name == 0);
167     g_assert(cprof->intentStr == 0);
169     if (((SPObjectClass *) cprof_parent_class)->build) {
170         (* ((SPObjectClass *) cprof_parent_class)->build)(object, document, repr);
171     }
172     sp_object_read_attr( object, "xlink:href" );
173     sp_object_read_attr( object, "local" );
174     sp_object_read_attr( object, "name" );
175     sp_object_read_attr( object, "rendering-intent" );
178 /**
179  * Callback: set attribute.
180  */
181 static void Inkscape::colorprofile_set( SPObject *object, unsigned key, gchar const *value )
183     ColorProfile *cprof = COLORPROFILE(object);
185     switch (key) {
186         case SP_ATTR_XLINK_HREF:
187             if ( cprof->href ) {
188                 g_free( cprof->href );
189                 cprof->href = 0;
190             }
191             if ( value ) {
192                 cprof->href = g_strdup( value );
193                 if ( *cprof->href ) {
194 #if ENABLE_LCMS
195                     cmsErrorAction( LCMS_ERROR_SHOW );
197                     // TODO open filename and URIs properly
198                     //FILE* fp = fopen_utf8name( filename, "r" );
199                     //LCMSAPI cmsHPROFILE   LCMSEXPORT cmsOpenProfileFromMem(LPVOID MemPtr, DWORD dwSize);
201                     // Try to open relative
202                     SPDocument *doc = SP_OBJECT_DOCUMENT(object);
203                     if (!doc) {
204                         doc = SP_ACTIVE_DOCUMENT;
205                         g_warning("object has no document.  using active");
206                     }
207                     //# 1.  Get complete URI of document
208                     gchar const *docbase = SP_DOCUMENT_URI( doc );
209                     if (!docbase)
210                         {
211                         g_warning("null docbase");
212                         docbase = "";
213                         }
214                     //g_message("docbase:%s\n", docbase);
215                     org::w3c::dom::URI docUri(docbase);
216                     //# 2. Get href of icc file.  we don't care if it's rel or abs
217                     org::w3c::dom::URI hrefUri(cprof->href);
218                     //# 3.  Resolve the href according the docBase.  This follows
219                     //      the w3c specs.  All absolute and relative issues are considered
220                     org::w3c::dom::URI cprofUri = docUri.resolve(hrefUri);
221                     gchar* fullname = (gchar *)cprofUri.getNativePath().c_str();
222                     cprof->profHandle = cmsOpenProfileFromFile( fullname, "r" );
223 #ifdef DEBUG_LCMS
224                     DEBUG_MESSAGE( lcmsOne, "cmsOpenProfileFromFile( '%s'...) = %p", fullname, (void*)cprof->profHandle );
225 #endif // DEBUG_LCMS
227 #endif // ENABLE_LCMS
228                 }
229             }
230             object->requestModified(SP_OBJECT_MODIFIED_FLAG);
231             break;
233         case SP_ATTR_LOCAL:
234             if ( cprof->local ) {
235                 g_free( cprof->local );
236                 cprof->local = 0;
237             }
238             cprof->local = g_strdup( value );
239             object->requestModified(SP_OBJECT_MODIFIED_FLAG);
240             break;
242         case SP_ATTR_NAME:
243             if ( cprof->name ) {
244                 g_free( cprof->name );
245                 cprof->name = 0;
246             }
247             cprof->name = g_strdup( value );
248 #ifdef DEBUG_LCMS
249             DEBUG_MESSAGE( lcmsTwo, "<color-profile> name set to '%s'", cprof->name );
250 #endif // DEBUG_LCMS
251             object->requestModified(SP_OBJECT_MODIFIED_FLAG);
252             break;
254         case SP_ATTR_RENDERING_INTENT:
255             if ( cprof->intentStr ) {
256                 g_free( cprof->intentStr );
257                 cprof->intentStr = 0;
258             }
259             cprof->intentStr = g_strdup( value );
261             if ( value ) {
262                 if ( strcmp( value, "auto" ) == 0 ) {
263                     cprof->rendering_intent = RENDERING_INTENT_AUTO;
264                 } else if ( strcmp( value, "perceptual" ) == 0 ) {
265                     cprof->rendering_intent = RENDERING_INTENT_PERCEPTUAL;
266                 } else if ( strcmp( value, "relative-colorimetric" ) == 0 ) {
267                     cprof->rendering_intent = RENDERING_INTENT_RELATIVE_COLORIMETRIC;
268                 } else if ( strcmp( value, "saturation" ) == 0 ) {
269                     cprof->rendering_intent = RENDERING_INTENT_SATURATION;
270                 } else if ( strcmp( value, "absolute-colorimetric" ) == 0 ) {
271                     cprof->rendering_intent = RENDERING_INTENT_ABSOLUTE_COLORIMETRIC;
272                 } else {
273                     cprof->rendering_intent = RENDERING_INTENT_UNKNOWN;
274                 }
275             } else {
276                 cprof->rendering_intent = RENDERING_INTENT_UNKNOWN;
277             }
279             object->requestModified(SP_OBJECT_MODIFIED_FLAG);
280             break;
282         default:
283             if (((SPObjectClass *) cprof_parent_class)->set) {
284                 (* ((SPObjectClass *) cprof_parent_class)->set)(object, key, value);
285             }
286             break;
287     }
291 /**
292  * Callback: write attributes to associated repr.
293  */
294 static Inkscape::XML::Node* Inkscape::colorprofile_write( SPObject *object, Inkscape::XML::Node *repr, guint flags )
296     ColorProfile *cprof = COLORPROFILE(object);
298     if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
299         Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
300         repr = xml_doc->createElement("svg:color-profile");
301     }
303     if ( (flags & SP_OBJECT_WRITE_ALL) || cprof->href ) {
304         repr->setAttribute( "xlink:href", cprof->href );
305     }
307     if ( (flags & SP_OBJECT_WRITE_ALL) || cprof->local ) {
308         repr->setAttribute( "local", cprof->local );
309     }
311     if ( (flags & SP_OBJECT_WRITE_ALL) || cprof->name ) {
312         repr->setAttribute( "name", cprof->name );
313     }
315     if ( (flags & SP_OBJECT_WRITE_ALL) || cprof->intentStr ) {
316         repr->setAttribute( "rendering-intent", cprof->intentStr );
317     }
319     if (((SPObjectClass *) cprof_parent_class)->write) {
320         (* ((SPObjectClass *) cprof_parent_class)->write)(object, repr, flags);
321     }
323     return repr;
327 #if ENABLE_LCMS
330 static SPObject* bruteFind( SPObject* curr, gchar const* name )
332     SPObject* result = 0;
334     if ( curr ) {
335         if ( IS_COLORPROFILE(curr) ) {
336             ColorProfile* prof = COLORPROFILE(curr);
337             if ( prof ) {
338                 if ( prof->name && (strcmp(prof->name, name) == 0) ) {
339                     result = curr;
340                 }
341             }
342         } else {
343             if ( curr->hasChildren() ) {
344                 SPObject* child = curr->firstChild();
345                 while ( child && !result ) {
346                     result = bruteFind( child, name );
347                     if ( !result ) {
348                         child = child->next;
349                     }
350                 };
351             }
352         }
353     }
355     return result;
358 cmsHPROFILE Inkscape::colorprofile_get_handle( SPDocument* document, guint* intent, gchar const* name )
360     cmsHPROFILE prof = 0;
362     SPObject* root = SP_DOCUMENT_ROOT(document);
363     SPObject* thing = bruteFind( root, name );
364     if ( thing ) {
365         prof = COLORPROFILE(thing)->profHandle;
366     }
368     if ( intent ) {
369         *intent = thing ? COLORPROFILE(thing)->rendering_intent : (guint)RENDERING_INTENT_UNKNOWN;
370     }
372 #ifdef DEBUG_LCMS
373     DEBUG_MESSAGE( lcmsThree, "<color-profile> queried for profile of '%s'. Returning %p with intent of %d", name, prof, (intent? *intent:0) );
374 #endif // DEBUG_LCMS
376     return prof;
380 #include <io/sys.h>
382 class ProfileInfo
384 public:
385     ProfileInfo( cmsHPROFILE, Glib::ustring const & path );
387     Glib::ustring const& getName() {return _name;}
388     Glib::ustring const& getPath() {return _path;}
389     icColorSpaceSignature getSpace() {return _profileSpace;}
390     icProfileClassSignature getClass() {return _profileClass;}
392 private:
393     Glib::ustring _path;
394     Glib::ustring _name;
395     icColorSpaceSignature _profileSpace;
396     icProfileClassSignature _profileClass;
397 };
400 ProfileInfo::ProfileInfo( cmsHPROFILE prof, Glib::ustring const & path )
402     _path = path;
403     _name = cmsTakeProductName(prof);
404     _profileSpace = cmsGetColorSpace( prof );
405     _profileClass = cmsGetDeviceClass( prof );
410 static std::vector<ProfileInfo> knownProfiles;
412 std::vector<Glib::ustring> Inkscape::colorprofile_get_display_names()
414     std::vector<Glib::ustring> result;
416     for ( std::vector<ProfileInfo>::iterator it = knownProfiles.begin(); it != knownProfiles.end(); ++it ) {
417         if ( it->getClass() == icSigDisplayClass && it->getSpace() == icSigRgbData ) {
418             result.push_back( it->getName() );
419         }
420     }
422     return result;
425 std::vector<Glib::ustring> Inkscape::colorprofile_get_softproof_names()
427     std::vector<Glib::ustring> result;
429     for ( std::vector<ProfileInfo>::iterator it = knownProfiles.begin(); it != knownProfiles.end(); ++it ) {
430         if ( it->getClass() == icSigOutputClass ) {
431             result.push_back( it->getName() );
432         }
433     }
435     return result;
438 Glib::ustring Inkscape::get_path_for_profile(Glib::ustring const& name)
440     Glib::ustring result;
442     for ( std::vector<ProfileInfo>::iterator it = knownProfiles.begin(); it != knownProfiles.end(); ++it ) {
443         if ( name == it->getName() ) {
444             result = it->getPath();
445             break;
446         }
447     }
449     return result;
452 static void findThings() {
453     std::list<gchar *> sources;
455     gchar* base = profile_path("XXX");
456     {
457         gchar* base2 = g_path_get_dirname(base);
458         g_free(base);
459         base = base2;
460         base2 = g_path_get_dirname(base);
461         g_free(base);
462         base = base2;
463     }
465     // first try user's local dir
466     sources.push_back( g_build_filename(g_get_user_data_dir(), "color", "icc", NULL) );
467     sources.push_back( g_build_filename(base, ".color", "icc", NULL) ); // OpenICC recommends to deprecate this
469     const gchar* const * dataDirs = g_get_system_data_dirs();
470     for ( int i = 0; dataDirs[i]; i++ ) {
471         sources.push_back(g_build_filename(dataDirs[i], "color", "icc", NULL));
472     }
474     while (!sources.empty()) {
475         gchar *dirname = sources.front();
476         if ( g_file_test( dirname, G_FILE_TEST_EXISTS ) && g_file_test( dirname, G_FILE_TEST_IS_DIR ) ) {
477             GError *err = 0;
478             GDir *dir = g_dir_open(dirname, 0, &err);
480             if (dir) {
481                 for (gchar const *file = g_dir_read_name(dir); file != NULL; file = g_dir_read_name(dir)) {
482                     gchar *filepath = g_build_filename(dirname, file, NULL);
485                     if ( g_file_test( filepath, G_FILE_TEST_IS_DIR ) ) {
486                         sources.push_back(g_strdup(filepath));
487                     } else {
488                         bool isIccFile = false;
489                         struct stat st;
490                         if ( g_stat(filepath, &st) == 0 && (st.st_size > 128) ) {
491                             //0-3 == size
492                             //36-39 == 'acsp' 0x61637370
493                             int fd = g_open( filepath, O_RDONLY, S_IRWXU);
494                             if ( fd != -1 ) {
495                                 guchar scratch[40] = {0};
496                                 size_t len = sizeof(scratch);
498                                 //size_t left = 40;
499                                 ssize_t got = read(fd, scratch, len);
500                                 if ( got != -1 ) {
501                                     size_t calcSize = (scratch[0] << 24) | (scratch[1] << 16) | (scratch[2] << 8) | scratch[3];
502                                     if ( calcSize > 128 && calcSize <= st.st_size ) {
503                                         isIccFile = (scratch[36] == 'a') && (scratch[37] == 'c') && (scratch[38] == 's') && (scratch[39] == 'p');
504                                     }
505                                 }
507                                 close(fd);
508                             }
509                         }
511                         if ( isIccFile ) {
512                             cmsHPROFILE prof = cmsOpenProfileFromFile( filepath, "r" );
513                             if ( prof ) {
514                                 ProfileInfo info( prof, Glib::filename_to_utf8( filepath ) );
515                                 cmsCloseProfile( prof );
517                                 bool sameName = false;
518                                 for ( std::vector<ProfileInfo>::iterator it = knownProfiles.begin(); it != knownProfiles.end(); ++it ) {
519                                     if ( it->getName() == info.getName() ) {
520                                         sameName = true;
521                                         break;
522                                     }
523                                 }
525                                 if ( !sameName ) {
526                                     knownProfiles.push_back(info);
527                                 }
528                             }
529                         }
530                     }
532                     g_free(filepath);
533                 }
534             }
535         }
537         // toss the dirname
538         g_free(dirname);
539         sources.pop_front();
540     }
543 int errorHandlerCB(int ErrorCode, const char *ErrorText)
545     g_message("lcms: Error %d; %s", ErrorCode, ErrorText);
547     return 1;
550 static bool gamutWarn = false;
551 static int lastIntent = INTENT_PERCEPTUAL;
552 static int lastProofIntent = INTENT_PERCEPTUAL;
553 static cmsHTRANSFORM transf = 0;
554 static cmsHPROFILE srcprof = 0;
556 cmsHPROFILE Inkscape::colorprofile_get_system_profile_handle()
558     static cmsHPROFILE theOne = 0;
559     static std::string lastURI;
561     static bool init = false;
562     if ( !init ) {
563         cmsSetErrorHandler(errorHandlerCB);
565         findThings();
566         init = true;
567     }
569     long long int which = prefs_get_int_attribute_limited( "options.displayprofile", "enable", 0, 0, 1 );
570     gchar const * uri = prefs_get_string_attribute("options.displayprofile", "uri");
572     if ( which && uri && *uri ) {
573         if ( lastURI != std::string(uri) ) {
574             lastURI.clear();
575             if ( theOne ) {
576                 cmsCloseProfile( theOne );
577             }
578             if ( transf ) {
579                 cmsDeleteTransform( transf );
580                 transf = 0;
581             }
582             theOne = cmsOpenProfileFromFile( uri, "r" );
583             if ( theOne ) {
584                 // a display profile must have the proper stuff
585                 icColorSpaceSignature space = cmsGetColorSpace(theOne);
586                 icProfileClassSignature profClass = cmsGetDeviceClass(theOne);
588                 if ( profClass != icSigDisplayClass ) {
589                     g_warning("Not a display profile");
590                     cmsCloseProfile( theOne );
591                     theOne = 0;
592                 } else if ( space != icSigRgbData ) {
593                     g_warning("Not an RGB profile");
594                     cmsCloseProfile( theOne );
595                     theOne = 0;
596                 } else {
597                     lastURI = uri;
598                 }
599             }
600         }
601     } else if ( theOne ) {
602         cmsCloseProfile( theOne );
603         theOne = 0;
604         lastURI.clear();
605         if ( transf ) {
606             cmsDeleteTransform( transf );
607             transf = 0;
608         }
609     }
611     return theOne;
615 cmsHPROFILE Inkscape::colorprofile_get_proof_profile_handle()
617     static cmsHPROFILE theOne = 0;
618     static std::string lastURI;
620     static bool init = false;
621     if ( !init ) {
622         cmsSetErrorHandler(errorHandlerCB);
624         findThings();
625         init = true;
626     }
628     long long int which = prefs_get_int_attribute_limited( "options.softproof", "enable", 0, 0, 1 );
629     gchar const * uri = prefs_get_string_attribute("options.softproof", "uri");
631     if ( which && uri && *uri ) {
632         if ( lastURI != std::string(uri) ) {
633             lastURI.clear();
634             if ( theOne ) {
635                 cmsCloseProfile( theOne );
636             }
637             if ( transf ) {
638                 cmsDeleteTransform( transf );
639                 transf = 0;
640             }
641             theOne = cmsOpenProfileFromFile( uri, "r" );
642             if ( theOne ) {
643                 // a display profile must have the proper stuff
644                 icColorSpaceSignature space = cmsGetColorSpace(theOne);
645                 icProfileClassSignature profClass = cmsGetDeviceClass(theOne);
647 /*
648                 if ( profClass != icSigDisplayClass ) {
649                     g_warning("Not a display profile");
650                     cmsCloseProfile( theOne );
651                     theOne = 0;
652                 } else if ( space != icSigRgbData ) {
653                     g_warning("Not an RGB profile");
654                     cmsCloseProfile( theOne );
655                     theOne = 0;
656                 } else {
657 */
658                     lastURI = uri;
659 /*
660                 }
661 */
662             }
663         }
664     } else if ( theOne ) {
665         cmsCloseProfile( theOne );
666         theOne = 0;
667         lastURI.clear();
668         if ( transf ) {
669             cmsDeleteTransform( transf );
670             transf = 0;
671         }
672     }
674     return theOne;
677 cmsHTRANSFORM Inkscape::colorprofile_get_display_transform()
679     bool warn = prefs_get_int_attribute_limited( "options.softproof", "gamutwarn", 0, 0, 1 );
680     int intent = prefs_get_int_attribute_limited( "options.displayprofile", "intent", 0, 0, 3 );
681     int proofIntent = prefs_get_int_attribute_limited( "options.softproof", "intent", 0, 0, 3 );
683     if ( (warn != gamutWarn) || (lastIntent != intent) || (lastProofIntent != proofIntent)) {
684         gamutWarn = warn;
685         if ( transf ) {
686             cmsDeleteTransform(transf);
687             transf = 0;
688         }
689         lastIntent = intent;
690         lastProofIntent = proofIntent;
691     }
693     // Fecth these now, as they might clear the transform as a side effect.
694     cmsHPROFILE hprof = Inkscape::colorprofile_get_system_profile_handle();
695     cmsHPROFILE proofProf = hprof ? Inkscape::colorprofile_get_proof_profile_handle() : 0;
697     if ( !transf ) {
698         if ( !srcprof ) {
699             srcprof = cmsCreate_sRGBProfile();
700         }
701         if ( hprof && proofProf ) {
702             DWORD dwFlags = cmsFLAGS_SOFTPROOFING;
703             if ( gamutWarn ) {
704                 dwFlags |= cmsFLAGS_GAMUTCHECK;
705             }
706             cmsSetAlarmCodes(0, 255, 0);
707             transf = cmsCreateProofingTransform( srcprof, TYPE_RGB_8, hprof, TYPE_RGB_8, proofProf, intent, proofIntent, dwFlags );
708         } else if ( hprof ) {
709             transf = cmsCreateTransform( srcprof, TYPE_RGB_8, hprof, TYPE_RGB_8, intent, 0 );
710         }
711     }
713     return transf;
716 #endif // ENABLE_LCMS
718 /*
719   Local Variables:
720   mode:c++
721   c-file-style:"stroustrup"
722   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
723   indent-tabs-mode:nil
724   fill-column:99
725   End:
726 */
727 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :