libxcm
Classes | Macros | Enumerations | Functions
X Color Management EDID data block parsing API's

XcmEdidParse.h. More...

Classes

struct  XcmEdid_s
 
union  XcmEdidValue_u
 
struct  XcmEdidKeyValue_s
 

Macros

#define XCM_EDID_KEY_VENDOR   "vendor"
 full length vendor, string
 
#define XCM_EDID_KEY_MODEL   "model"
 full length device model, string
 
#define XCM_EDID_KEY_SERIAL   "serial"
 full length device serial number, string
 
#define XCM_EDID_KEY_REDx   "red_x"
 colorimetric primary red CIE*xyY x component, double
 
#define XCM_EDID_KEY_REDy   "red_y"
 colorimetric primary red CIE*xyY y component, double
 
#define XCM_EDID_KEY_GREENx   "green_x"
 colorimetric primary green CIE*xyY x component, double
 
#define XCM_EDID_KEY_GREENy   "green_y"
 colorimetric primary green CIE*xyY y component, double
 
#define XCM_EDID_KEY_BLUEx   "blue_x"
 colorimetric primary blue CIE*xyY x component, double
 
#define XCM_EDID_KEY_BLUEy   "blue_y"
 colorimetric primary blue CIE*xyY y component, double
 
#define XCM_EDID_KEY_WHITEx   "white_x"
 colorimetric primary white CIE*xyY x component, double
 
#define XCM_EDID_KEY_WHITEy   "white_y"
 colorimetric primary white CIE*xyY y component, double
 
#define XCM_EDID_KEY_GAMMA   "gamma"
 colorimetric single gamma for all channels, double
 
#define XCM_EDID_KEY_WEEK   "week"
 manufactur week, integer
 
#define XCM_EDID_KEY_YEAR   "year"
 manufactur year, integer
 
#define XCM_EDID_KEY_MNFT_ID   "mnft_id"
 manufacturer ID, integer
 
#define XCM_EDID_KEY_MODEL_ID   "model_id"
 model ID, integer
 
#define XCM_EDID_KEY_MNFT   "mnft"
 manufacturer ID, string
 
#define XCM_EDID_KEY_MANUFACTURER   "manufacturer"
 full length manufacturer, string
 
#define XCM_EDID_KEY_A3RED   "a3red"
 transfer value for red component, double
 
#define XCM_EDID_KEY_A2RED   "a2red"
 transfer value for red component, double
 
#define XCM_EDID_KEY_A3GREEN   "a3green"
 transfer value for green component, double
 
#define XCM_EDID_KEY_A2GREEN   "a2green"
 transfer value for green component, double
 
#define XCM_EDID_KEY_A3BLUE   "a3blue"
 transfer value for blue component, double
 
#define XCM_EDID_KEY_A2BLUE   "a2blue"
 transfer value for blue component, double
 
#define SET_INT(key)
 
#define SET_DBL(key)
 
#define SET_TXT(key)
 
#define XCM_EDID_COLOUR_MATRIX_SINGLE_GAMMA   "colour_matrix.edid.redx_redy_greenx_greeny_bluex_bluey_whitex_whitey_gamma"
 
#define TRUE   1
 

Enumerations

enum  XCM_EDID_ERROR_e { XCM_EDID_OK, XCM_EDID_WRONG_SIGNATURE }
 
enum  XCM_EDID_VALUE_e { XCM_EDID_VALUE_TEXT, XCM_EDID_VALUE_INT, XCM_EDID_VALUE_DOUBLE }
 

Functions

XCM_EDID_ERROR_e XcmEdidParse (void *edid, XcmEdidKeyValue_s **list, int *count)
 Function XcmEdidParse. More...
 
XCM_EDID_ERROR_e XcmEdidFree (XcmEdidKeyValue_s **list)
 Function XcmEdidFree. More...
 
const char * XcmEdidErrorToString (XCM_EDID_ERROR_e error)
 Function XcmEdidErrorToString. More...
 
XCM_EDID_ERROR_e XcmEdidPrintString (void *edid, char **text, void *(*alloc)(size_t sz))
 Function XcmEdidPrintString. More...
 
