Oyranos  git-devel
Oyranos is a full featured Color Management System
Public Member Functions | Data Fields
oyProfiles_s Struct Reference

Tell about the conversion profiles. More...

#include <oyProfiles_s.h>

Inheritance diagram for oyProfiles_s:
Inheritance graph
Collaboration diagram for oyProfiles_s:
Collaboration graph

Public Member Functions

OYAPI oyProfiles_s *OYEXPORT oyProfiles_New (oyObject_s object)
 allocate a new Profiles object More...
 
OYAPI oyProfiles_s *OYEXPORT oyProfiles_Copy (oyProfiles_s *profiles, oyObject_s object)
 Copy or Reference a Profiles object. More...
 
OYAPI int OYEXPORT oyProfiles_Release (oyProfiles_s **profiles)
 release and possibly deallocate a oyProfiles_s object More...
 
OYAPI int OYEXPORT oyProfiles_MoveIn (oyProfiles_s *list, oyProfile_s **obj, int pos)
 add an element to a Profiles list More...
 
OYAPI int OYEXPORT oyProfiles_ReleaseAt (oyProfiles_s *list, int pos)
 release a element from a Profiles list More...
 
OYAPI oyProfile_s *OYEXPORT oyProfiles_Get (oyProfiles_s *list, int pos)
 get a element of a Profiles list More...
 
OYAPI int OYEXPORT oyProfiles_Count (oyProfiles_s *list)
 count the elements in a Profiles list More...
 
OYAPI int OYEXPORT oyProfiles_Clear (oyProfiles_s *list)
 clear the elements in a Profiles list More...
 
OYAPI int OYEXPORT oyProfiles_Sort (oyProfiles_s *list, int32_t *rank_list)
 sort a list according to a rank_list More...
 
OYAPI oyProfiles_s *OYEXPORT oyProfiles_Create (oyProfiles_s *patterns, uint32_t flags, oyObject_s object)
 get a list of installed profiles More...
 
OYAPI oyProfiles_s *OYEXPORT oyProfiles_ForStd (oyPROFILE_e std_profile_class, uint32_t flags, int *current, oyObject_s object)
 Get a list of installed profiles. More...
 
int oyProfiles_DeviceRank (oyProfiles_s *list, oyConfig_s *device, int32_t *rank_list)
 Sort a profile list according to a given device. More...
 
OYAPI int OYEXPORT oyProfiles_Rank (oyProfiles_s *list, oyConfig_s *device, char path_separator, char key_separator, int flags, int32_t *rank_list)
 Sort a profile list according to a given pattern. More...
 
void oyProfiles_Release__Members (oyProfiles_s_ *profiles)
 Custom Profiles destructor. More...
 
int oyProfiles_Init__Members (oyProfiles_s_ *profiles OY_UNUSED)
 Custom Profiles constructor. More...
 
int oyProfiles_Copy__Members (oyProfiles_s_ *dst, oyProfiles_s_ *src)
 Custom Profiles copy constructor. More...
 
- Public Member Functions inherited from oyStruct_s
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...
 
- Data Fields inherited from oyStruct_s
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...
 

Detailed Description

Tell about the conversion profiles.

Note
This class holds a list of objects [list]
Version
Oyranos: x.x.x
Since
YYYY/MM/DD (Oyranos: x.x.x)
Date
YYYY/MM/DD
Examples:
image_display.cpp.

Member Function Documentation

◆ oyProfiles_Clear()

OYAPI int OYEXPORT oyProfiles_Clear ( oyProfiles_s list)

clear the elements in a Profiles list

Function oyProfiles_Clear

Parameters
[in,out]listthe list
Returns
0 - success; otherwise - error
Version
Oyranos: 0.3.0
Since
2011/02/01 (Oyranos: 0.3.0)
Date
2011/02/01

◆ oyProfiles_Copy()

OYAPI oyProfiles_s *OYEXPORT oyProfiles_Copy ( oyProfiles_s profiles,
oyObject_s  object 
)

