Colord.Icc

g Colord.Icc Colord.Icc GObject.Object GObject.Object GObject.Object->Colord.Icc

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

error_quark ()

class

new ()

add_metadata (key, value)

create_default ()

create_default_full (flags)

create_from_edid (gamma_value, red, green, blue, white)

create_from_edid_data (edid)

get_blue ()

get_can_delete ()

get_characterization_data ()

get_checksum ()

get_colorspace ()

get_context ()

get_copyright (locale)

get_created ()

get_description (locale)

get_filename ()

get_green ()

get_handle ()

get_kind ()

get_manufacturer (locale)

get_metadata ()

get_metadata_item (key)

get_model (locale)

get_named_colors ()

get_red ()

get_response (size)

get_size ()

get_tag_data (tag)

get_tags ()

get_temperature ()

get_vcgt (size)

get_version ()

get_warnings ()

get_white ()

load_data (data, flags)

load_fd (fd, flags)

load_file (file, flags, cancellable)

load_handle (handle, flags)

remove_metadata (key)

save_data (flags)

save_default (flags, cancellable)

save_file (file, flags, cancellable)

set_characterization_data (data)

set_colorspace (colorspace)

set_copyright (locale, value)

set_copyright_items (values)

set_created (creation_time)

set_description (locale, value)

set_description_items (values)

set_filename (filename)

set_kind (kind)

set_manufacturer (locale, value)

set_manufacturer_items (values)

set_model (locale, value)

set_model_items (values)

set_tag_data (tag, data)

set_vcgt (vcgt)

set_version (version)

to_string ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

blue

Colord.ColorXYZ

r

can-delete

bool

r

checksum

str

r

colorspace

int

r/w

filename

str

r

green

Colord.ColorXYZ

r

kind

int

r/w

red

Colord.ColorXYZ

r

size

int

r

temperature

int

r

version

float

r/w

white

Colord.ColorXYZ

