[Openicc] XICC specification draft

Craig Bradney cbradney at zip.com.au
Sat Jun 25 18:19:04 EST 2005


On Saturday 25 June 2005 09:54, Boudewijn Rempt wrote:
> On Friday 24 June 2005 22:32, Craig Bradney wrote:
> > On Friday 24 June 2005 22:00, Hubert Figuiere wrote:
> > > Sven Neumann wrote:
> > > > But
> > > > I am sure we will come up with some code that deals with all of this
> > > > and push it into GTK+ as gdk_screen_get_icc_profile().
> > >
> > > That would be a great as it would allow non X11 platform to implement
> > > it and have color correction.
> >
> > Does anyone know if Qt supports the required X11 calls? From some small
> > investigation by Craig Ringer and I, it doesnt look like it. So, for
> > Scribus, we will be using pure X11 then it seems. Hmm.
>
> I've already (with the help of Lubos Lunak) implemented this for krita as
> follows:
>
> #ifdef QT_WS_X11
>
> #include <X11/Xlib.h>
> #include <X11/Xatom.h>
> #include <lcms.h>
>
> #endif
>
>
> static KisProfileSP KisProfile::getScreenProfile (int screen)
> {
>
> #ifdef QT_WS_X11
>
> 	Display *dpy;
> 	Atom icc_atom, type;
> 	int format;
> 	long nitems;
> 	long bytes_after;
> 	unsigned char *str;
> 	int result;
>
> 	cmsHPROFILE *profile = NULL;
>
> 	static Atom icc_atom = XInternAtom( qt_xdisplay(), "_ICC_PROFILE", False
> );
>
> 	if  ( XGetWindowProperty ( qt_xdisplay(), qt_xrootwin( screen ), icc_atom,
> 0, INT_MAX, False, XA_CARDINAL, &type, &format, &nitems, &bytes_after,
> (unsigned char **)&str)) {
> 		if( nitems )
> 			profile = cmsOpenProfileFromMem(str, nitems);
> 		XFree (str);
> 		return new KisProfile(profile);
> 	} else {
> 		kdDebug() << "No profile, not correcting" << endl;
> 		return NULL;
> 	}
> #else
> 	return NULL;
> #endif;
> }
>
> The one thing I haven't done is setting krita up to receive notification of
> changes in the display profile, and I haven't decided whether I want Krita
> to use this by default and enable the user to override using the app
> settings, or whether I will disable the display profile setting in Krita's
> settings if the atom is set.

Very nice!
thanks heaps
Craig



More information about the openicc mailing list