Copy or Reference a Profiles object.

Function oyProfiles_Copy

The function is for copying and for referencing. The reference is the most often used way, which saves resourcs and time.

Parameters
[in]profilesProfiles struct object
objectNULL - means reference, the optional object triggers a real copy

◆ oyProfiles_Copy__Members()

int oyProfiles_Copy__Members ( oyProfiles_s_ *  dst,
oyProfiles_s_ *  src 
)

Custom Profiles copy constructor.

Function oyProfiles_Copy__Members

◆ oyProfiles_Count()

OYAPI int OYEXPORT oyProfiles_Count ( oyProfiles_s list)

count the elements in a Profiles list

Function oyProfiles_Count

Parameters
[in,out]listthe list
Returns
element count
Version
Oyranos: 0.1.10
Since
2010/07/05 (Oyranos: 0.1.10)
Date
2010/07/05

◆ oyProfiles_Create()

OYAPI oyProfiles_s *OYEXPORT oyProfiles_Create ( oyProfiles_s patterns,
uint32_t  flags,
oyObject_s  object 
)

get a list of installed profiles

Function oyProfiles_Create

Parameters
[in]patternsa list properties, e.g. classes; Only matching profiles are selected. If NULL, all profiles are accepted.
flags
objectthe optional object
Returns
the found and selected profiles
// Put all ICC Display Class profiles in "profiles"
icSignature profile_class = icSigDisplayClass;
oyProfile_s * pattern = 0;
oyProfiles_s * patterns = oyProfiles_New( 0 ),
profiles = 0;
uint32_t icc_profile_flags = oyICCProfileSelectionFlagsFromOptions(
OY_CMM_STD, "//" OY_TYPE_STD "/icc_color",
NULL, 0 );
// only display profiles
pattern = oyProfile_FromSignature( profile_class, oySIGNATURE_CLASS, 0 );
oyProfiles_MoveIn( patterns, &pattern, -1 );
// ... and only profiles installed in system paths
char * text = oyGetInstallPath( oyPATH_ICC, oySCOPE_SYSTEM, oyAllocateFunc_ );
pattern = oyProfile_FromFile( text, OY_NO_LOAD, NULL );
oyProfiles_MoveIn( patterns, &pattern, -1 );
profiles = oyProfiles_Create( patterns, icc_profile_flags, 0 );
oyProfiles_Release( &patterns );
Version
Oyranos: 0.9.6
Date
2014/08/31
Since
2008/06/20 (Oyranos: 0.1.8)

◆ oyProfiles_DeviceRank()

int oyProfiles_DeviceRank ( oyProfiles_s list,
oyConfig_s device,
int32_t *  rank_list 
)

Sort a profile list according to a given device.

Function oyProfiles_DeviceRank

Profiles which match the device will placed according to a rank value on top of the list followed by the zero ranked profiles.

// Get all ICC profiles, which can be used as assumed RGB profile
uint32_t icc_profile_flags = oyICCProfileSelectionFlagsFromOptions(
OY_CMM_STD, "//" OY_TYPE_STD "/icc_color",
NULL, 0 );
icc_profile_flags, 0,0 );
int32_t * rank_list = (int32_t*) malloc( oyProfiles_Count(p_list) *
sizeof(int32_t) );
// Sort the profiles according to eaches match to a given device
oyProfiles_DeviceRank( p_list, oy_device, rank_list );
n = oyProfiles_Count( p_list );
for(i = 0; i < n; ++i)
{
temp_prof = oyProfiles_Get( p_list, i );
// Show the rank value, the profile internal and file names on the command line
printf("%d %d: \"%s\" %s\n", rank_list[i], i,
oyProfile_GetText( temp_prof, oyNAME_DESCRIPTION ),
oyProfile_GetFileName(temp_prof, 0));
oyProfile_Release( &temp_prof );
}
Parameters
[in,out]listthe to be sorted profile list
[in]devicefilter pattern
[in,out]rank_listlist of rank levels for the profile list
Version
Oyranos: 0..1
Since
2009/05/22 (Oyranos: 0.1.10)
Date
2012/02/01

