[Openicc] google SoC starts
Boudewijn Rempt
boud at valdyas.org
Sun Feb 18 00:32:52 PST 2007
On Sunday 18 February 2007, Lars Borg wrote:
> Is there still no single standard for how to get it on Linux?
What I do for Krita, and what's as far as I know is also done in Gimp and a
couple of image viewers is something like this (where KisProfile is a wrapper
around an lcms profile that can be initialized with just the bytes):
KisProfile * KisProfile::getScreenProfile (int screen)
{
#ifdef Q_WS_X11
Atom type;
int format;
unsigned long nitems;
unsigned long bytes_after;
Q_UINT8 * str;
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)
) {
QByteArray bytes (nitems);
bytes.assign((char*)str, (Q_UINT32)nitems);
return new KisProfile(bytes);
} else {
return NULL;
}
#else
return NULL;
#endif
}
That's as standard as it comes and it should be in the create spec, together
with the default locations of icc profiles. What is missing is having a
control panel to set the property.
--
Boudewijn Rempt
http://www.valdyas.org/fading/index.cgi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/openicc/attachments/20070218/40665f93/attachment-0001.pgp
More information about the openicc
mailing list