r

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Colord.Icc(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Colord.IccClass

classmethod error_quark()[source]
Returns:

An error quark.

Return type:

int

New in version 0.1.32.

classmethod new()[source]
Returns:

a new Colord.Icc object.

Return type:

Colord.Icc

Creates a new Colord.Icc object.

New in version 0.1.32.

add_metadata(key, value)[source]
Parameters:
  • key (str) – the metadata key

  • value (str) – the UTF-8 metadata value

Sets an item of data to the profile metadata, overwriting it if it already exists.

New in version 0.1.32.

create_default()[source]
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Creates a default sRGB ICC profile.

New in version 1.1.2.

create_default_full(flags)[source]
Parameters:

flags (Colord.IccLoadFlags) – a set of Colord.IccLoadFlags

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Creates a default sRGB ICC profile.

New in version 1.4.5.

create_from_edid(gamma_value, red, green, blue, white)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Creates an ICC profile from EDID data.

New in version 0.1.32.

create_from_edid_data(edid)[source]
Parameters:

edid (Colord.Edid) – EDID data

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Creates an ICC profile from EDID data.

New in version 1.1.2.

get_blue()[source]
Returns:

the Colord.ColorXYZ value

Return type:

Colord.ColorXYZ

Gets the profile red chromaticity value. This function will only return results if the profile was loaded with the Colord.IccLoadFlags.PRIMARIES flag.

New in version 0.1.32.

get_can_delete()[source]
Returns:

True if Gio.File.delete() would likely work

Return type:

bool

Finds out if the profile could be deleted. This is only applicable for profiles loaded with Colord.Icc.load_file() as obviously data and fd’s cannot be sanely unlinked.

New in version 0.1.32.

get_characterization_data()[source]
Returns:

TI3 string data

Return type:

str

Gets any characterization data used to build the profile. This function will only return results if the profile was loaded with the Colord.IccLoadFlags.CHARACTERIZATION flag.

New in version 1.1.1.

get_checksum()[source]
Returns:

An embedded MD5 checksum, or None for not set

Return type:

str

Gets the profile checksum if one exists. This will either be the embedded profile ID, or the file checksum if the Colord.Icc object was loaded using Colord.Icc.load_data() or Colord.Icc.load_file() and the Colord.IccLoadFlags.FALLBACK_MD5 flag is used.

New in version 0.1.32.

get_colorspace()[source]
Returns:

The profile colorspace, e.g. Colord.Colorspace.RGB

Return type:

Colord.Colorspace

Gets the profile colorspace

New in version 0.1.32.

get_context()[source]
Returns:

Do not call cmsDeleteContext() on this value!

Return type:

object or None

Return the cmsContext instance used locally. This may be required if you are using native LCMS calls and then Colord.Icc.load_handle().

New in version 1.1.7.

Parameters:

locale (str) – A locale, e.g. “en_GB.UTF-8” or None for the profile default

Raises:

GLib.Error

Returns:

The text as a UTF-8 string, or None of the locale is invalid or the tag does not exist.

Return type:

str

Gets the profile copyright. If the translated text is not available in the selected locale then the default untranslated (en_US) text is returned.

New in version 0.1.32.

get_created()[source]
Returns:

A GLib.DateTime object, or None for not set

Return type:

GLib.DateTime

Gets the ICC creation date and time.

New in version 0.1.32.

get_description(locale)[source]
Parameters:

locale (str) – A locale, e.g. “en_GB.UTF-8” or None for the profile default

Raises:

GLib.Error

Returns:

The text as a UTF-8 string, or None of the locale is invalid or the tag does not exist.

Return type:

str

Gets the profile description. If the translated text is not available in the selected locale then the default untranslated (en_US) text is returned.

New in version 0.1.32.

get_filename()[source]
Returns:

A filename, or None

Return type:

str

Gets the filename of the ICC data, if one exists.

New in version 0.1.32.

get_green()[source]
Returns:

the Colord.ColorXYZ value

Return type:

Colord.ColorXYZ

Gets the profile green chromaticity value. This function will only return results if the profile was loaded with the Colord.IccLoadFlags.PRIMARIES flag.

New in version 0.1.32.

get_handle()[source]
Returns:

Do not call cmsCloseProfile() on this value!

Return type:

object or None

Return the cmsHPROFILE instance used locally. This may be required if you are using the profile in a transform.

get_kind()[source]
Returns:

The kind, e.g. %CD_PROFILE_KIND_INPUT

Return type:

Colord.ProfileKind

Gets the profile kind.

New in version 0.1.32.

get_manufacturer(locale)[source]
Parameters:

locale (str) – A locale, e.g. “en_GB.UTF-8” or None for the profile default

Raises:

GLib.Error

Returns:

The text as a UTF-8 string, or None of the locale is invalid or the tag does not exist.

Return type:

str

Gets the profile manufacturer. If the translated text is not available in the selected locale then the default untranslated (en_US) text is returned.

New in version 0.1.32.

get_metadata()[source]
Returns:

The profile metadata

Return type:

{object: object}

Gets all the metadata from the ICC profile.

New in version 0.1.32.

get_metadata_item(key)[source]
Parameters:

key (str) – the dictionary key

Returns:

The dictionary data, or None if the key does not exist.

Return type:

str

Gets an item of data from the ICC metadata store.

New in version 0.1.32.

get_model(locale)[source]
Parameters:

locale (str) – A locale, e.g. “en_GB.UTF-8” or None for the profile default

Raises:

GLib.Error

Returns:

The text as a UTF-8 string, or None of the locale is invalid or the tag does not exist.

Return type:

str

Gets the profile model. If the translated text is not available in the selected locale then the default untranslated (en_US) text is returned.

New in version 0.1.32.

get_named_colors()[source]
Returns:

An array of color swatches

Return type:

[Colord.ColorSwatch]

Gets any named colors in the profile. This function will only return results if the profile was loaded with the Colord.IccLoadFlags.NAMED_COLORS flag.

New in version 0.1.32.

get_red()[source]
Returns:

the Colord.ColorXYZ value

Return type:

Colord.ColorXYZ

Gets the profile red chromaticity value. This function will only return results if the profile was loaded with the Colord.IccLoadFlags.PRIMARIES flag.

New in version 0.1.32.

get_response(size)[source]
Parameters:

size (int) – the size of the curve to generate

Raises:

GLib.Error

Returns:

response data, or None for error

Return type:

[Colord.ColorRGB]

Generates a response curve of a specified size.

New in version 0.1.34.

get_size()[source]
Returns:

The size in bytes, or 0 for unknown.

Return type:

int

Gets the ICC profile file size

New in version 0.1.32.

get_tag_data(tag)[source]
Parameters:

tag (str) – a 4 bytes tag description, e.g. “cprt” or “vcgt”

Raises:

GLib.Error

Returns:

the data for the tag

Return type:

GLib.Bytes

Returns the raw data for the specific tag. Most users do not need to do this.

New in version 1.1.6.

get_tags()[source]
Raises:

GLib.Error

Returns:

the tag tables as an array of strings

Return type:

[str]

Returns the internal tag table. Most users do not need to do this.

New in version 1.1.6.

get_temperature()[source]
Returns:

The color temperature in Kelvin, or 0 for error.

Return type:

int

Gets the ICC color temperature, rounded to the nearest 100K. This function will only return results if the profile was loaded with the Colord.IccLoadFlags.PRIMARIES flag.

New in version 0.1.32.

get_vcgt(size)[source]
Parameters:

size (int) – the desired size of the table data

Raises:

GLib.Error

Returns:

VCGT data, or None for error

Return type:

[Colord.ColorRGB]

Gets the video card calibration data from the profile.

New in version 0.1.34.

get_version()[source]
Returns:

A floating point version number, or 0.0 for unknown

Return type:

float

Gets the ICC profile version, typically 2.1 or 4.2

New in version 0.1.32.

get_warnings()[source]
Returns:

An array of warning values

Return type:

[Colord.ProfileWarning]

Returns any warnings with profiles

New in version 0.1.34.

get_white()[source]
Returns:

the Colord.ColorXYZ value

Return type:

Colord.ColorXYZ

Gets the profile white point. This function will only return results if the profile was loaded with the Colord.IccLoadFlags.PRIMARIES flag.

New in version 0.1.32.

load_data(data, flags)[source]
Parameters:
Raises:

GLib.Error

Return type:

bool

Loads an ICC profile from raw byte data.

New in version 0.1.32.

load_fd(fd, flags)[source]
Parameters:
Raises:

GLib.Error

Return type:

bool

Loads an ICC profile from an open file descriptor.

New in version 0.1.32.

load_file(file, flags, cancellable)[source]
Parameters:
Raises:

GLib.Error

Return type:

bool

Loads an ICC profile from a local or remote file.

New in version 0.1.32.

load_handle(handle, flags)[source]
Parameters:
Raises:

GLib.Error

Return type:

bool

Set the internal cmsHPROFILE instance. This may be required if you create the profile using cmsCreateRGBProfileTHR() and then want to use the functionality in Colord.Icc.

Do not call cmsCloseProfile() on handle in the caller, this will be done when the self object is finalized. Treat the profile like it’s been adopted by this module.

To handle the internal error callback, you should use the thread-safe creation function, e.g. cmsCreateNULLProfileTHR(). The context_id should be set as the value of Colord.Icc.get_context() for this object.

Additionally, this function cannot be called more than once, and also can’t be called if Colord.Icc.load_file() has previously been used on the self object.

New in version 0.1.33.

remove_metadata(key)[source]
Parameters:

key (str) – the metadata key

Removes an item of metadata.

New in version 0.1.32.

save_data(flags)[source]
Parameters:

flags (Colord.IccSaveFlags) – a set of Colord.IccSaveFlags

Raises:

GLib.Error

Return type:

GLib.Bytes

Saves an ICC profile to an allocated memory location.

Return vale: A GLib.Bytes structure, or None for error

New in version 1.0.2.

save_default(flags, cancellable)[source]
Parameters:
Raises:

GLib.Error

Return type:

bool

Saves an ICC profile to the default per-user location.

Return vale: True for success.

New in version 1.1.1.

save_file(file, flags, cancellable)[source]
Parameters:
Raises:

GLib.Error

Return type:

bool

Saves an ICC profile to a local or remote file.

Return vale: True for success.

New in version 0.1.32.

set_characterization_data(data)[source]
Parameters:

data (str) – TI3 string data, or None

Sets the characterization data used to build the profile.

New in version 1.1.1.

set_colorspace(colorspace)[source]
Parameters:

colorspace (Colord.Colorspace) – the profile colorspace, e.g. Colord.Colorspace.RGB

Sets the colorspace kind.

New in version 0.1.32.

Parameters:
  • locale (str) – A locale, e.g. “en_GB.UTF-8” or None for the profile default

  • value (str or None) – New UTF-8 string value

Sets the profile _copyright for a specific locale.

New in version 0.1.32.

Parameters:

values ({object: object}) – New translated values, with the key being the locale.

Sets the profile copyrights for specific locales.

New in version 0.1.32.

set_created(creation_time)[source]
Parameters:

creation_time (GLib.DateTime) –

Sets the ICC creation date and time.

New in version 1.4.2.

set_description(locale, value)[source]
Parameters:
  • locale (str) – A locale, e.g. “en_GB.UTF-8” or None for the profile default

  • value (str or None) – New UTF-8 string value

Sets the profile description for a specific locale.

New in version 0.1.32.

set_description_items(values)[source]
Parameters:

values ({object: object}) – New translated values, with the key being the locale.

Sets the profile descriptions for specific locales.

New in version 0.1.32.

set_filename(filename)[source]
Parameters:

filename (str) – a filename, or None

Sets the filename, which may be required if the ICC profile has been loaded using Colord.Icc.load_fd() from a disk cache.

New in version 1.1.1.

set_kind(kind)[source]
Parameters:

kind (Colord.ProfileKind) – the profile kind, e.g. Colord.ProfileKind.DISPLAY_DEVICE

Sets the profile kind.

New in version 0.1.32.

set_manufacturer(locale, value)[source]
Parameters:
  • locale (str) – A locale, e.g. “en_GB.UTF-8” or None for the profile default

  • value (str or None) – New UTF-8 string value

Sets the profile manufacturer for a specific locale.

New in version 0.1.32.

set_manufacturer_items(values)[source]
Parameters:

values ({object: object}) – New translated values, with the key being the locale.

Sets the profile manufacturers for specific locales.

New in version 0.1.32.

set_model(locale, value)[source]
Parameters:
  • locale (str) – A locale, e.g. “en_GB.UTF-8” or None for the profile default

  • value (str or None) – New UTF-8 string value

Sets the profile model for a specific locale.

New in version 0.1.32.

set_model_items(values)[source]
Parameters:

values ({object: object}) – New translated values, with the key being the locale.

Sets the profile models for specific locales.

New in version 0.1.32.

set_tag_data(tag, data)[source]
Parameters:
  • tag (str) – a 4 bytes tag description, e.g. “cprt” or “vcgt”

  • data (GLib.Bytes) – a variable sized data entry

Raises:

GLib.Error

Return type:

bool

Sets the raw data for the specific tag. Most users do not need to do this.

New in version 1.1.6.

set_vcgt(vcgt)[source]
Parameters:

vcgt ([Colord.ColorRGB]) – video card calibration data

Raises:

GLib.Error

Return type:

bool

Sets the Video Card Gamma Table from the profile.

Return vale: True for success.

New in version 0.1.34.

set_version(version)[source]
Parameters:

version (float) – the profile version, e.g. 2.1 or 4.0

Sets the profile version.

New in version 0.1.32.

to_string()[source]
Returns:

an allocated string

Return type:

str

Returns a string representation of the ICC profile.

New in version 0.1.32.

Property Details

Colord.Icc.props.blue
Name:

blue

Type:

Colord.ColorXYZ

Default Value:

None

Flags:

READABLE

Colord.Icc.props.can_delete
Name:

can-delete

Type:

bool

Default Value:

False

Flags:

READABLE

Colord.Icc.props.checksum
Name:

checksum

Type:

str

Default Value:

None

Flags:

READABLE

Colord.Icc.props.colorspace
Name:

colorspace

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Colord.Icc.props.filename
Name:

filename

Type:

str

Default Value:

None

Flags:

READABLE

Colord.Icc.props.green
Name:

green

Type:

Colord.ColorXYZ

Default Value:

None

Flags:

READABLE

Colord.Icc.props.kind
Name:

kind

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Colord.Icc.props.red
Name:

red

Type:

Colord.ColorXYZ

Default Value:

None

Flags:

READABLE

Colord.Icc.props.size
Name:

size

Type:

int

Default Value:

0

Flags:

READABLE

Colord.Icc.props.temperature
Name:

temperature

Type:

int

Default Value:

0

Flags:

READABLE

Colord.Icc.props.version
Name:

version

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

Colord.Icc.props.white
Name:

white

Type:

Colord.ColorXYZ

Default Value:

None

Flags:

READABLE