◆ oyProfiles_ForStd()

OYAPI oyProfiles_s *OYEXPORT oyProfiles_ForStd ( oyPROFILE_e  std_profile_class,
uint32_t  flags,
int *  current,
oyObject_s  object 
)

Get a list of installed profiles.

Function oyProfiles_ForStd

Allow for a special case with oyDEFAULT_PROFILE_START in the color_space argument, to select all possible standard color profiles, e.g. for typical color conversions.

oyASSUMED_WEB will result in exactly one profile added as long as it is available in the file paths.

Parameters
[in]std_profile_classstandard profile class, see oyPROFILE_e ; e.g. oyEDITING_RGB
flagssee oyProfile_FromFile()
[out]currentget the color_space profile position
objecta optional object
Returns
the profile list
Example - get all standard RGB profiles:
// Get all ICC profiles, which can be used as assumed RGB profile
int current = 0,
size, i;
oyProfile_s * temp_prof = 0;
oyProfiles_s * iccs = 0;
uint32_t icc_profile_flags = oyICCProfileSelectionFlagsFromOptions(
OY_CMM_STD, "//" OY_TYPE_STD "/icc_color",
NULL, 0 );
iccs = oyProfiles_ForStd( type, icc_profile_flags, &current, 0 );
size = oyProfiles_Count(iccs);
for( i = 0; i < size; ++i)
{
temp_prof = oyProfiles_Get( iccs, i );
// Show the profile internal and file names on the command line
printf("%s %d: \"%s\" %s\n", i == current ? "*":" ", i,
oyProfile_GetText( temp_prof, oyNAME_DESCRIPTION ),
oyProfile_GetFileName(temp_prof, -1));
oyProfile_Release( &temp_prof );
}
Version
Oyranos: 0.9.6
Date
2016/02/25
Since
2008/07/25 (Oyranos: 0.1.8)

◆ oyProfiles_Get()

OYAPI oyProfile_s *OYEXPORT oyProfiles_Get ( oyProfiles_s list,
int  pos 
)

get a element of a Profiles list

Function oyProfiles_Get

Parameters
[in,out]listthe list
posposition
Version
Oyranos: 0.1.10
Since
2010/07/05 (Oyranos: 0.1.10)
Date
2010/07/05

◆ oyProfiles_Init__Members()

int oyProfiles_Init__Members ( oyProfiles_s_ *profiles  OY_UNUSED)

Custom Profiles constructor.

Function oyProfiles_Init__Members

◆ oyProfiles_MoveIn()

OYAPI int OYEXPORT oyProfiles_MoveIn ( oyProfiles_s list,
oyProfile_s **  obj,
int  pos 
)

add an element to a Profiles list

Function oyProfiles_MoveIn

Parameters
[in]listlist
[in,out]objlist element
posposition
Version
Oyranos: 0.1.10
Since
2010/07/05 (Oyranos: 0.1.10)
Date
2010/07/05
Examples:
image_display.cpp.

◆ oyProfiles_New()

OYAPI oyProfiles_s *OYEXPORT oyProfiles_New ( oyObject_s  object)

allocate a new Profiles object

Function oyProfiles_New

Examples:
image_display.cpp.

◆ oyProfiles_Rank()

OYAPI int OYEXPORT oyProfiles_Rank ( oyProfiles_s list,
oyConfig_s device,
char  path_separator,
char  key_separator,
int  flags,
int32_t *  rank_list 
)

Sort a profile list according to a given pattern.

Function oyProfiles_Rank

Profiles which match the patern will placed according to a rank value on top of the list followed by the zero ranked profiles.

Get all ICC profiles, which can be used as assumed RGB profile:

