![]() |
Oyranos
git-devel
Oyranos is a full featured Color Management System
|
A profile and its attributes. More...
#include <oyProfile_s.h>
Public Member Functions | |
OYAPI oyProfile_s *OYEXPORT | oyProfile_New (oyObject_s object) |
allocate a new Profile object More... | |
OYAPI oyProfile_s *OYEXPORT | oyProfile_Copy (oyProfile_s *profile, oyObject_s object) |
Copy or Reference a Profile object. More... | |
OYAPI int OYEXPORT | oyProfile_Release (oyProfile_s **profile) |
release and possibly deallocate a oyProfile_s object More... | |
OYAPI oyProfile_s *OYEXPORT | oyProfile_FromStd (oyPROFILE_e type, uint32_t flags, oyObject_s object) |
Create from default color space settings. More... | |
OYAPI oyProfile_s *OYEXPORT | oyProfile_FromName (const char *name, uint32_t flags, oyObject_s object) |
Create from name. More... | |
OYAPI oyProfile_s *OYEXPORT | oyProfile_FromFile (const char *name, uint32_t flags, oyObject_s object) |
Create from file. More... | |
OYAPI oyProfile_s *OYEXPORT | oyProfile_FromMem (size_t size, const oyPointer block, uint32_t flags, oyObject_s object) |
Create from in memory blob. More... | |
OYAPI oyProfile_s *OYEXPORT | oyProfile_FromSignature (icSignature sig, oySIGNATURE_TYPE_e type, oyObject_s object) |
Create a fractional profile from signature. More... | |
OYAPI oyProfile_s *OYEXPORT | oyProfile_FromMD5 (uint32_t *md5, uint32_t flags, oyObject_s object) |
Look up a profile from it's md5 hash sum. More... | |
OYAPI oyProfile_s *OYEXPORT | oyProfile_FromTaxiDB (oyOptions_s *options, oyObject_s object) |
look up a profile of a device from Taxi DB More... | |
OYAPI int OYEXPORT | oyProfile_Install (oyProfile_s *profile, oySCOPE_e scope, oyOptions_s *options) |
Install a ICC profile. More... | |
OYAPI int OYEXPORT | oyProfile_GetChannelsCount (oyProfile_s *profile) |
Number of channels in a color space. More... | |
OYAPI icSignature OYEXPORT | oyProfile_GetSignature (oyProfile_s *profile, oySIGNATURE_TYPE_e type) |
Get ICC color space signature. More... | |
OYAPI int OYEXPORT | oyProfile_SetSignature (oyProfile_s *profile, icSignature sig, oySIGNATURE_TYPE_e type) |
Set signature. More... | |
OYAPI void OYEXPORT | oyProfile_SetChannelNames (oyProfile_s *profile, oyObject_s *names_chan) |
Set channel names. More... | |
OYAPI const oyObject_s *OYEXPORT | oyProfile_GetChannelNames (oyProfile_s *profile) |
Get channel names. More... | |
OYAPI const char *OYEXPORT | oyProfile_GetChannelName (oyProfile_s *profile, int pos, oyNAME_e type) |
Get a channels name. More... | |
OYAPI const oyChar *OYEXPORT | oyProfile_GetID (oyProfile_s *profile) |
Get unique name. More... | |
OYAPI int OYEXPORT | oyProfile_Equal (oyProfile_s *profileA, oyProfile_s *profileB) |
Check if two profiles are equal by their hash sum. More... | |
OYAPI const oyChar *OYEXPORT | oyProfile_GetText (oyProfile_s *profile, oyNAME_e type) |
Get a presentable name. More... | |
OYAPI oyPointer OYEXPORT | oyProfile_GetMem (oyProfile_s *profile, size_t *size, uint32_t flag, oyAlloc_f allocateFunc) |
Get the ICC profile in memory. More... | |
OYAPI size_t OYEXPORT | oyProfile_GetSize (oyProfile_s *profile, uint32_t flag) |
Get the ICC profile in memory size. More... | |
OYAPI oyProfileTag_s *OYEXPORT | oyProfile_GetTagByPos (oyProfile_s *profile, int pos) |
Get a profile tag. More... | |
OYAPI oyProfileTag_s *OYEXPORT | oyProfile_GetTagById (oyProfile_s *profile, icTagSignature id) |
Get a profile tag by its tag signature. More... | |
OYAPI int OYEXPORT | oyProfile_GetTagCount (oyProfile_s *profile) |
OYAPI int OYEXPORT | oyProfile_TagMoveIn (oyProfile_s *profile, oyProfileTag_s **obj, int pos) |
Add a tag to a profile. More... | |
OYAPI int OYEXPORT | oyProfile_TagReleaseAt (oyProfile_s *profile, int pos) |
Remove a tag from a profile. More... | |
OYAPI int OYEXPORT | oyProfile_AddTagText (oyProfile_s *profile, icSignature signature, const char *text) |
Add a text tag. More... | |
OYAPI const char *OYEXPORT | oyProfile_GetFileName (oyProfile_s *profile, int dl_pos) |
Get the ICC profile location in the filesystem. More... | |
OYAPI int OYEXPORT | oyProfile_GetDevice (oyProfile_s *profile, oyConfig_s *device) |
Obtain device information from a profile. More... | |
int | oyProfile_GetMD5 (oyProfile_s *profile, int flags, uint32_t *md5) |
Get the ICC profile md5 hash sum. More... | |
int | oyProfile_AddDevice (oyProfile_s *profile, oyConfig_s *device, oyOptions_s *options) |
Add device and driver informations to a profile. More... | |
![]() | |
const char * | oyStruct_GetTextFromModule (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags) |
get object infos from a module More... | |
const char * | oyStruct_GetText (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags) |
Get a text dump. More... | |
int | oyStruct_RegisterStaticMessageFunc (int type, oyStruct_RegisterStaticMessageFunc_f msg, oyStruct_RegisterStaticFreeFunc_f free_func) |
register a function for verbosity More... | |
const char * | oyStruct_GetInfo (oyPointer context_object, oyNAME_e type, int flags) |
get a additional string from a object More... | |
const char * | oyStructTypeToText (oyOBJECT_e type) |
Objects type to small string. More... | |
Data Fields | |
const oyOBJECT_e | type_ |
Type of object. More... | |
oyStruct_Copy_f | copy |
Copy function. More... | |
oyStruct_Release_f | release |
Release function. More... | |
oyObject_s | oy_ |
Oyranos internal object. More... | |
![]() | |
const oyOBJECT_e | type_ |
Type of object. More... | |
oyStruct_Copy_f | copy |
Copy function. More... | |
oyStruct_Release_f | release |
Release function. More... | |
oyObject_s | oy_ |
Oyranos internal object. More... | |
A profile and its attributes.
int oyProfile_AddDevice | ( | oyProfile_s * | profile, |
oyConfig_s * | device, | ||
oyOptions_s * | options | ||
) |
Add device and driver informations to a profile.
Function oyProfile_AddDevice
oyProfile_AddDevice() is for storing device/driver informations in a ICC profile. So the profile can be sent over internet and Oyranos, or an other CMS, can better match to a device/driver on the new host. The convention what to place into the ICC profile is dependent on each device class and its actual driver or driver type. The meta data is stored in the ICC 'meta' tag of type 'dict'.
[in,out] | profile | the profile |
[in] | device | device and driver informations |
[in] | options | - "key_prefix_required" : prefix accept only key names with the prefix Separation by point '.' is allowed.
|
References oyConfig_s::oyConfig_FindString(), and oyOptions_s::oyOptions_FindString().
OYAPI int OYEXPORT oyProfile_AddTagText | ( | oyProfile_s * | profile, |
icSignature | signature, | ||
const char * | text | ||
) |
Add a text tag.
Function oyProfile_AddTagText
References oyProfile_GetSignature(), oySIGNATURE_VERSION, and oyValueUInt32().
OYAPI oyProfile_s *OYEXPORT oyProfile_Copy | ( | oyProfile_s * | profile, |
oyObject_s | object | ||
) |
Copy or Reference a Profile object.
Function oyProfile_Copy
The function is for copying and for referencing. The reference is the most often used way, which saves resourcs and time.
[in] | profile | Profile struct object |
object | NULL - means reference, the optional object triggers a real copy |
OYAPI int OYEXPORT oyProfile_Equal | ( | oyProfile_s * | profileA, |
oyProfile_s * | profileB | ||
) |
Check if two profiles are equal by their hash sum.
Function oyProfile_Equal
OYAPI oyProfile_s *OYEXPORT oyProfile_FromFile | ( | const char * | name, |
uint32_t | flags, | ||
oyObject_s | object | ||
) |
Create from file.
Function oyProfile_FromFile
Supported are profiles with absolute path names, profiles in OpenICC profile paths and profiles relative to the current working path. Search will occure in this order.
[in] | name | profile file name |
[in] | flags | OY_NO_CACHE_READ, OY_NO_CACHE_WRITE, OY_COMPUTE - compute ID, OY_NO_REPAIR |
[in] | object | the optional base |
flags supports
OYAPI oyProfile_s *OYEXPORT oyProfile_FromMD5 | ( | uint32_t * | md5, |
uint32_t | flags, | ||
oyObject_s | object | ||
) |
Look up a profile from it's md5 hash sum.
Function oyProfile_FromMD5
[in] | md5 | hash sum |
[in] | flags | flags are OY_NO_CACHE_READ, OY_NO_CACHE_WRITE, OY_COMPUTE
|
[in] | object | the optional base |
OYAPI oyProfile_s *OYEXPORT oyProfile_FromMem | ( | size_t | size, |
const oyPointer | block, | ||
uint32_t | flags, | ||
oyObject_s | object | ||
) |
Create from in memory blob.
Function oyProfile_FromMem
[in] | size | buffer size |
[in] | block | pointer to memory containing a profile |
[in] | flags | for future use |
[in] | object | the optional base |
OYAPI oyProfile_s *OYEXPORT oyProfile_FromName | ( | const char * | name, |
uint32_t | flags, | ||
oyObject_s | object | ||
) |
Create from name.
Function oyProfile_FromName
Supported are profiles with absolute path names, profiles in OpenICC profile paths and profiles relative to the current working path. Search will occure in this order. Hash names, internal descriptions and wildcards can be used.
[in] | name | name can be profile file name, ICC ID, wildcard or internal description. Following are some examples. A possible file name could be "sRGB.icc". A valid ICC ID would be "7fb30d688bf82d32a0e748daf3dba95d". A internal description could be "sRGB". Supported name wildcards are
|
[in] | flags | flags are OY_NO_CACHE_READ, OY_NO_CACHE_WRITE, OY_COMPUTE
|
[in] | object | the optional base |
OYAPI oyProfile_s *OYEXPORT oyProfile_FromSignature | ( | icSignature | sig, |
oySIGNATURE_TYPE_e | type, | ||
oyObject_s | object | ||
) |
Create a fractional profile from signature.
Function oyProfile_FromSignature
[in] | sig | signature |
[in] | type | type of signature to set |
[in] | object | the optional base |
OYAPI oyProfile_s *OYEXPORT oyProfile_FromStd | ( | oyPROFILE_e | type, |
uint32_t | flags, | ||
oyObject_s | object | ||
) |
Create from default color space settings.
Function oyProfile_FromStd
[in] | type | default color space |
[in] | flags | see -> oyProfile_FromFile() |
[in] | object | the optional base |
OYAPI oyProfile_s *OYEXPORT oyProfile_FromTaxiDB | ( | oyOptions_s * | options, |
oyObject_s | object | ||
) |
look up a profile of a device from Taxi DB
Function oyProfile_FromTaxiDB
The function asks the online ICC Taxi DB for a profile. It is therefore blocking and can cause a serious delay before returning.
The TAXI_id option is expected to come from oyConfig_GetBestMatchFromTaxiDB() or oyDevicesFromTaxiDB().
[in] | options | - "TAXI_id" shall provide a string for device driver parameter selection |
[in] | object | the optional object |
OYAPI const char *OYEXPORT oyProfile_GetChannelName | ( | oyProfile_s * | profile, |
int | pos, | ||
oyNAME_e | type | ||
) |
Get a channels name.
Function oyProfile_GetChannelName
A convinience function to get a single name with a certain type.
[in] | profile | address of a Oyranos named color structure |
[in] | pos | position of channel |
[in] | type | sort of text |
OYAPI const oyObject_s *OYEXPORT oyProfile_GetChannelNames | ( | oyProfile_s * | profile | ) |
Get channel names.
Function oyProfile_GetChannelNames
[in] | profile | the profile |
OYAPI int OYEXPORT oyProfile_GetChannelsCount | ( | oyProfile_s * | profile | ) |
Number of channels in a color space.
Function oyProfile_GetChannelsCount
Referenced by oyConnectorImaging_s::oyFilterSocket_MatchImagingPlug().
OYAPI int OYEXPORT oyProfile_GetDevice | ( | oyProfile_s * | profile, |
oyConfig_s * | device | ||
) |
Obtain device information from a profile.
Function oyProfile_GetDevice
[in] | profile | the profile |
[in,out] | device | the device description |
OYAPI const char *OYEXPORT oyProfile_GetFileName | ( | oyProfile_s * | profile, |
int | dl_pos | ||
) |
Get the ICC profile location in the filesystem.
Function oyProfile_GetFileName
This function tries to find a profile on disk matching a possibly memory only profile. In case the profile was previously opened from file or as a from Oyranos defaults the associated filename will simply be retuned.
profile | the profile |
dl_pos | -1, or the position in a device links source chain |
OYAPI const oyChar *OYEXPORT oyProfile_GetID | ( | oyProfile_s * | profile | ) |
Get unique name.
Function oyProfile_GetID
the returned string is identical to oyNAME_NICK
int oyProfile_GetMD5 | ( | oyProfile_s * | profile, |
int | flags, | ||
uint32_t * | md5 | ||
) |
Get the ICC profile md5 hash sum.
Function oyProfile_GetMD5
The ICC profiles ID is returned. On request it can be recomputed through the OY_COMPUTE flag. That computed ID will be used internally as a hash value. The original profile ID can always be obtained through the OY_FROM_PROFILE flags until writing of the profile.
[in,out] | profile | the profile |
[in] | flags |
|
[out] | md5 | the ICC md5 based profile ID |
OYAPI oyPointer OYEXPORT oyProfile_GetMem | ( | oyProfile_s * | profile, |
size_t * | size, | ||
uint32_t | flag, | ||
oyAlloc_f | allocateFunc | ||
) |
Get the ICC profile in memory.
Function oyProfile_GetMem
The prefered memory comes from the unmodified original memory. Otherwise a previously modified tag list is serialised into memory.
OYAPI icSignature OYEXPORT oyProfile_GetSignature | ( | oyProfile_s * | profile, |
oySIGNATURE_TYPE_e | type | ||
) |
Get ICC color space signature.
Function oyProfile_GetSignature
Referenced by oyCopyColor(), and oyProfile_AddTagText().
OYAPI size_t OYEXPORT oyProfile_GetSize | ( | oyProfile_s * | profile, |
uint32_t | flag | ||
) |
Get the ICC profile in memory size.
Function oyProfile_GetSize
The prefered memory comes from the unmodified original memory. Otherwise a previously modified tag list is serialised into memory.
OYAPI oyProfileTag_s *OYEXPORT oyProfile_GetTagById | ( | oyProfile_s * | profile, |
icTagSignature | id | ||
) |
Get a profile tag by its tag signature.
Function oyProfile_GetTagById
[in] | profile | the profile |
[in] | id | icTagSignature |
Referenced by oyProfile_FindMeta(), and oyProfile_GetWhitePoint().
OYAPI oyProfileTag_s *OYEXPORT oyProfile_GetTagByPos | ( | oyProfile_s * | profile, |
int | pos | ||
) |
Get a profile tag.
Function oyProfile_GetTagByPos
[in] | profile | the profile |
[in] | pos | header + tag position |
OYAPI int OYEXPORT oyProfile_GetTagCount | ( | oyProfile_s * | profile | ) |
Function oyProfile_GetTagCount
OYAPI const oyChar *OYEXPORT oyProfile_GetText | ( | oyProfile_s * | profile, |
oyNAME_e | type | ||
) |
Get a presentable name.
The type argument should select the following string in return:
OYAPI int OYEXPORT oyProfile_Install | ( | oyProfile_s * | profile, |
oySCOPE_e | scope, | ||
oyOptions_s * | options | ||
) |
Install a ICC profile.
Function oyProfile_Install
Without options, the ICC profile will be installed into the users ICC profile path. For obtaining a useful path name see Path Names.
[in] | profile | the profile |
[in] | scope | the scope to install to; default is oySCOPE_USER |
[in] | options |
|
1.1 add user profile path name by default or custom from "path" option
1.2 for "device" = "1" option add xxx/devices/device_class_description_xxx/
1.3 add ".icc" suffix as needed
3.1 write profile
OYAPI oyProfile_s *OYEXPORT oyProfile_New | ( | oyObject_s | object | ) |
allocate a new Profile object
Function oyProfile_New
OYAPI int OYEXPORT oyProfile_Release | ( | oyProfile_s ** | profile | ) |
release and possibly deallocate a oyProfile_s object
Function oyProfile_Release
[in,out] | profile | Profile struct object |
Referenced by oyConnectorImaging_s::oyFilterSocket_MatchImagingPlug().
OYAPI void OYEXPORT oyProfile_SetChannelNames | ( | oyProfile_s * | profile, |
oyObject_s * | names_chan | ||
) |
Set channel names.
Function oyProfile_SetChannelNames
The function should be used to specify extra channels or unusual color layouts like CMYKRB. The number of elements in names_chan should fit to the channels count or to the color space signature.
You can let single entries empty if they are understandable by the color space signature. Oyranos will set them for you on request.
[in] | profile | profile |
[in] | names_chan | pointer to channel names |
OYAPI int OYEXPORT oyProfile_SetSignature | ( | oyProfile_s * | profile, |
icSignature | sig, | ||
oySIGNATURE_TYPE_e | type | ||
) |
Set signature.
Function oyProfile_SetSignature
[in] | profile | the profile |
[in] | sig | signature |
[in] | type | type of signature to set |
OYAPI int OYEXPORT oyProfile_TagMoveIn | ( | oyProfile_s * | profile, |
oyProfileTag_s ** | obj, | ||
int | pos | ||
) |
Add a tag to a profile.
Function oyProfile_TagMoveIn
Initialise tag list.
Avoid double occurencies of tags.
OYAPI int OYEXPORT oyProfile_TagReleaseAt | ( | oyProfile_s * | profile, |
int | pos | ||
) |
Remove a tag from a profile.
Function oyProfile_TagReleaseAt
oyStruct_Copy_f oyProfile_s::copy |
Copy function.
oyObject_s oyProfile_s::oy_ |
Oyranos internal object.
Features name and hash. Do not change during object life time.
oyStruct_Release_f oyProfile_s::release |
Release function.
const oyOBJECT_e oyProfile_s::type_ |
Type of object.
The struct type tells Oyranos how to interprete hidden fields.