| Oyranos Colour Management System API

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

Public Member Functions | Data Fields
oyProfiles_s Struct Reference
Profile API

Tell about the conversion profiles. More...

`#include <oyProfiles_s.h>`

Inheritance diagram for oyProfiles_s:
Collaboration diagram for oyProfiles_s:

## 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, oyObject_s object)
| get a list of installed profiles More...
OYAPI oyProfiles_s *OYEXPORT | oyProfiles_ForStd (oyPROFILE_e std_profile_class, 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...
Public Member Functions inherited from oyStruct_s
const char * | oyStruct_GetText (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags)
| get a text dump More...

## Data Fields

oyStruct_Copy_f | copy
oyStruct_Release_f | release
Data Fields inherited from oyStruct_s
oyStruct_Copy_f | copy
oyStruct_Release_f | release

## 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

## Member Function Documentation

OYAPI int OYEXPORT oyProfiles_Clear | ( | oyProfiles_s * | list | ) |

clear the elements in a Profiles list

Function oyProfiles_Clear

Parameters

  [in,out] | list | the list

Returns
  0 - success; otherwise - error

Version
  Oyranos: 0.3.0

Since
  2011/02/01 (Oyranos: 0.3.0)

Date
  2011/02/01

References oyOBJECT_PROFILES_S, and oyStructList_s::oyStructList_Clear().

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] | profiles | Profiles struct object
  | object | NULL - means reference, the optional object triggers a real copy

References oyOBJECT_PROFILES_S.

OYAPI int OYEXPORT oyProfiles_Count | ( | oyProfiles_s * | list | ) |

count the elements in a Profiles list

Function oyProfiles_Count

Parameters

  [in,out] | list | the list

Returns
  element count

Version
  Oyranos: 0.1.10

Since
  2010/07/05 (Oyranos: 0.1.10)

Date
  2010/07/05

References oyOBJECT_PROFILES_S, and oyStructList_s::oyStructList_Count().

Referenced by oyDeviceSetup(), oyFilterCore_s::oyFilterCore_GetText(), oyProfiles_Create(), oyProfiles_DeviceRank(), and oyProfiles_ForStd().

OYAPI oyProfiles_s *OYEXPORT oyProfiles_Create | ( | oyProfiles_s * | patterns,
|  | oyObject_s | object
| ) |  |

get a list of installed profiles

Function oyProfiles_Create

Parameters

  [in] | patterns | a list properties, e.g. classes; Only matching profiles are selected. If NULL, all profiles are accepted.
  | object | the 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;

    pattern = oyProfile_FromSignature( profile_class, oySIGNATURE_CLASS, 0 );
    oyProfiles_MoveIn( patterns, &pattern, -1 );

    profiles = oyProfiles_Create( patterns, 0 );
    oyProfiles_Release( &patterns );

Version
  Oyranos: 0.1.8

Since
  2008/06/20 (Oyranos: 0.1.8)

Date
  2008/06/20

References oyNAME_DESCRIPTION, oyProfile_s::oyProfile_FromFile(), oyProfile_s::oyProfile_GetText(), oyProfile_s::oyProfile_Release(), oyProfiles_Count(), oyProfiles_Get(), oyProfiles_MoveIn(), oyProfiles_New(), and oyProfiles_Release().

Referenced by oyDeviceSetup(), and oyProfiles_ForStd().

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
    oyProfiles_s * p_list = oyProfiles_ForStd( oyASSUMED_RGB, 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] | list | the to be sorted profile list
  [in] | device | filter pattern
  [in,out] | rank_list | list of rank levels for the profile list

Version
  Oyranos: 0..1

Since
  2009/05/22 (Oyranos: 0.1.10)

Date
  2012/02/01

References oyConfig_s::oyConfig_Compare(), oyConfig_s::oyConfig_FindString(), oyConfig_s::oyConfig_FromRegistration(), oyOBJECT_PROFILES_S, oyOptions_s::oyOptions_Clear(), oyOptions_s::oyOptions_Count(), oyProfile_s::oyProfile_GetDevice(), oyProfile_s::oyProfile_GetFileName(), oyProfile_s::oyProfile_Release(), oyProfiles_Count(), oyProfiles_Get(), and oyStructList_s::oyStructList_Sort().

