![]() |
![]() |
![]() |
colord Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define CD_ICC_ERROR #define CD_ICC_TYPE_ERROR enum CdIccError; enum CdIccLoadFlags; enum CdIccSaveFlags; void (*_cd_icc_reserved1) (void
); void (*_cd_icc_reserved2) (void
); void (*_cd_icc_reserved3) (void
); void (*_cd_icc_reserved4) (void
); void (*_cd_icc_reserved5) (void
); void (*_cd_icc_reserved6) (void
); void (*_cd_icc_reserved7) (void
); void (*_cd_icc_reserved8) (void
); void cd_icc_add_metadata (CdIcc *icc
,const gchar *key
,const gchar *value
); gboolean cd_icc_create_from_edid (CdIcc *icc
,gdouble gamma_value
,const CdColorYxy *red
,const CdColorYxy *green
,const CdColorYxy *blue
,const CdColorYxy *white
,GError **error
); GQuark cd_icc_error_quark (void
); const CdColorXYZ * cd_icc_get_blue (CdIcc *icc
); gboolean cd_icc_get_can_delete (CdIcc *icc
); const gchar * cd_icc_get_checksum (CdIcc *icc
); CdColorspace cd_icc_get_colorspace (CdIcc *icc
); const gchar * cd_icc_get_copyright (CdIcc *icc
,const gchar *locale
,GError **error
); GDateTime * cd_icc_get_created (CdIcc *icc
); const gchar * cd_icc_get_description (CdIcc *icc
,const gchar *locale
,GError **error
); const gchar * cd_icc_get_filename (CdIcc *icc
); const CdColorXYZ * cd_icc_get_green (CdIcc *icc
); gpointer cd_icc_get_handle (CdIcc *icc
); CdProfileKind cd_icc_get_kind (CdIcc *icc
); const gchar * cd_icc_get_manufacturer (CdIcc *icc
,const gchar *locale
,GError **error
); GHashTable * cd_icc_get_metadata (CdIcc *icc
); const gchar * cd_icc_get_metadata_item (CdIcc *icc
,const gchar *key
); const gchar * cd_icc_get_model (CdIcc *icc
,const gchar *locale
,GError **error
); GPtrArray * cd_icc_get_named_colors (CdIcc *icc
); const CdColorXYZ * cd_icc_get_red (CdIcc *icc
); GPtrArray * cd_icc_get_response (CdIcc *icc
,guint size
,GError **error
); guint32 cd_icc_get_size (CdIcc *icc
); guint cd_icc_get_temperature (CdIcc *icc
); GPtrArray * cd_icc_get_vcgt (CdIcc *icc
,guint size
,GError **error
); gdouble cd_icc_get_version (CdIcc *icc
); GArray * cd_icc_get_warnings (CdIcc *icc
); const CdColorXYZ * cd_icc_get_white (CdIcc *icc
); gboolean cd_icc_load_data (CdIcc *icc
,const guint8 *data
,gsize data_len
,CdIccLoadFlags flags
,GError **error
); gboolean cd_icc_load_fd (CdIcc *icc
,gint fd
,CdIccLoadFlags flags
,GError **error
); gboolean cd_icc_load_file (CdIcc *icc
,GFile *file
,CdIccLoadFlags flags
,GCancellable *cancellable
,GError **error
); gboolean cd_icc_load_handle (CdIcc *icc
,gpointer handle
,CdIccLoadFlags flags
,GError **error
); CdIcc * cd_icc_new (void
); void cd_icc_remove_metadata (CdIcc *icc
,const gchar *key
); GBytes * cd_icc_save_data (CdIcc *icc
,CdIccSaveFlags flags
,GError **error
); gboolean cd_icc_save_file (CdIcc *icc
,GFile *file
,CdIccSaveFlags flags
,GCancellable *cancellable
,GError **error
); void cd_icc_set_colorspace (CdIcc *icc
,CdColorspace colorspace
); void cd_icc_set_copyright (CdIcc *icc
,const gchar *locale
,const gchar *value
); void cd_icc_set_copyright_items (CdIcc *icc
,GHashTable *values
); void cd_icc_set_description (CdIcc *icc
,const gchar *locale
,const gchar *value
); void cd_icc_set_description_items (CdIcc *icc
,GHashTable *values
); void cd_icc_set_filename (CdIcc *icc
,const gchar *filename
); void cd_icc_set_kind (CdIcc *icc
,CdProfileKind kind
); void cd_icc_set_manufacturer (CdIcc *icc
,const gchar *locale
,const gchar *value
); void cd_icc_set_manufacturer_items (CdIcc *icc
,GHashTable *values
); void cd_icc_set_model (CdIcc *icc
,const gchar *locale
,const gchar *value
); void cd_icc_set_model_items (CdIcc *icc
,GHashTable *values
); gboolean cd_icc_set_vcgt (CdIcc *icc
,GPtrArray *vcgt
,GError **error
); void cd_icc_set_version (CdIcc *icc
,gdouble version
); gchar * cd_icc_to_string (CdIcc *icc
);
typedef enum { CD_ICC_ERROR_FAILED_TO_OPEN, /* Since: 0.1.32 */ CD_ICC_ERROR_FAILED_TO_PARSE, /* Since: 0.1.32 */ CD_ICC_ERROR_INVALID_LOCALE, /* Since: 0.1.32 */ CD_ICC_ERROR_NO_DATA, /* Since: 0.1.32 */ CD_ICC_ERROR_FAILED_TO_SAVE, /* Since: 0.1.32 */ CD_ICC_ERROR_FAILED_TO_CREATE, /* Since: 0.1.32 */ CD_ICC_ERROR_INVALID_COLORSPACE, /* Since: 0.1.34 */ } CdIccError;
The ICC error code.
Failed to open file | |
Failed to parse data | |
Locale was invalid | |
No data to read | |
Failed to save file | |
Failed to create file | |
Invalid colorspace |
Since 0.1.32
typedef enum { CD_ICC_LOAD_FLAGS_NONE = 0, /* Since: 0.1.32 */ CD_ICC_LOAD_FLAGS_NAMED_COLORS = (1 << 0), /* Since: 0.1.32 */ CD_ICC_LOAD_FLAGS_TRANSLATIONS = (1 << 1), /* Since: 0.1.32 */ CD_ICC_LOAD_FLAGS_METADATA = (1 << 2), /* Since: 0.1.32 */ CD_ICC_LOAD_FLAGS_FALLBACK_MD5 = (1 << 3), /* Since: 0.1.32 */ CD_ICC_LOAD_FLAGS_PRIMARIES = (1 << 4), /* Since: 0.1.32 */ /* new entries go here: */ CD_ICC_LOAD_FLAGS_ALL = 0xff, /* Since: 0.1.32 */ } CdIccLoadFlags;
Flags used when loading an ICC profile.
No flags set. | |
Parse any named colors in the profile. | |
Parse all translations in the profile. | |
Parse the metadata in the profile. | |
Calculate the profile MD5 if a profile ID was not supplied in the profile. | |
Parse the primaries in the profile. | |
Since 0.1.32
typedef enum { CD_ICC_SAVE_FLAGS_NONE = 0, /* Since: 0.1.32 */ } CdIccSaveFlags;
Flags used when saving an ICC profile.
Since 0.1.32
void cd_icc_add_metadata (CdIcc *icc
,const gchar *key
,const gchar *value
);
Sets an item of data to the profile metadata, overwriting it if it already exists.
|
A valid CdIcc |
|
the metadata key |
|
the metadata value |
Since 0.1.32
gboolean cd_icc_create_from_edid (CdIcc *icc
,gdouble gamma_value
,const CdColorYxy *red
,const CdColorYxy *green
,const CdColorYxy *blue
,const CdColorYxy *white
,GError **error
);
Creates an ICC profile from EDID data.
|
A valid CdIcc |
|
approximate device gamma |
|
primary color value |
|
primary color value |
|
primary color value |
|
whitepoint value |
|
A GError, or NULL
|
Returns : |
TRUE for success |
Since 0.1.32
const CdColorXYZ * cd_icc_get_blue (CdIcc *icc
);
Gets the profile red chromaticity value.
This function will only return results if the profile was loaded with the
CD_ICC_LOAD_FLAGS_PRIMARIES
flag.
|
a valid CdIcc instance |
Returns : |
the CdColorXYZ value |
Since 0.1.32
gboolean cd_icc_get_can_delete (CdIcc *icc
);
Finds out if the profile could be deleted.
This is only applicable for profiles loaded with cd_icc_load_file()
as
obviously data and fd's cannot be sanely unlinked.
|
a CdIcc instance. |
Returns : |
TRUE if g_file_delete() would likely work |
Since 0.1.32
const gchar * cd_icc_get_checksum (CdIcc *icc
);
Gets the profile checksum if one exists.
This will either be the embedded profile ID, or the file checksum if
the CdIcc object was loaded using cd_icc_load_data()
or cd_icc_load_file()
and the CD_ICC_LOAD_FLAGS_FALLBACK_MD5
flag is used.
|
A valid CdIcc |
Returns : |
An embedded MD5 checksum, or NULL for not set |
Since 0.1.32
CdColorspace cd_icc_get_colorspace (CdIcc *icc
);
Gets the profile colorspace
|
a CdIcc instance. |
Returns : |
The profile colorspace, e.g. CD_COLORSPACE_RGB
|
Since 0.1.32
const gchar * cd_icc_get_copyright (CdIcc *icc
,const gchar *locale
,GError **error
);
Gets the profile copyright. If the translated text is not available in the selected locale then the default untranslated (en_US) text is returned.
|
A valid CdIcc |
|
A locale, e.g. "en_GB.UTF-8" or NULL for the profile default |
|
A GError or NULL
|
Returns : |
The text as a UTF-8 string, or NULL of the locale is invalid
or the tag does not exist. |
Since 0.1.32
GDateTime * cd_icc_get_created (CdIcc *icc
);
Gets the ICC creation date and time.
Since 0.1.32
const gchar * cd_icc_get_description (CdIcc *icc
,const gchar *locale
,GError **error
);
Gets the profile description. If the translated text is not available in the selected locale then the default untranslated (en_US) text is returned.
|
A valid CdIcc |
|
A locale, e.g. "en_GB.UTF-8" or NULL for the profile default |
|
A GError or NULL
|
Returns : |
The text as a UTF-8 string, or NULL of the locale is invalid
or the tag does not exist. |
Since 0.1.32
const gchar * cd_icc_get_filename (CdIcc *icc
);
Gets the filename of the ICC data, if one exists.
|
A valid CdIcc |
Returns : |
A filename, or NULL
|
Since 0.1.32
const CdColorXYZ * cd_icc_get_green (CdIcc *icc
);
Gets the profile green chromaticity value.
This function will only return results if the profile was loaded with the
CD_ICC_LOAD_FLAGS_PRIMARIES
flag.
|
a valid CdIcc instance |
Returns : |
the CdColorXYZ value |
Since 0.1.32
gpointer cd_icc_get_handle (CdIcc *icc
);
Return the cmsHPROFILE instance used locally. This may be required if you are using the profile in a transform.
|
a CdIcc instance. |
Returns : |
Do not call cmsCloseProfile() on this value!. [transfer none]
|
CdProfileKind cd_icc_get_kind (CdIcc *icc
);
Gets the profile kind.
|
a CdIcc instance. |
Returns : |
The kind, e.g. CD_PROFILE_KIND_INPUT
|
Since 0.1.32
const gchar * cd_icc_get_manufacturer (CdIcc *icc
,const gchar *locale
,GError **error
);
Gets the profile manufacturer. If the translated text is not available in the selected locale then the default untranslated (en_US) text is returned.
|
A valid CdIcc |
|
A locale, e.g. "en_GB.UTF-8" or NULL for the profile default |
|
A GError or NULL
|
Returns : |
The text as a UTF-8 string, or NULL of the locale is invalid
or the tag does not exist. |
Since 0.1.32
GHashTable * cd_icc_get_metadata (CdIcc *icc
);
Gets all the metadata from the ICC profile.
|
A valid CdIcc |
Returns : |
The profile metadata. [transfer container] |
Since 0.1.32
const gchar * cd_icc_get_metadata_item (CdIcc *icc
,const gchar *key
);
Gets an item of data from the ICC metadata store.
|
A valid CdIcc |
|
the dictionary key |
Returns : |
The dictionary data, or NULL if the key does not exist. |
Since 0.1.32
const gchar * cd_icc_get_model (CdIcc *icc
,const gchar *locale
,GError **error
);
Gets the profile model. If the translated text is not available in the selected locale then the default untranslated (en_US) text is returned.
|
A valid CdIcc |
|
A locale, e.g. "en_GB.UTF-8" or NULL for the profile default |
|
A GError or NULL
|
Returns : |
The text as a UTF-8 string, or NULL of the locale is invalid
or the tag does not exist. |
Since 0.1.32
GPtrArray * cd_icc_get_named_colors (CdIcc *icc
);
Gets any named colors in the profile.
This function will only return results if the profile was loaded with the
CD_ICC_LOAD_FLAGS_NAMED_COLORS
flag.
|
a CdIcc instance. |
Returns : |
An array of color swatches. [transfer container][element-type CdColorSwatch] |
Since 0.1.32
const CdColorXYZ * cd_icc_get_red (CdIcc *icc
);
Gets the profile red chromaticity value.
This function will only return results if the profile was loaded with the
CD_ICC_LOAD_FLAGS_PRIMARIES
flag.
|
a valid CdIcc instance |
Returns : |
the CdColorXYZ value |
Since 0.1.32
GPtrArray * cd_icc_get_response (CdIcc *icc
,guint size
,GError **error
);
Generates a response curve of a specified size.
|
A valid CdIcc |
|
the size of the curve to generate |
|
a valid GError, or NULL
|
Returns : |
response data, or NULL for error. [transfer container][element-type CdColorRGB]
|
Since 0.1.34
guint32 cd_icc_get_size (CdIcc *icc
);
Gets the ICC profile file size
Returns : |
The size in bytes, or 0 for unknown. |
Since 0.1.32
guint cd_icc_get_temperature (CdIcc *icc
);
Gets the ICC color temperature, rounded to the nearest 100K.
This function will only return results if the profile was loaded with the
CD_ICC_LOAD_FLAGS_PRIMARIES
flag.
|
A valid CdIcc |
Returns : |
The color temperature in Kelvin, or 0 for error. |
Since 0.1.32
GPtrArray * cd_icc_get_vcgt (CdIcc *icc
,guint size
,GError **error
);
Gets the video card calibration data from the profile.
|
A valid CdIcc |
|
the desired size of the table data |
|
A GError or NULL
|
Returns : |
VCGT data, or NULL for error. [transfer container][element-type CdColorRGB]
|
Since 0.1.34
gdouble cd_icc_get_version (CdIcc *icc
);
Gets the ICC profile version, typically 2.1 or 4.2
|
a CdIcc instance. |
Returns : |
A floating point version number, or 0.0 for unknown |
Since 0.1.32
GArray * cd_icc_get_warnings (CdIcc *icc
);
Returns any warnings with profiles
|
a CdIcc instance. |
Returns : |
An array of warning values. [transfer container][element-type CdProfileWarning] |
Since 0.1.34
const CdColorXYZ * cd_icc_get_white (CdIcc *icc
);
Gets the profile white point.
This function will only return results if the profile was loaded with the
CD_ICC_LOAD_FLAGS_PRIMARIES
flag.
|
a valid CdIcc instance |
Returns : |
the CdColorXYZ value |
Since 0.1.32
gboolean cd_icc_load_data (CdIcc *icc
,const guint8 *data
,gsize data_len
,CdIccLoadFlags flags
,GError **error
);
Loads an ICC profile from raw byte data.
|
a CdIcc instance. |
|
binary data |
|
Length of data
|
|
a set of CdIccLoadFlags |
|
A GError or NULL
|
Since 0.1.32
gboolean cd_icc_load_fd (CdIcc *icc
,gint fd
,CdIccLoadFlags flags
,GError **error
);
Loads an ICC profile from an open file descriptor.
|
a CdIcc instance. |
|
a file descriptor |
|
a set of CdIccLoadFlags |
|
A GError or NULL
|
Since 0.1.32
gboolean cd_icc_load_file (CdIcc *icc
,GFile *file
,CdIccLoadFlags flags
,GCancellable *cancellable
,GError **error
);
Loads an ICC profile from a local or remote file.
|
a CdIcc instance. |
|
a GFile |
|
a set of CdIccLoadFlags |
|
A GCancellable or NULL
|
|
A GError or NULL
|
Since 0.1.32
gboolean cd_icc_load_handle (CdIcc *icc
,gpointer handle
,CdIccLoadFlags flags
,GError **error
);
Set the internal cmsHPROFILE instance. This may be required if you create
the profile using cmsCreateRGBProfile()
and then want to use the
functionality in CdIcc.
Do not call cmsCloseProfile()
on handle
in the caller, this will be done
when the icc
object is finalized. Treat the profile like it's been adopted
by this module.
Additionally, this function cannot be called more than once, and also can't
be called if cd_icc_load_file()
has previously been used on the icc
object.
|
a CdIcc instance. |
|
a cmsHPROFILE instance |
|
a set of CdIccLoadFlags |
|
A GError or NULL
|
Since 0.1.33
CdIcc * cd_icc_new (void
);
Creates a new CdIcc object.
Returns : |
a new CdIcc object. |
Since 0.1.32
void cd_icc_remove_metadata (CdIcc *icc
,const gchar *key
);
Removes an item of metadata.
|
A valid CdIcc |
|
the metadata key |
Since 0.1.32
GBytes * cd_icc_save_data (CdIcc *icc
,CdIccSaveFlags flags
,GError **error
);
Saves an ICC profile to an allocated memory location.
Return vale: A GBytes structure, or NULL
for error
|
a CdIcc instance. |
|
a set of CdIccSaveFlags |
|
A GError or NULL
|
Since 1.0.2
gboolean cd_icc_save_file (CdIcc *icc
,GFile *file
,CdIccSaveFlags flags
,GCancellable *cancellable
,GError **error
);
Saves an ICC profile to a local or remote file.
Return vale: TRUE
for success.
|
a CdIcc instance. |
|
a GFile |
|
a set of CdIccSaveFlags |
|
A GCancellable or NULL
|
|
A GError or NULL
|
Since 0.1.32
void cd_icc_set_colorspace (CdIcc *icc
,CdColorspace colorspace
);
Sets the colorspace kind.
|
a CdIcc instance. |
|
the profile colorspace, e.g. CD_COLORSPACE_RGB
|
Since 0.1.32
void cd_icc_set_copyright (CdIcc *icc
,const gchar *locale
,const gchar *value
);
Sets the profile _copyright for a specific locale.
|
A valid CdIcc |
|
A locale, e.g. "en_GB.UTF-8" or NULL for the profile default |
|
New string value |
Since 0.1.32
void cd_icc_set_copyright_items (CdIcc *icc
,GHashTable *values
);
Sets the profile copyrights for specific locales.
|
A valid CdIcc |
|
New translated values, with the key being the locale. |
Since 0.1.32
void cd_icc_set_description (CdIcc *icc
,const gchar *locale
,const gchar *value
);
Sets the profile description for a specific locale.
|
A valid CdIcc |
|
A locale, e.g. "en_GB.UTF-8" or NULL for the profile default |
|
New string value |
Since 0.1.32
void cd_icc_set_description_items (CdIcc *icc
,GHashTable *values
);
Sets the profile descriptions for specific locales.
|
A valid CdIcc |
|
New translated values, with the key being the locale. |
Since 0.1.32
void cd_icc_set_filename (CdIcc *icc
,const gchar *filename
);
Sets the filename, which may be required if the ICC profile has been loaded
using cd_icc_load_fd()
from a disk cache.
|
a CdIcc instance. |
|
a filename, or NULL
|
Since 1.1.1
void cd_icc_set_kind (CdIcc *icc
,CdProfileKind kind
);
Sets the profile kind.
|
a CdIcc instance. |
|
the profile kind, e.g. CD_PROFILE_KIND_DISPLAY_DEVICE
|
Since 0.1.32
void cd_icc_set_manufacturer (CdIcc *icc
,const gchar *locale
,const gchar *value
);
Sets the profile manufacturer for a specific locale.
|
A valid CdIcc |
|
A locale, e.g. "en_GB.UTF-8" or NULL for the profile default |
|
New string value |
Since 0.1.32
void cd_icc_set_manufacturer_items (CdIcc *icc
,GHashTable *values
);
Sets the profile manufacturers for specific locales.
|
A valid CdIcc |
|
New translated values, with the key being the locale. |
Since 0.1.32
void cd_icc_set_model (CdIcc *icc
,const gchar *locale
,const gchar *value
);
Sets the profile model for a specific locale.
|
A valid CdIcc |
|
A locale, e.g. "en_GB.UTF-8" or NULL for the profile default |
|
New string value |
Since 0.1.32
void cd_icc_set_model_items (CdIcc *icc
,GHashTable *values
);
Sets the profile models for specific locales.
|
A valid CdIcc |
|
New translated values, with the key being the locale. |
Since 0.1.32
gboolean cd_icc_set_vcgt (CdIcc *icc
,GPtrArray *vcgt
,GError **error
);
Sets the Video Card Gamma Table from the profile.
Return vale: TRUE
for success.
|
A valid CdIcc |
|
video card calibration data. [element-type CdColorRGB] |
|
A GError or NULL
|
Since 0.1.34
void cd_icc_set_version (CdIcc *icc
,gdouble version
);
Sets the profile version.
|
a CdIcc instance. |
|
the profile version, e.g. 2.1 or 4.0 |
Since 0.1.32
gchar * cd_icc_to_string (CdIcc *icc
);
Returns a string representation of the ICC profile.
|
a CdIcc instance. |
Returns : |
an allocated string |
Since 0.1.32