Oyranos  0.9.7
Oyranos is a full featured Color Management System
Modules | Macros | Typedefs | Functions
ICC profiler API

Easy to use API to generate matrix and LUT ICC profiles. More...

Collaboration diagram for ICC profiler API:

Modules

 Samplers
 

Macros

#define LCM2PROFILER_MAJOR   1
 major version More...
 
#define LCM2PROFILER_MINOR   0
 minor version More...
 
#define LCM2PROFILER_MICRO   0
 patch version More...
 
#define LCM2PROFILER_API   (LCM2PROFILER_MAJOR*10000 + LCM2PROFILER_MINOR*100 + LCM2PROFILER_MICRO)
 compile time API Version More...
 
#define ICC_2011_LICENSE   "This profile is made available by %s, with permission of %s, and may be copied, distributed, embedded, made, used, and sold without restriction. Altered versions of this profile shall have the original identification and copyright information removed and shall not be misrepresented as the original profile."
 ICC 2011 license template. More...
 

Typedefs

typedef void(* lcm2Sampler_f) (const double i[], double o[], void *vars)
 Manipulation function type. More...
 

Functions

cmsHPROFILE lcm2OpenProfileFile (const char *my_space_profile, const char *my_space_profile_path)
 Open a profile from file. More...
 
char * lcm2WriteProfileToFile (cmsHPROFILE my_space_profile, const char *my_space_profile_name, const char *my_space_profile_version, const char *vendor_four_bytes)
 Write a profile to a file. More...
 
void * lcm2WriteProfileToMem (cmsHPROFILE *profile, size_t *size, void *(*allocateFunc)(size_t size))
 
int lcm2CreateProfileLutByFunc (cmsHPROFILE profile, lcm2Sampler_f samplerMySpace, void *samplerArg, const char *in_space_profile, const char *my_space_profile, const char *out_space_profile, int grid_size, cmsTagSignature tag_sig)
 Generate a ICC profile LUT. More...
 
int lcm2CreateProfileLutByFuncAndCurves (cmsHPROFILE profile, lcm2Sampler_f samplerMySpace, void *samplerArg, cmsToneCurve *in_curves[], cmsToneCurve *out_curves[], const char *in_space_profile, const char *my_space_profile, const char *out_space_profile, int grid_size, cmsTagSignature tag_sig)
 Generate a ICC profile LUT. More...
 
int lcm2CreateAbstractProfile (lcm2Sampler_f samplerMySpace, void *samplerArg, const char *my_space_profile, int grid_size, double icc_profile_version, const char *my_abstract_description, const char **my_abstract_descriptions, const char *my_abstract_file_name, const char *provider, const char *vendor, const char *my_license, const char *device_model, const char *device_manufacturer, const char **my_meta_data, cmsHPROFILE *h_profile)
 Create a effect profile of type abstract in ICC*Lab PCS. More...
 
int lcm2CreateAbstractTemperatureProfile (float kelvin, cmsHPROFILE source_white_profile, int grid_size, double icc_profile_version, char **my_abstract_file_name, cmsHPROFILE *h_profile)
 Create a effect profile of type abstract in ICC*Lab PCS from Kelvin. More...
 
int lcm2CreateAbstractWhitePointProfileLab (double cie_a, double cie_b, int grid_size, double icc_profile_version, char **my_abstract_file_name, cmsHPROFILE *h_profile)
 Create a effect profile of type abstract in ICC*Lab PCS for white point adjustment. More...
 
int lcm2CreateAbstractWhitePointProfileBradford (double *src_iccXYZ, double *illu_iccXYZ, int grid_size, double icc_profile_version, char **my_abstract_file_name, cmsHPROFILE *h_profile)
 Create a effect profile of type abstract in ICC*Lab PCS for white point adjustment. More...
 
cmsHPROFILE lcm2CreateProfileFragment (const char *in_space_profile, const char *out_space_profile, double icc_profile_version, const char *my_abstract_description, const char *provider, const char *vendor, const char *my_license, const char *device_model, const char *device_manufacturer, cmsHPROFILE h_profile)
 Create a color profile starter. More...
 
void lcm2AddMluDescription (cmsHPROFILE profile, const char *texts[], cmsTagSignature tag_sig)
 Add translated texts to a profile. More...
 
