GcmProfile

GcmProfile — A parser object that understands the ICC profile data format.

Synopsis

                    GcmProfilePrivate;
                    GcmProfile;
                    GcmProfileClass;
GcmProfile *        gcm_profile_new                     (void);
gboolean            gcm_profile_parse                   (GcmProfile *profile,
                                                         GFile *file,
                                                         GError **error);
gboolean            gcm_profile_parse_data              (GcmProfile *profile,
                                                         const guint8 *data,
                                                         gsize length,
                                                         GError **error);
gboolean            gcm_profile_save                    (GcmProfile *profile,
                                                         const gchar *filename,
                                                         GError **error);
gpointer            gcm_profile_get_handle              (GcmProfile *profile);
const gchar *       gcm_profile_get_checksum            (GcmProfile *profile);
gboolean            gcm_profile_get_can_delete          (GcmProfile *profile);
GcmClut *           gcm_profile_generate_vcgt           (GcmProfile *profile,
                                                         guint size);
GcmClut *           gcm_profile_generate_curve          (GcmProfile *profile,
                                                         guint size);
const gchar *       gcm_profile_get_description         (GcmProfile *profile);
void                gcm_profile_set_description         (GcmProfile *profile,
                                                         const gchar *description);
GFile *             gcm_profile_get_file                (GcmProfile *profile);
void                gcm_profile_set_file                (GcmProfile *profile,
                                                         GFile *file);
const gchar *       gcm_profile_get_filename            (GcmProfile *profile);
const gchar *       gcm_profile_get_copyright           (GcmProfile *profile);
void                gcm_profile_set_copyright           (GcmProfile *profile,
                                                         const gchar *copyright);
const gchar *       gcm_profile_get_manufacturer        (GcmProfile *profile);
void                gcm_profile_set_manufacturer        (GcmProfile *profile,
                                                         const gchar *manufacturer);
const gchar *       gcm_profile_get_model               (GcmProfile *profile);
void                gcm_profile_set_model               (GcmProfile *profile,
                                                         const gchar *model);
const gchar *       gcm_profile_get_datetime            (GcmProfile *profile);
void                gcm_profile_set_datetime            (GcmProfile *profile,
                                                         const gchar *datetime);
guint               gcm_profile_get_size                (GcmProfile *profile);
void                gcm_profile_set_size                (GcmProfile *profile,
                                                         guint size);
GcmProfileKind      gcm_profile_get_kind                (GcmProfile *profile);
void                gcm_profile_set_kind                (GcmProfile *profile,
                                                         GcmProfileKind kind);
GcmColorspace       gcm_profile_get_colorspace          (GcmProfile *profile);
void                gcm_profile_set_colorspace          (GcmProfile *profile,
                                                         GcmColorspace colorspace);
gboolean            gcm_profile_get_has_vcgt            (GcmProfile *profile);
void                gcm_profile_set_has_vcgt            (GcmProfile *profile,
                                                         gboolean has_vcgt);
gboolean            gcm_profile_has_colorspace_description
                                                        (GcmProfile *profile);

Object Hierarchy

  GObject
   +----GcmProfile

Properties

  "black"                    GcmXyz*               : Read / Write
  "blue"                     GcmXyz*               : Read / Write
  "can-delete"               gboolean              : Read
  "checksum"                 gchar*                : Read
  "colorspace"               guint                 : Read / Write
  "copyright"                gchar*                : Read / Write
  "datetime"                 gchar*                : Read / Write
  "description"              gchar*                : Read / Write
  "file"                     GFile*                : Read / Write
  "green"                    GcmXyz*               : Read / Write
  "has-vcgt"                 gboolean              : Read / Write
  "kind"                     guint                 : Read / Write
  "manufacturer"             gchar*                : Read / Write
  "model"                    gchar*                : Read / Write
  "red"                      GcmXyz*               : Read / Write
  "size"                     guint                 : Read / Write
  "white"                    GcmXyz*               : Read / Write

Description

This object is a simple parser for the ICC binary profile data. If only understands a subset of the ICC profile, just enought to get some metadata and the LUT.

Details

GcmProfilePrivate

typedef struct _GcmProfilePrivate GcmProfilePrivate;

Private GcmProfile data


GcmProfile

typedef struct _GcmProfile GcmProfile;


GcmProfileClass

