net-color spec 0.2 ==================== DRAFT 1 Revision History ------------------ Revision 0.1 2008-07-21 Tomas Carnecky initial incomplete spec for Color Management near X Draft for Revision 0.2 2010-05-16 Kai-Uwe Behrmann clearify XcolorRegion, add references, history, date and headers, remove XRandR, _NET_COLOR_MANAGEMENT and _NET_COLOR_PROFILES from this version, add _NET_COLOR_REGIONS and _NET_COLOR_DESKTOP Draft 2 Revision 0.2 2010-08-14 Kai-Uwe Behrmann add _ICC_DEVICE_PROFILE(_xxx) Introduction -------------- The net-color spec defines a protocol, which can be used by X11 clients to offload color correction and transformation into the compositing manager. The basic idea is to communicate client side regions to the X11 server. The regions can of this version have no ICC profile attached, which means a color server, typical in a compositing manager, shall not color manage these regions. These regions then are in the responsibility of the application. Color Region -------------- A color region is described by the following C structure: typedef struct { uint32_t region; /* window centric XserverRegion */ uint8_t md5[16]; /* ICC MD5 hash of the associated ICC profile */ } XcolorRegion; It defines a region and the attached color profile. Color regions are attached to windows and used by the compositing manager to apply the proper color transformation. Windows can have an unlimited amount of regions attached, though only the first 2 * 2^32 can be referenced. As of this spec the md5 shall be set to zero to signal the region is already color managed by the application. Atoms ------- _NET_COLOR_REGIONS: The atom is attached to windows and lists the XcolorRegion's defined for that specific window. The application is responsible to update the contained informations, e.g. on region resize or move inside the window. The type is XA_CARDINAL and values are stored in network byte order. _NET_COLOR_TARGET: Is attached to windows and specifies on which output the window should look correctly. The type is XA_STRING. _NET_COLOR_DESKTOP: The atom is attached on the root window to tell about a color servers activity. The content is of type XA_STRING and has four sections separated by a empty space char ' '. The _NET_COLOR_DESKTOP atom is a string with following usages: - uniquely identify the colour server - tell the name of the colour server - tell the colour server is alive All sections are separated by one space char ' ' for easy parsing. The first section contains the process id (pid_t) of the color server process, which has set the atom. The second section contains time since epoch GMT as returned by time(NULL). The thired section contains the bar '|' separated and surrounded capabilities: - NCP _NET_COLOR_PROFILES - NCT _NET_COLOR_TARGET - NCM _NET_COLOR_MANAGEMENT - NCR _NET_COLOR_REGIONS - V0.3 indicates version compliance to the _ICC_Profile in X spec The fourth section contains the servers name identifier. As of this specification the third section must contain NCR and the supported _ICC_PROFILE in X version. NCT is optional. A example of a valid atom might look like: _NET_COLOR_DESKTOP(STRING) = "4518 1274001512 |NCR|V0.3| compiz_colour_desktop" _ICC_DEVICE_PROFILE(_xxx): The atom will hold a native ICC profile with the exposed device characteristics at the compositing window manager level. The colour server shall if no _ICC_DEVICE_PROFILE(_xxx) is set, copy the _ICC_PROFILE(_xxx) profiles to each equivalent _ICC_DEVICE_PROFILE(_xxx) atom. The _ICC_PROFILE(_xxx) profiles shall be replaced by a sRGB ICC profile. The counting in the atoms (_xxx) name section follows the rules outlined in the ICC Profile in X recommendation. After finishing the session the the old state has to be recovered by copying any _ICC_DEVICE_PROFILE(_xxx) atoms content into the appropriate _ICC_PROFILE(_xxx) atoms and removing all _ICC_DEVICE_PROFILE(_xxx) atoms. The colour server must be aware about change property events indicating that a _ICC_PROFILE(_xxx) atom has changed by a external application and needs to move that profile to the appropriate _ICC_DEVICE_PROFILE(_xxx) atom and set the _ICC_PROFILE(_xxx) atom to sRGB as well. The modification of the _ICC_DEVICE_PROFILE(_xxx) atoms by external applications is undefined. Discussion ------------ Elder desktop applications might not be aware of the capabilities exposed through a implementation of this recommendation. Thus a way is needed to enshure backward compatibility. The _ICC_DEVICE_PROFILE(_xxx) atom provides a means to expose capable clients the desired information about the monitor characteristics at the discussed level. The _ICC_PROFILE(_xxx) atom is maintained to enshure the desired backward compatibility. Screenshot tools should use the _ICC_DEVICE_PROFILE(_xxx) to convert the _NET_COLOR_REGIONS to sRGB. A advanced feature is to offer a different target than the sRGB colour space. The first monitors colour space or a colour space covering all used devices can be used to convert the color regions image to. References ------------ 1. X window system (hhtp://www.x.org) 2. International Color Consortium (http://www.color.org) 3. _ICC_Profile in X (http://www.freedesktop.org/wiki/Specifications/icc_profiles_in_x_spec) 4. Xcolor reference implementation (git clone git://www.oyranos.org/git/xcolor) 5. CompIcc colour server for compiz (http://sourceforge.net/apps/mediawiki/compicc/index.php?title=Main_Page) 6. xcmsevents monitor tool (git clone git://www.oyranos.org/git/oyranos) 2008 (c) Tomas Carnecky, 2010 (c) Kai-Uwe Behrmann