void lcm2AddMetaTexts (cmsHPROFILE profile, const char *prefixes, const char *key_value[], cmsTagSignature tag_sig)
 Add meta data to a profile. More...
 
cmsHPROFILE lcm2CreateICCMatrixProfile2 (float gamma, float rx, float ry, float gx, float gy, float bx, float by, float wx, float wy)
 Create a profile from primaries, white point and one gamma value. More...
 
int lcm2MessageFunc (int code OY_UNUSED, const void *context_object OY_UNUSED, const char *format,...)
 default message function to console More...
 
int lcm2MessageFuncSet (lcm2Message_f message_func)
 set a custom message function More...
 
int lcm2Version ()
 run time API version More...
 

Detailed Description

Easy to use API to generate matrix and LUT ICC profiles.

Oyranos ICC Profiler API provides a platformindependent C interface to generate ICC profiles. It's main purpose is to generate ICC Profiles in a programatic way. The only dependency is littleCMS 2 www.littlecms.com. It reduces the need of many of the lcms2 boilerplate for format independent sampling, multi localised strings from UTF8 and more. The sampler collection contains effects and color space converters. The code consists of one source file and a header. So it can easily be placed inside your project.

API Documentation

The Oyranos ICC Profiler API is contained in the lcm2_profiler.h header file.

The high level API takes few arguments and generates a profile in one go. Effect profiles can be created in one call by lcm2CreateAbstractProfile(). It needs a Samplers function, which fills the Look Up Table (LUT). Two APIs exist to generate white point effects, lcm2CreateAbstractTemperatureProfile() and lcm2CreateAbstractWhitePointProfileLab() or lcm2CreateAbstractWhitePointProfileBradford(). These above high level APIs allow to write the profile to disc in one go.

The lower level APIs can be used to customise the profile generation. Basic matrix/shaper profiles can be created with lcm2CreateICCMatrixProfile2() and filled with custom texts in lcm2CreateProfileFragment().

The following low level code sample comes from lcm2_profiler.c. The code sets up a basic profile description and color spaces:

// prepare some variables
double icc_profile_version = 2.3;
double icc_ab[2] = {0.0, 0.0};
cmsHPROFILE profile;
const char * kelvin_name = "5000 K"
int error;
int grid_size = 17;
cmsToneCurve * i_curve[3] = {NULL,NULL,NULL}, * o_curve[3] = {NULL,NULL,NULL};
i_curve[0] = o_curve[0] = cmsBuildGamma(0, 1.0);
for(i = 1; i < 3; ++i) { i_curve[i] = o_curve[i] = i_curve[0]; }
/* profile fragment creation */
"*lab", // CIE*Lab
"*lab", // CIE*Lab
icc_profile_version,
kelvin_name,
"Oyranos project 2017",
"Kai-Uwe Behrmann",
"CIE*Lab",
"http://www.cie.co.at",
NULL);
if(!profile) error = 1;
if(!error)
o_curve, i_curve,
"*lab", "*lab", "*lab",
grid_size, cmsSigAToB0Tag );
#define ICC_2011_LICENSE
ICC 2011 license template.
Definition: lcm2_profiler.h:29
int lcm2CreateProfileLutByFuncAndCurves(cmsHPROFILE profile, lcm2Sampler_f samplerMySpace, void *samplerArg, cmsToneCurve *in_curves[], cmsToneCurve *out_curves[], const char *in_space_profile, const char *my_space_profile, const char *out_space_profile, int grid_size, cmsTagSignature tag_sig)
Generate a ICC profile LUT.
Definition: lcm2_profiler.c:1154
cmsHPROFILE lcm2CreateProfileFragment(const char *in_space_profile, const char *out_space_profile, double icc_profile_version, const char *my_abstract_description, const char *provider, const char *vendor, const char *my_license, const char *device_model, const char *device_manufacturer, cmsHPROFILE h_profile)
Create a color profile starter.
Definition: lcm2_profiler.c:1883
void lcm2SamplerWhitePointLab(const double i[], double o[], void *data)
Lab -> White Point Adaption -> Lab.
Definition: lcm2_profiler.c:840

Profile i/o happens with lcm2OpenProfileFile(), which takes file names and a few wildcards as arguments. lcm2WriteProfileToFile() helps writing of canonical profile names. lcm2WriteProfileToMem() writes a profile to a custom memory allocator.