typedef struct {
	GObjectClass	 parent_class;

	/* padding for future expansion */
	void (*_gcm_reserved1) (void);
	void (*_gcm_reserved2) (void);
	void (*_gcm_reserved3) (void);
	void (*_gcm_reserved4) (void);
	void (*_gcm_reserved5) (void);
} GcmProfileClass;


gcm_profile_new ()

GcmProfile *        gcm_profile_new                     (void);

Returns :

a new GcmProfile object.

Since 0.0.1


gcm_profile_parse ()

gboolean            gcm_profile_parse                   (GcmProfile *profile,
                                                         GFile *file,
                                                         GError **error);

Parses a profile filename, filling in all the details possible.

profile :

A valid GcmProfile

file :

A GFile pointing to a profile

error :

A GError, or NULL

Returns :

TRUE for success

Since 0.0.1


gcm_profile_parse_data ()

gboolean            gcm_profile_parse_data              (GcmProfile *profile,
                                                         const guint8 *data,
                                                         gsize length,
                                                         GError **error);

Parses profile data, filling in all the details possible.

profile :

A valid GcmProfile

data :

the data to parse

length :

the length of data

error :

A GError, or NULL

Returns :

TRUE for success

Since 0.0.1


gcm_profile_save ()

gboolean            gcm_profile_save                    (GcmProfile *profile,
                                                         const gchar *filename,
                                                         GError **error);

Saves the profile data to a file.

profile :

A valid GcmProfile

filename :

the data to parse

error :

A GError, or NULL

Returns :

TRUE for success

Since 0.0.1


gcm_profile_get_handle ()

gpointer            gcm_profile_get_handle              (GcmProfile *profile);

profile :

Returns :

Do not call cmsCloseProfile() on this value!

gcm_profile_get_checksum ()

const gchar *       gcm_profile_get_checksum            (GcmProfile *profile);

profile :

Returns :


gcm_profile_get_can_delete ()

gboolean            gcm_profile_get_can_delete          (GcmProfile *profile);

profile :

Returns :


gcm_profile_generate_vcgt ()

GcmClut *           gcm_profile_generate_vcgt           (GcmProfile *profile,
                                                         guint size);

Generates a VCGT table of a specified size.

profile :

A valid GcmProfile

size :

the size of the table to generate

Returns :

A GcmClut object, or NULL. Free with g_object_unref()

Since 0.0.1


gcm_profile_generate_curve ()

GcmClut *           gcm_profile_generate_curve          (GcmProfile *profile,
                                                         guint size);

Generates a curve of a specified size.

profile :

A valid GcmProfile

size :

the size of the curve to generate

Returns :

A GcmClut object, or NULL. Free with g_object_unref()

Since 0.0.1


gcm_profile_get_description ()

const gchar *       gcm_profile_get_description         (GcmProfile *profile);

Gets the profile description.

profile :

A valid GcmProfile

Returns :

The profile description as a string.

Since 0.0.1


gcm_profile_set_description ()

void                gcm_profile_set_description         (GcmProfile *profile,
                                                         const gchar *description);

Sets the description of the profile.

profile :

A valid GcmProfile

description :

the data location to read into

Since 0.0.1


gcm_profile_get_file ()

GFile *             gcm_profile_get_file                (GcmProfile *profile);

Gets the file attached to this profile.

profile :

A valid GcmProfile

Returns :

A GFile, or NULL. Do not free.

Since 0.0.1


gcm_profile_set_file ()

void                gcm_profile_set_file                (GcmProfile *profile,
                                                         GFile *file);

Sets the file to be used when reading the profile.

profile :

A valid GcmProfile

file :

A GFile to read

Since 0.0.1


gcm_profile_get_filename ()

const gchar *       gcm_profile_get_filename            (GcmProfile *profile);

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

profile :

A valid GcmProfile

Returns :

A filename, or NULL

Since 0.0.1


gcm_profile_get_copyright ()

const gchar *       gcm_profile_get_copyright           (GcmProfile *profile);

Gets the copyright string for this profile.

profile :

A valid GcmProfile

Returns :

A string. Do not free.

Since 0.0.1


gcm_profile_set_copyright ()

void                gcm_profile_set_copyright           (GcmProfile *profile,
                                                         const gchar *copyright);

Sets the copyright string.

profile :

A valid GcmProfile

copyright :

the copyright string

Since 0.0.1


gcm_profile_get_manufacturer ()

const gchar *       gcm_profile_get_manufacturer        (GcmProfile *profile);