XCM_EDID_ERROR_e XcmEdidPrintOpenIccJSON (void *edid, char **text, void *(*alloc)(size_t sz))
 Function XcmEdidPrintOpenIccJSON. More...
 
XCM_EDID_ERROR_e XcmEdidComposeString (void *edid, const char *key, char **text, void(*alloc)(size_t sz))
 

Detailed Description

XcmEdidParse.h.

The purpouse of this API is to obtain basic and displayable device identification strings and colorimetric informations contained in the EDID data block sent by monitors.

Xcm Xorg Colour Management

Copyright:
2005-2011 (C) Kai-Uwe Behrmann

EDID data block parsing

The user has to pass in a valid EDID block. This can be obtained per a root window X atom or a XRandR output property and is not part of this API. The data block is passed to XcmEdidParse(). This function generates a list of key value pairs, with some first rough interpretation. The key/values are useable for data bases, ICC profile generation or device identification. The returned XcmEdidKeyValue_s list elements can be individually read and worked with. Please look as well on the XcmEdidPrintString() function and examples/edid-parse/ as a small example on how to use the API. The XcmEdidPrintOpenIccJSON() will pull out a JSON data structure. XcmEdidFree() releases allocated list memory.

Macro Definition Documentation

◆ SET_DBL

#define SET_DBL (   key)
Value:
if(key) \
XcmEdidSetDouble( &(*list)[pos++], #key, key );

◆ SET_INT

#define SET_INT (   key)
Value:
if(key) \
XcmEdidSetInt( &(*list)[pos++], #key, key );

◆ SET_TXT

#define SET_TXT (   key)
Value:
if(key) \
XcmEdidSetText( &(*list)[pos++], #key, key );

Function Documentation

◆ XcmEdidErrorToString()

const char * XcmEdidErrorToString ( XCM_EDID_ERROR_e  error)

Function XcmEdidErrorToString.

convert enum into a meaningful text string

Parameters
[in]errorthe error
Returns
library owned error text string
Version
libXcm: 0.3.0
Since
2009/12/12 (libXcm: 0.3.0)
Date
2010/10/01

◆ XcmEdidFree()

XCM_EDID_ERROR_e XcmEdidFree ( XcmEdidKeyValue_s **  list)

Function XcmEdidFree.

free library allocated list

Parameters
[in,out]listthe key/value data structures
Returns
error code
Version
libXcm: 0.3.0
Since
2009/12/12 (libXcm: 0.3.0)
Date
2010/10/01

◆ XcmEdidParse()

XCM_EDID_ERROR_e XcmEdidParse ( void *  edid,
XcmEdidKeyValue_s **  list,
int *  count 
)

Function XcmEdidParse.

EDID to key/value pair transformation

The function performs no verification of the data block other than the first eight byte block signature.

Parameters
[in]edidEDID data block 128 or 256 bytes long
[out]listthe key/value data structures
[in,out]countpass in a pointer to a int. gives the number of elements in list
Returns
error code
Version
libXcm: 0.3.0
Since
2009/12/12 (libXcm: 0.3.0)
Date
2010/10/01

◆ XcmEdidPrintOpenIccJSON()

XCM_EDID_ERROR_e XcmEdidPrintOpenIccJSON ( void *  edid,
char **  text,
void *(*)(size_t sz)  alloc 
)

Function XcmEdidPrintOpenIccJSON.

convert a EDID block into a device configuration

Parameters
[in]edidthe EDID data block
[out]textthe resulting text string
[in]alloca user provided function to allocate text
Returns
error code
Version
libXcm: 0.4.2
Since
2011/06/19 (libXcm: 0.4.2)
Date
2011/06/19

◆ XcmEdidPrintString()

XCM_EDID_ERROR_e XcmEdidPrintString ( void *  edid,
char **  text,
void *(*)(size_t sz)  alloc 
)

Function XcmEdidPrintString.

convert a EDID block into text

Parameters
[in]edidthe EDID data block
[out]textthe resulting text string
[in]alloca user provided function to allocate text
Returns
error code
Version
libXcm: 0.3.0
Since
2009/12/12 (libXcm: 0.3.0)
Date
2010/10/01