Most of the functions come with examples.

Macro Definition Documentation

◆ ICC_2011_LICENSE

#define ICC_2011_LICENSE   "This profile is made available by %s, with permission of %s, and may be copied, distributed, embedded, made, used, and sold without restriction. Altered versions of this profile shall have the original identification and copyright information removed and shall not be misrepresented as the original profile."

ICC 2011 license template.

Examples
lcm2_profiler.c.

◆ LCM2PROFILER_API

#define LCM2PROFILER_API   (LCM2PROFILER_MAJOR*10000 + LCM2PROFILER_MINOR*100 + LCM2PROFILER_MICRO)

compile time API Version

Examples
lcm2_profiler.c.

◆ LCM2PROFILER_MAJOR

#define LCM2PROFILER_MAJOR   1

major version

◆ LCM2PROFILER_MICRO

#define LCM2PROFILER_MICRO   0

patch version

◆ LCM2PROFILER_MINOR

#define LCM2PROFILER_MINOR   0

minor version

Typedef Documentation

◆ lcm2Sampler_f

typedef void(* lcm2Sampler_f) (const double i[], double o[], void *vars)

Manipulation function type.

A pure function based sampler in double precission. i and o can be in different color spaces.

Examples
lcm2_profiler.c.

Function Documentation

◆ lcm2AddMetaTexts()

void lcm2AddMetaTexts ( cmsHPROFILE  profile,
const char *  prefixes,
const char *  key_value[],
cmsTagSignature  tag_sig 
)

Add meta data to a profile.

Function lcm2AddMetaTexts

Iterates over the provided string list converts from "UTF-8" input to "WCHAR_T" for lcms and does byteswapping on little endian machines.

Here a code example:

const char * texts[] = {
"GROUP_key1", "value1",
"DOMAIN_key2", "value2"
};
lcm2AddMetaTexts ( profile, "GROUP_,DOMAIN_", texts,
cmsSigMetaTag
);
void lcm2AddMetaTexts(cmsHPROFILE profile, const char *prefixes, const char *key_value[], cmsTagSignature tag_sig)
Add meta data to a profile.
Definition: lcm2_profiler.c:2268

A prefix allows for grouping of keys like "EDID_" or "EXIF_". The prefix part might be cut off in some cases to access an other level of keys. Think of "EDID_model" for monitors and "EXIF_model" for cameras, which both represent the key "model" concept.

Parameters
[in,out]profilecolor profile
[in]prefixesThe used uppercase prefix list.
[in]key_valuekey + value list
[in]tag_sigsignature
Version
Oyranos: 0.9.7
Date
2017/02/11
Since
2017/02/11 (Oyranos: 0.9.7)
Examples
lcm2_profiler.c.

Referenced by lcm2CreateAbstractProfile().

◆ lcm2AddMluDescription()

void lcm2AddMluDescription ( cmsHPROFILE  profile,
const char *  texts[],
cmsTagSignature  tag_sig 
)

Add translated texts to a profile.

Function lcm2AddMluDescription

Iterates over the provided string list converts from "UTF-8" input to "WCHAR_T" for lcms and does byteswapping on little endian machines.

Here a code example:

const char * texts[] = {
"de", "DE", "Mein Text",
"en", "US", "My Text"
};
lcm2AddMluDescription ( profile, texts,
cmsSigProfileDescriptionMLTag
);
void lcm2AddMluDescription(cmsHPROFILE profile, const char *texts[], cmsTagSignature tag_sig)
Add translated texts to a profile.
Definition: lcm2_profiler.c:2197
Parameters
[in,out]profilecolor profile
[in]textslanguage + country + text list
[in]tag_sigsignature
Version
Oyranos: 0.9.6
Date
2016/03/13
Since
2016/03/13 (Oyranos: 0.9.6)
Examples
lcm2_profiler.c.

Referenced by lcm2CreateAbstractProfile().

◆ lcm2CreateAbstractProfile()

int lcm2CreateAbstractProfile ( lcm2Sampler_f  samplerMySpace,
void *  samplerArg,
const char *  my_space_profile,
int  grid_size,
double  icc_profile_version,
const char *  my_abstract_description,
const char **  my_abstract_descriptions,
const char *  my_abstract_file_name,
const char *  provider,
const char *  vendor,
const char *  my_license,
const char *  device_model,
const char *  device_manufacturer,
const char **  my_meta_data,
cmsHPROFILE *  h_profile 
)