Gets the device manufacturer name.

profile :

A valid GcmProfile

Returns :

A string. Do not free.

Since 0.0.1


gcm_profile_set_manufacturer ()

void                gcm_profile_set_manufacturer        (GcmProfile *profile,
                                                         const gchar *manufacturer);

Sets the device manufacturer name.

profile :

A valid GcmProfile

manufacturer :

the profile manufacturer.

Since 0.0.1


gcm_profile_get_model ()

const gchar *       gcm_profile_get_model               (GcmProfile *profile);

Gets the device model name.

profile :

A valid GcmProfile

Returns :

A string. Do not free.

Since 0.0.1


gcm_profile_set_model ()

void                gcm_profile_set_model               (GcmProfile *profile,
                                                         const gchar *model);

Sets the device model name.

profile :

A valid GcmProfile

model :

the profile model.

Since 0.0.1


gcm_profile_get_datetime ()

const gchar *       gcm_profile_get_datetime            (GcmProfile *profile);

Gets the profile date and time.

profile :

A valid GcmProfile

Returns :

A string. Do not free.

Since 0.0.1


gcm_profile_set_datetime ()

void                gcm_profile_set_datetime            (GcmProfile *profile,
                                                         const gchar *datetime);

Sets the profile date and time.

profile :

A valid GcmProfile

datetime :

the profile date time.

Since 0.0.1


gcm_profile_get_size ()

guint               gcm_profile_get_size                (GcmProfile *profile);

profile :

Returns :


gcm_profile_set_size ()

void                gcm_profile_set_size                (GcmProfile *profile,
                                                         guint size);

profile :

size :


gcm_profile_get_kind ()

GcmProfileKind      gcm_profile_get_kind                (GcmProfile *profile);

profile :

Returns :


gcm_profile_set_kind ()

void                gcm_profile_set_kind                (GcmProfile *profile,
                                                         GcmProfileKind kind);

profile :

kind :


gcm_profile_get_colorspace ()

GcmColorspace       gcm_profile_get_colorspace          (GcmProfile *profile);

profile :

Returns :


gcm_profile_set_colorspace ()

void                gcm_profile_set_colorspace          (GcmProfile *profile,
                                                         GcmColorspace colorspace);

profile :

colorspace :


gcm_profile_get_has_vcgt ()

gboolean            gcm_profile_get_has_vcgt            (GcmProfile *profile);

profile :

Returns :


gcm_profile_set_has_vcgt ()

void                gcm_profile_set_has_vcgt            (GcmProfile *profile,
                                                         gboolean has_vcgt);

profile :

has_vcgt :


gcm_profile_has_colorspace_description ()

gboolean            gcm_profile_has_colorspace_description
                                                        (GcmProfile *profile);

Finds out if the profile contains a colorspace description.

profile :

A valid GcmProfile

Returns :

TRUE if the description mentions the profile colorspace explicity, e.g. "Adobe RGB" for GCM_COLORSPACE_RGB.

Since 0.0.1

Property Details

The "black" property

  "black"                    GcmXyz*               : Read / Write


The "blue" property

  "blue"                     GcmXyz*               : Read / Write


The "can-delete" property

  "can-delete"               gboolean              : Read

Default value: FALSE


The "checksum" property

  "checksum"                 gchar*                : Read

Default value: NULL


The "colorspace" property

  "colorspace"               guint                 : Read / Write

Default value: 0


The "copyright" property

  "copyright"                gchar*                : Read / Write

Default value: NULL


The "datetime" property

  "datetime"                 gchar*                : Read / Write

Default value: NULL


The "description" property

  "description"              gchar*                : Read / Write

Default value: NULL


The "file" property

  "file"                     GFile*                : Read / Write


The "green" property

  "green"                    GcmXyz*               : Read / Write


The "has-vcgt" property

  "has-vcgt"                 gboolean              : Read / Write

Default value: FALSE


The "kind" property

  "kind"                     guint                 : Read / Write

Default value: 0


The "manufacturer" property

  "manufacturer"             gchar*                : Read / Write

Default value: NULL


The "model" property

  "model"                    gchar*                : Read / Write

Default value: NULL


The "red" property

  "red"                      GcmXyz*               : Read / Write


The "size" property

  "size"                     guint                 : Read / Write

Default value: 0


The "white" property

  "white"                    GcmXyz*               : Read / Write