![]() |
Oyranos Colour Management System API |
Hardware detection and profile selection for monitors. More...
Functions | |
int | oyGetMonitorInfo (const char *display_name, char **manufacturer, char **model, char **serial, char **system_port, char **display_geometry, oyBlob_s **edid, oyAlloc_f allocate_func) |
brief pick up monitor information with Xlib More... | |
int | oyGetScreenFromPosition (const char *display_name, int x, int y) |
screen number from position More... | |
char * | oyGetDisplayNameFromPosition2 (const char *device_type, const char *device_class, const char *display_name, int x, int y, oyAlloc_f allocateFunc) |
display name from position More... | |
char * | oyGetDisplayNameFromPosition (const char *display_name, int x, int y, oyAlloc_f allocateFunc) |
display name from position More... | |
char * | oyGetMonitorProfile (const char *device_name, size_t *size, oyAlloc_f allocate_func) |
get the monitor profile from the server More... | |
char * | oyMonitorProfileNameFromDB (oyConfig_s *device, oyAlloc_f allocateFunc) |
get the monitor profile filename from the device database More... | |
char * | oyGetMonitorProfileNameFromDB (const char *display_name, oyAlloc_f allocateFunc) |
get the monitor profile filename from the device profile database More... | |
int | oySetMonitorProfile (const char *display_name, const char *profile_name) |
set the monitor profile by filename More... | |
int | oyActivateMonitorProfiles (const char *display_name) |
activate the monitor using the stored configuration More... | |
Hardware detection and profile selection for monitors.
The notation of screens for the X Window system is equal for traditional and Xinerama screens.
The X11 libraries will be loaded at runtime.
The functions can be studied by looking at the oyranos-monitor utiliy. The code for that tool is in oyranos_gamma.c .
int oyActivateMonitorProfiles | ( | const char * | display_name | ) |
activate the monitor using the stored configuration
Function: oyActivateMonitorProfiles
Activate in case the appropriate profile is not yet setup in the server.
To deactivate a profile in the server call oySetMonitorProfile( device_name, 0 ).
display_name | the device string |
References oyConfig_s::oyConfig_Release(), oyConfigs_s::oyConfigs_Count(), oyConfigs_s::oyConfigs_FromDeviceClass(), oyConfigs_s::oyConfigs_Get(), oyConfigs_s::oyConfigs_Release(), oyOptions_s::oyOptions_Release(), and oyOptions_s::oyOptions_SetFromText().
char* oyGetDisplayNameFromPosition | ( | const char * | display_name, |
int | x, | ||
int | y, | ||
oyAlloc_f | allocateFunc | ||
) |
display name from position
Function: oyGetDisplayNameFromPosition This function will hit exact results only with Xinerama.
display_name | raw display string |
x | x position on screen |
y | y position on screen |
allocateFunc | function used to allocate memory for the string |
we want a fuzzy look at our display, not the narrow "device_name"
References oyConfig_s::oyConfig_Find(), oyConfig_s::oyConfig_FindString(), oyConfig_s::oyConfig_Release(), oyConfigs_s::oyConfigs_Count(), oyConfigs_s::oyConfigs_FromDeviceClass(), oyConfigs_s::oyConfigs_Get(), oyConfigs_s::oyConfigs_Release(), oyOBJECT_RECTANGLE_S, oyOption_s::oyOption_GetStruct(), oyOptions_s::oyOptions_Release(), oyOptions_s::oyOptions_SetFromText(), and oyRectangle_s::oyRectangle_PointIsInside().
char* oyGetDisplayNameFromPosition2 | ( | const char * | device_type, |
const char * | device_class, | ||
const char * | display_name, | ||
int | x, | ||
int | y, | ||
oyAlloc_f | allocateFunc | ||
) |
display name from position
Function: oyGetDisplayNameFromPosition2 This function will hit exact results only with Xinerama.
[in] | device_type | the device type, e.g. OY_TYPE_STD, defaults to OY_TYPE_STD (optional) |
[in] | device_class | registration oyFILTER_REG_APPLICATION part, e.g. "monitor", mandatory |
display_name | raw display string | |
x | x position on screen | |
y | y position on screen | |
allocateFunc | function used to allocate memory for the string |
we want a fuzzy look at our display, not the narrow "device_name"
References oyConfig_s::oyConfig_Find(), oyConfig_s::oyConfig_FindString(), oyConfig_s::oyConfig_Release(), oyConfigs_s::oyConfigs_Count(), oyConfigs_s::oyConfigs_FromDeviceClass(), oyConfigs_s::oyConfigs_Get(), oyConfigs_s::oyConfigs_Release(), oyOBJECT_RECTANGLE_S, oyOption_s::oyOption_GetStruct(), oyOptions_s::oyOptions_Release(), oyOptions_s::oyOptions_SetFromText(), and oyRectangle_s::oyRectangle_PointIsInside().
int oyGetMonitorInfo | ( | const char * | display_name, |
char ** | manufacturer, | ||
char ** | model, | ||
char ** | serial, | ||
char ** | system_port, | ||
char ** | display_geometry, | ||
oyBlob_s ** | edid, | ||
oyAlloc_f | allocate_func | ||
) |
brief pick up monitor information with Xlib
Function: oyGetMonitorInfo
display_name | the display string | |
[out] | manufacturer | the manufacturer of the monitor device |
[out] | model | the model of the monitor device |
[out] | serial | the serial number of the monitor device |
[out] | system_port | the system port name the monitor device is connectted to |
[out] | display_geometry | the display geometry description of the monitor |
[out] | edid | the edid data blob of the monitor device |
allocate_func | the allocator for the above strings |
char* oyGetMonitorProfile | ( | const char * | device_name, |
size_t * | size, | ||
oyAlloc_f | allocate_func | ||
) |
get the monitor profile from the server
Function: oyGetMonitorProfile
device_name | the display string | |
[out] | size | the size of profile |
allocate_func | function used to allocate memory for the profile |
References oyConfig_s::oyConfig_Release(), and oyProfile_s::oyProfile_GetMem().
char* oyGetMonitorProfileNameFromDB | ( | const char * | display_name, |
oyAlloc_f | allocateFunc | ||
) |
get the monitor profile filename from the device profile database
Function: oyGetMonitorProfileNameFromDB
display_name | the display string |
allocateFunc | function used to allocate memory for the string |
References oyConfig_s::oyConfig_Release(), oyOptions_s::oyOptions_Release(), and oyProfile_s::oyProfile_Release().
int oyGetScreenFromPosition | ( | const char * | display_name, |
int | x, | ||
int | y | ||
) |
screen number from position
Function: oyGetScreenFromPosition
This function will hit exact results only with Xinerama.
a platform specific function
display_name | the display string |
x | x position on screen |
y | y position on screen |
char* oyMonitorProfileNameFromDB | ( | oyConfig_s * | device, |
oyAlloc_f | allocateFunc | ||
) |
get the monitor profile filename from the device database
Function: oyMonitorProfileNameFromDB
device | the device |
allocateFunc | user function used to allocate memory |
References oyProfile_s::oyProfile_Release().
int oySetMonitorProfile | ( | const char * | display_name, |
const char * | profile_name | ||
) |
set the monitor profile by filename
Function: oySetMonitorProfile
The profile_name argument does two things. Set to zero the function solely unsets the graphic card luts and the server stored profile. So pretty all server side information should go away.
With a profile name given the function will lookup the monitor in the Oyranos device database and stores the given profile there.
To sum up, to set a new profile please call the following sequence:
// store new settings in the Oyranos data base oySetMonitorProfile( display_name, profile_name ); // remove the server entries oySetMonitorProfile( display_name, 0 ); // update the window server from the newly Oyranos data base settings oyActivateMonitorProfiles( display_name );
display_name | the display string |
profile_name | the file to use as monitor profile or 0 to unset |
1.1 add "properties" call to module arguments
1.2 get monitor device
References oyConfig_s::oyConfig_Release(), oyOptions_s::oyOptions_Release(), and oyOptions_s::oyOptions_SetFromText().