Create a effect profile of type abstract in ICC*Lab PCS.

Function lcm2CreateAbstractProfile

Here a code example:

void samplerGrayer (const double i[],
double o[])
{
o[0] = i[0]*1.0; // L / CIE*L / Y / R
o[1] = 0.5; // M / CIE*a / Cb / G
o[2] = 0.5; // S / CIE*b / Cr / B
}
const char * name_i18n[] = {
"de", "DE", "Graustufen (MyProject)",
"en", "US", "Grayer (MyProject)"
};
samplerGrayer,
NULL,
"*lab", // CIE*Lab
5,
2.3,
"Grayer (MyProject)",
name_i18n,
"Grayer myna",
"My Project 2016",
"My Name",
"CIE*L",
"http://www.cie.co.at",
NULL,
NULL
);
int lcm2CreateAbstractProfile(lcm2Sampler_f samplerMySpace, void *samplerArg, const char *my_space_profile, int grid_size, double icc_profile_version, const char *my_abstract_description, const char **my_abstract_descriptions, const char *my_abstract_file_name, const char *provider, const char *vendor, const char *my_license, const char *device_model, const char *device_manufacturer, const char **my_meta_data, cmsHPROFILE *h_profile)
Create a effect profile of type abstract in ICC*Lab PCS.
Definition: lcm2_profiler.c:1321
Parameters
[in]samplerMySpacethe function to fill the LUT with color
[in]samplerArgdata pointer to samplerMySpace
[in]my_space_profileoperating color space for samplerMySpace(); "*lab" will set CIE*Lab
[in]grid_sizedimensions of the created LUT; e.g. 33
[in]icc_profile_version2.3 or 4.3
[in]my_abstract_descriptioninternal profile name
[in]my_abstract_descriptionsinternal profile name translated
[in]my_abstract_file_nameprofile file name. If present a ICC profile will be written to that name. optional
[in]providere.g. "My Project 2016"
[in]vendore.g. "My Name"
[in]my_licensee.g. "This profile is made available by %s, with permission of %s, and may be copied, distributed, embedded, made, used, and sold without restriction. Altered versions of this profile shall have the original identification and copyright information removed and shall not be misrepresented as the original profile."
  • first %s is replaced by the provider string arg and
  • second %s is replaced by the vendor string arg
[in]device_modele.g. "My Set"
[in]device_manufacturere.g. "www.mydomain.net"
[in]my_meta_datae.g. {"DOMAIN_,GROUP_","DOMAIN_key1","value1","GROUP_key2","value2"}
[out]h_profilethe resulting profile
Version
Oyranos: 0.9.7
Date
2017/05/17
Since
2009/11/04 (Oyranos: 0.1.10)
Examples
lcm2_profiler.c.

References lcm2AddMetaTexts(), lcm2AddMluDescription(), lcm2CreateProfileFragment(), and lcm2CreateProfileLutByFunc().

◆ lcm2CreateAbstractTemperatureProfile()

int lcm2CreateAbstractTemperatureProfile ( float  kelvin,
cmsHPROFILE  source_white_profile,
int  grid_size,
double  icc_profile_version,
char **  my_abstract_file_name,
cmsHPROFILE *  h_profile 
)

Create a effect profile of type abstract in ICC*Lab PCS from Kelvin.

Function lcm2CreateAbstractTemperatureProfile

Parameters
[in]kelvinthe desired temperature in Kelvin; ICC reference (D50) is 5000 Kelvin
[in]source_white_profilea profile, e.g. the actual monitor profile; optional, default is D50
[in]grid_sizedimensions of the created LUT; e.g. 33
[in]icc_profile_version2.3 or 4.3
[out]my_abstract_file_nameprofile file name
[out]h_profilethe resulting profile; If omitted the function will write the profile to my_abstract_file_name.
Version
Oyranos: 0.9.7
Date
2017/05/17
Since
2017/05/17 (Oyranos: 0.9.7)
Examples
lcm2_profiler.c.

◆ lcm2CreateAbstractWhitePointProfileBradford()