// Get all ICC profiles, which can be used as assumed RGB profile
uint32_t icc_profile_flags = oyICCProfileSelectionFlagsFromOptions(
OY_CMM_STD, "//" OY_TYPE_STD "/icc_color",
NULL, 0 );
icc_profile_flags, 0,testobj );
int32_t * rank_list = (int32_t*) malloc( oyProfiles_Count(p_list) *
sizeof(int32_t) );
oyRankMap * rank_map = 0;
const char * rank_map_text = "{\"org\":{\"freedesktop\":{\"openicc\":{\"rank_map\":{\"meta\":[{\"STANDARD_space\": [2,-1,0,\"matching\",\"not matching\",\"key not found\"]}]}}}}}";
oyRankMapFromJSON( rank_map_text, NULL, &rank_map, malloc );
const char * filter_text = "{\"org\":{\"freedesktop\":{\"openicc\":{\"config\":{\"meta\":[{\"STANDARD_space\": \"rgb\"}]}}}}}",
* filter_registration = "org/freedesktop/openicc/config/meta";
oyConfig_s * config = NULL;
oyConfig_FromJSON( filter_registration, filter_text, 0,0, &config );
oyConfig_SetRankMap( config, rank_map );
oyRankMapRelease( &rank_map, free );
// Sort the profiles according to eaches match to a given device
oyProfiles_Rank( p_list, config, '/', ',', OY_MATCH_SUB_STRING |
int n = oyProfiles_Count( p_list );
if(verbose)
for(i = 0; i < n; ++i)
{
oyProfile_s * temp_prof = oyProfiles_Get( p_list, i );
// Show the rank value, the profile internal and file names on the command line
printf("%d %d: \"%s\" %s\n", rank_list[i], i,
oyProfile_GetText( temp_prof, oyNAME_DESCRIPTION ),
oyProfile_GetFileName(temp_prof, 0));
oyProfile_Release( &temp_prof );
} // Done print

Parameters
[in,out]listthe to be sorted profile list
[in]devicefilter pattern with rank_map
path_separatora char to split into hierarchical levels
key_separatora char to split key strings
flagsoptions:
  • OY_MATCH_SUB_STRING - find sub string; default is whole word match
[in,out]rank_listlist of rank levels for the profile list
Version
Oyranos: 0.9.7
Date
2017/01/05
Since
2017/01/05 (Oyranos: 0.9.7)

◆ oyProfiles_Release()

OYAPI int OYEXPORT oyProfiles_Release ( oyProfiles_s **  profiles)

release and possibly deallocate a oyProfiles_s object

Function oyProfiles_Release

Parameters
[in,out]profilesProfiles struct object

◆ oyProfiles_Release__Members()

void oyProfiles_Release__Members ( oyProfiles_s_ *  profiles)

Custom Profiles destructor.

Function oyProfiles_Release__Members

◆ oyProfiles_ReleaseAt()

OYAPI int OYEXPORT oyProfiles_ReleaseAt ( oyProfiles_s list,
int  pos 
)

release a element from a Profiles list

Function oyProfiles_ReleaseAt

Parameters
[in,out]listthe list
posposition
Version
Oyranos: 0.1.10
Since
2010/07/05 (Oyranos: 0.1.10)
Date
2010/07/05

◆ oyProfiles_Sort()

OYAPI int OYEXPORT oyProfiles_Sort ( oyProfiles_s list,
int32_t *  rank_list 
)

sort a list according to a rank_list

Function oyProfiles_Sort

Version
Oyranos: 0.3.0
Since
2011/02/01 (Oyranos: 0.3.0)
Date
2011/02/01

Field Documentation

◆ copy

oyStruct_Copy_f oyProfiles_s::copy

Copy function.

◆ oy_

oyObject_s oyProfiles_s::oy_

Oyranos internal object.

Features name and hash. Do not change during object life time.

◆ release

oyStruct_Release_f oyProfiles_s::release

Release function.

◆ type_

const oyOBJECT_e oyProfiles_s::type_

Type of object.

The struct type tells Oyranos how to interprete hidden fields.