Referenced by oyDeviceSetup().

OYAPI oyProfiles_s *OYEXPORT oyProfiles_ForStd | ( | oyPROFILE_e | std_profile_class,
|  | 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 colour_space argument, to select all possible standard colour profiles, e.g. for typical colour conversions.

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

Parameters

  [in] | std_profile_class | standard profile class, e.g. oyEDITING_RGB
  [out] | current | get the colour_space profile position
  | object | a optional object

Returns
  the profile list

Example - get all standard RGB profiles:

      // Get all ICC profiles, which can be used as assumed RGB profile
      oyPROFILE_e type = oyEDITING_RGB;
      int current = 0,
          size, i;
      oyProfile_s * temp_prof = 0;
      oyProfiles_s * iccs = 0;

      iccs = oyProfiles_ForStd( type, &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.1.8

Since
  2008/07/25 (Oyranos: 0.1.8)

Date
  2008/08/06

References oyGetDefaultProfileName(), oyProfile_s::oyProfile_FromSignature(), oyProfile_s::oyProfile_FromStd(), oyProfile_s::oyProfile_GetFileName(), oyProfile_s::oyProfile_Release(), oyProfile_s::oyProfile_SetSignature(), oyProfiles_Count(), oyProfiles_Create(), oyProfiles_Get(), oyProfiles_MoveIn(), oyProfiles_New(), oyProfiles_Release(), oySIGNATURE_CLASS, and oySIGNATURE_COLOUR_SPACE.

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

get a element of a Profiles list

Function oyProfiles_Get

Parameters

  [in,out] | list | the list
  | pos | position

Version
  Oyranos: 0.1.10

Since
  2010/07/05 (Oyranos: 0.1.10)

Date
  2010/07/05

References oyOBJECT_PROFILE_S, oyOBJECT_PROFILES_S, and oyStructList_s::oyStructList_GetRefType().

Referenced by oyDeviceSetup(), oyFilterCore_s::oyFilterCore_GetText(), oyProfiles_Create(), oyProfiles_DeviceRank(), and oyProfiles_ForStd().

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] | list | list
  [in,out] | obj | list element
  | pos | position

Version
  Oyranos: 0.1.10

Since
  2010/07/05 (Oyranos: 0.1.10)

Date
  2010/07/05

References oyOBJECT_PROFILE_S, oyOBJECT_PROFILES_S, oyStructList_s::oyStructList_Create(), and oyStructList_s::oyStructList_MoveIn().

Referenced by oyDeviceSetup(), oyProfiles_Create(), and oyProfiles_ForStd().

OYAPI oyProfiles_s *OYEXPORT oyProfiles_New | ( | oyObject_s | object | ) |

allocate a new Profiles object

Function oyProfiles_New

References oyOBJECT_OBJECT_S.

Referenced by oyDeviceSetup(), oyProfiles_Create(), and oyProfiles_ForStd().

OYAPI int OYEXPORT oyProfiles_Release | ( | oyProfiles_s ** | profiles | ) |

release and possibly deallocate a oyProfiles_s object

Function oyProfiles_Release

Parameters

  [in,out] | profiles | Profiles struct object

References oyOBJECT_PROFILES_S.

Referenced by oyDeviceSetup(), oyProfiles_Create(), and oyProfiles_ForStd().

OYAPI int OYEXPORT oyProfiles_ReleaseAt | ( | oyProfiles_s * | list,
|  | int | pos
| ) |  |

release a element from a Profiles list

Function oyProfiles_ReleaseAt

Parameters

  [in,out] | list | the list
  | pos | position

Version
  Oyranos: 0.1.10

Since
  2010/07/05 (Oyranos: 0.1.10)

Date
  2010/07/05

References oyOBJECT_PROFILES_S, oyStructList_s::oyStructList_GetParentObjType(), and oyStructList_s::oyStructList_ReleaseAt().

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

References oyOBJECT_PROFILES_S, and oyStructList_s::oyStructList_Sort().

## Field Documentation

oyStruct_Copy_f oyProfiles_s::copy

copy function

oyStruct_Release_f oyProfiles_s::release

release function