int lcm2CreateAbstractWhitePointProfileBradford ( double *  src_iccXYZ,
double *  illu_iccXYZ,
int  grid_size,
double  icc_profile_version,
char **  my_abstract_file_name,
cmsHPROFILE *  h_profile 
)

Create a effect profile of type abstract in ICC*Lab PCS for white point adjustment.

Function lcm2CreateAbstractWhitePointProfileBradford

These profiles can be applied to 1D / per single channel only adjustments. It will be marked with EFFECT_linear=yes in the meta tag.

Parameters
[in]source_white_profileprofile with media white point as source
[in]illu_iccXYZICC*XYZ illuminant in 0.0 - 2.0 range
[in]grid_sizedimensions of the created LUT; e.g. 33
[in]icc_profile_version2.3 or 4.3
[out]my_abstract_file_nameprofile file name
[out]h_profilethe resulting profile; If omitted the function will write the profile to my_abstract_file_name.
Version
Oyranos: 0.9.7
Date
2018/02/28
Since
2017/06/02 (Oyranos: 0.9.7)
Examples
lcm2_profiler.c.

◆ lcm2CreateAbstractWhitePointProfileLab()

int lcm2CreateAbstractWhitePointProfileLab ( double  cie_a,
double  cie_b,
int  grid_size,
double  icc_profile_version,
char **  my_abstract_file_name,
cmsHPROFILE *  h_profile 
)

Create a effect profile of type abstract in ICC*Lab PCS for white point adjustment.

Function lcm2CreateAbstractWhitePointProfileLab

These profiles can be applied to 1D / per single channel only adjustments. It will be marked with EFFECT_linear=yes in the meta tag.

Parameters
[in]cie_aCIE*a correction value in -0.5 - 0.5 range
[in]cie_bCIE*b correction value in -0.5 - 0.5 range
[in]grid_sizedimensions of the created LUT; e.g. 33
[in]icc_profile_version2.3 or 4.3
[out]my_abstract_file_nameprofile file name
[out]h_profilethe resulting profile; If omitted the function will write the profile to my_abstract_file_name.
Version
Oyranos: 0.9.7
Date
2018/02/28
Since
2017/06/02 (Oyranos: 0.9.7)
Examples
lcm2_profiler.c.

◆ lcm2CreateICCMatrixProfile2()

cmsHPROFILE lcm2CreateICCMatrixProfile2 ( float  gamma,
float  rx,
float  ry,
float  gx,
float  gy,
float  bx,
float  by,
float  wx,
float  wy 
)

Create a profile from primaries, white point and one gamma value.

Function lcm2CreateICCMatrixProfile2

Used for ICC from EDID, Camera RAW etc. Marti calls these matrix/shaper.

// create linear space with REC.709/sRGB primaries and D65 white point
cmsHPROFILE h_my_space = lcm2CreateICCMatrixProfile2( 1.0, 0.64,0.33, 0.30,0.60, 0.15,0.06, 0.3127,0.329 );
cmsHPROFILE lcm2CreateICCMatrixProfile2(float gamma, float rx, float ry, float gx, float gy, float bx, float by, float wx, float wy)
Create a profile from primaries, white point and one gamma value.
Definition: lcm2_profiler.c:2339
Version
Oyranos: 0.9.6
Date
2016/03/04
Since
2009/10/24 (Oyranos: 0.1.10)
Examples
lcm2_profiler.c.

Referenced by l2cmsCreateICCMatrixProfile().

◆ lcm2CreateProfileFragment()

cmsHPROFILE lcm2CreateProfileFragment ( const char *  in_space_profile,
const char *  out_space_profile,
double  icc_profile_version,
const char *  my_abstract_description,
const char *  provider,
const char *  vendor,
const char *  my_license,
const char *  device_model,
const char *  device_manufacturer,
cmsHPROFILE  h_profile 
)

Create a color profile starter.

Function lcm2CreateProfileFragment

In case both the in_space_profile and out_space_profile arguments are set to "*lab", the profile will be set to class abstract. In case the in_space_profile is not "*lab" and the later one is different, a color profile of class input will be generated. With in_space_profile not "*lab" and out_space_profile "*lab" a color profile of class output will be generated. Note such profiles have initially no backward LUT and can not be used for inverse color transforms, which might be a problem for general purpose ICC profiles. But you can add more tables if needed by passing in a previously created profile.

All profiles generated by this function are meant to be filled with colorimetric data by e.g. lcm2CreateProfileLutByFunc() or lcm2CreateICCMatrixProfile2().

Here a code example:

cmsHPROFILE profile = lcm2CreateProfileFragment (
"*srgb", // sRGB
"*lab", // CIE*Lab
2.3,
"MySpace (MyProject)",
"My Project 2016",
"My Name",
"My Box", "www.mydomain.net", NULL
);
Parameters
[in]in_space_profileinput color space; for wildcards see lcm2OpenProfileFile()
[in]out_space_profileoutput color space; for wildcards see lcm2OpenProfileFile()
[in]icc_profile_version2.3 or 4.3
[in]my_abstract_descriptioninternal profile name
[in]providere.g. "My Project 2016"
[in]vendore.g. "My Name"
[in]my_licensee.g. "This profile is made available by %s, with permission of %s, and may be copied, distributed, embedded, made, used, and sold without restriction. Altered versions of this profile shall have the original identification and copyright information removed and shall not be misrepresented as the original profile." first s is provider string arg and second s is filled by vendor string arg
[in]device_modele.g. "My Set"
[in]device_manufacturere.g. "www.mydomain.net"; hint: lcms <= 2.08 writes a malformed desc tag
[in,out]h_profileuse existing profile; optional
Version
Oyranos: 0.9.6
Date
2016/03/06
Since
2009/11/04 (Oyranos: 0.1.10)
Examples
lcm2_profiler.c.

Referenced by lcm2CreateAbstractProfile().

◆ lcm2CreateProfileLutByFunc()

int lcm2CreateProfileLutByFunc ( cmsHPROFILE  profile,
lcm2Sampler_f  samplerMySpace,
void *  samplerArg,
const char *  in_space_profile,
const char *  my_space_profile,
const char *  out_space_profile,
int  grid_size,
cmsTagSignature  tag_sig 
)

Generate a ICC profile LUT.

Function lcm2CreateProfileLutByFunc

This function takes a series of parameters and functions to create a ICC profile from. The sampler function operates in a input space and and creates colors in a output space. These values are filled into the profile LUT. It is possible to create effect profiles of class abstract or LUT profiles in any other color space including device links.

For some already available sampler funtions see Samplers.

Parameters
[in,out]profileprofile to add LUT table
[in]samplerMySpacethe function to fill the LUT with color
[in]samplerArgdata pointer to samplerMySpace
[in]my_space_profileoperating color space for samplerMySpace(); for wildcards see lcm2OpenProfileFile()
[in]in_space_profileinput color space for samplerMySpace(); for wildcards see lcm2OpenProfileFile()
[in]out_space_profileoutput color space for samplerMySpace(); for wildcards see lcm2OpenProfileFile()
[in]grid_sizedimensions of the created LUT; e.g. 33
[in]tag_sigtag signature for the generated LUT;
Version
Oyranos: 0.9.7
Date
2017/05/17
Since
2009/11/04 (Oyranos: 0.1.10)
Examples
lcm2_profiler.c.

Referenced by lcm2CreateAbstractProfile().

◆ lcm2CreateProfileLutByFuncAndCurves()

int lcm2CreateProfileLutByFuncAndCurves ( cmsHPROFILE  profile,
lcm2Sampler_f  samplerMySpace,
void *  samplerArg,
cmsToneCurve *  in_curves[],
cmsToneCurve *  out_curves[],
const char *  in_space_profile,
const char *  my_space_profile,
const char *  out_space_profile,
int  grid_size,
cmsTagSignature  tag_sig 
)

Generate a ICC profile LUT.

Function lcm2CreateProfileLutByFuncAndCurves

This function takes a series of parameters and functions to create a ICC profile from. The sampler function operates in a input space and and creates colors in a output space. These values are filled into the profile LUT. It is possible to create effect profiles of class abstract or LUT profiles in any other color space including device links.

For some already available sampler funtions see Samplers.

Parameters
[in,out]profileprofile to add LUT table
[in]samplerMySpacethe function to fill the LUT with color
[in]samplerArgdata pointer to samplerMySpace
[in]in_curvesinput curves
[in]out_curvesoutput curves
[in]my_space_profileoperating color space for samplerMySpace(); for wildcards see lcm2OpenProfileFile()
[in]in_space_profileinput color space for samplerMySpace(); for wildcards see lcm2OpenProfileFile()
[in]out_space_profileoutput color space for samplerMySpace(); for wildcards see lcm2OpenProfileFile()
[in]grid_sizedimensions of the created LUT; e.g. 33
[in]tag_sigtag signature for the generated LUT;
Version
Oyranos: 0.9.6
Date
2017/05/17
Since
2009/11/04 (Oyranos: 0.1.10)
Examples
lcm2_profiler.c.

◆ lcm2MessageFunc()

int lcm2MessageFunc ( int code  OY_UNUSED,
const void *context_object  OY_UNUSED,
const char *  format,
  ... 
)

default message function to console

Function lcm2MessageFunc

The default message function is used as a message printer to the console from library start.

Parameters
codea message code understood be your message handler or openiccMSG_e
context_objecta openicc object is expected
formatthe text format string for following args
...the variable args fitting to format
Returns
0 - success; 1 - error
Version
OpenICC: 0.1.0
Date
2009/07/20
Since
2008/04/03 (OpenICC: 0.1.0)
Examples
lcm2_profiler.c.

◆ lcm2MessageFuncSet()

int lcm2MessageFuncSet ( lcm2Message_f  message_func)

set a custom message function

Use to connect to user message system.

Examples
lcm2_profiler.c.

◆ lcm2OpenProfileFile()

cmsHPROFILE lcm2OpenProfileFile ( const char *  my_space_profile,
const char *  my_space_profile_path 
)

Open a profile from file.

Function lcm2OpenProfileFile

// create ICC profile with linear gamma, RGB.709 primaries + D65 from wildcard
if(in_space_profile) h_in_space = lcm2OpenProfileFile( "*srgblinear", NULL );
cmsHPROFILE lcm2OpenProfileFile(const char *my_space_profile, const char *my_space_profile_path)
Open a profile from file.
Definition: lcm2_profiler.c:176
Parameters
[in]my_space_profileoperating color space. Use a file name or possible wildcards:
  • *srgblinear
  • *srgb
  • *lab
  • *rec601.625.linear
  • *rec601.525.linear
[in]my_space_profile_pathpath name for for my_space_profile; optional
Returns
lcms profile handle
Version
Oyranos: 0.9.6
Date
2016/03/04
Since
2016/03/04 (Oyranos: 0.9.6)
Examples
lcm2_profiler.c.

◆ lcm2Version()

int lcm2Version ( )

run time API version

Examples
lcm2_profiler.c.

References LCM2PROFILER_API.

◆ lcm2WriteProfileToFile()

char* lcm2WriteProfileToFile ( cmsHPROFILE  my_space_profile,
const char *  my_space_profile_name,
const char *  my_space_profile_version,
const char *  vendor_four_bytes 
)

Write a profile to a file.

Function lcm2WriteProfileToFile

Suggested is a scheme of "space version vendor.icc".

// "My-Space_v1.0_myna.icc"
char * file_name = lcm2WriteProfileToFile( my_space_profile,
"My-Space", "v1.0", "myna" );
char * lcm2WriteProfileToFile(cmsHPROFILE my_space_profile, const char *my_space_profile_name, const char *my_space_profile_version, const char *vendor_four_bytes)
Write a profile to a file.
Definition: lcm2_profiler.c:249
Parameters
[in]my_space_profilethe profile
[in]my_space_profile_namethe color space name
[in]my_space_profile_versionthe version of the profile; optional
[in]vendor_four_bytesthe vendor, just four bytes; optional
Returns
constructed file name; can be released with free()
Version
Oyranos: 0.9.6
Date
2016/03/06
Since
2016/02/16 (Oyranos: 0.9.6)
Examples
lcm2_profiler.c.

◆ lcm2WriteProfileToMem()

void* lcm2WriteProfileToMem ( cmsHPROFILE *  profile,
size_t *  size,
void *(*)(size_t size)  allocateFunc 
)

Function lcm2WriteProfileToMem

Save a cmsHPROFILE to a in memory data blob

Version
Oyranos: 0.9.7
Since
2008/12/28 (Oyranos: 0.9.7)
Date
2017/06/07
Examples
lcm2_profiler.c.