[gimp] libgimpcolor: add API docs to gimplcms.c
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpcolor: add API docs to gimplcms.c
- Date: Thu, 7 May 2015 00:01:21 +0000 (UTC)
commit e01f067332ea7b96f9bc9866c6b863c2f8eb1e19
Author: Michael Natterer <mitch gimp org>
Date: Thu May 7 02:00:33 2015 +0200
libgimpcolor: add API docs to gimplcms.c
libgimpcolor/gimplcms.c | 145 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 145 insertions(+), 0 deletions(-)
---
diff --git a/libgimpcolor/gimplcms.c b/libgimpcolor/gimplcms.c
index 3720982..0335e24 100644
--- a/libgimpcolor/gimplcms.c
+++ b/libgimpcolor/gimplcms.c
@@ -46,6 +46,14 @@
* Definitions and Functions relating to LCMS.
**/
+/**
+ * GimpColorProfile:
+ *
+ * Simply a typedef to #gpointer, but actually is a cmsHPROFILE. It's
+ * used in public GIMP APIs in order to avoid having to include LCMS
+ * headers.
+ **/
+
#define GIMP_LCMS_MD5_DIGEST_LENGTH 16
@@ -61,6 +69,18 @@ gimp_lcms_error_quark (void)
return quark;
}
+/**
+ * gimp_lcms_profile_open_from_file:
+ * @file: a #GFile
+ * @error: return location for #GError
+ *
+ * This function opens an ICC color profile from @file.
+ *
+ * Return value: the #GimpColorProfile, or %NULL. On error, %NULL is
+ * returned and @error is set.
+ *
+ * Since: GIMP 2.10
+ **/
GimpColorProfile
gimp_lcms_profile_open_from_file (GFile *file,
GError **error)
@@ -135,6 +155,19 @@ gimp_lcms_profile_open_from_file (GFile *file,
return profile;
}
+/**
+ * gimp_lcms_profile_open_from_data:
+ * @data: pointer to memory containing an ICC profile
+ * @length: lenght of the profile in memory, in bytes
+ * @error: return location for #GError
+ *
+ * This function opens an ICC color profile from memory. On error,
+ * %NULL is returned and @error is set.
+ *
+ * Return value: the #GimpColorProfile, or %NULL.
+ *
+ * Since: GIMP 2.10
+ **/
GimpColorProfile
gimp_lcms_profile_open_from_data (const guint8 *data,
gsize length,
@@ -155,6 +188,20 @@ gimp_lcms_profile_open_from_data (const guint8 *data,
return profile;
}
+/**
+ * gimp_lcms_profile_dave_to_data:
+ * @profile: a #GimpColorProfile
+ * @length: return location for the number of bytes written
+ * @error: return location for #GError
+ *
+ * This function saves @profile to an ICC color profile in newly
+ * allocated memory. On error, %NULL is returned and @error is set.
+ *
+ * Return value: a pointer to the written IIC profile in memory, or
+ * %NULL. Free with g_free().
+ *
+ * Since: GIMP 2.10
+ **/
guint8 *
gimp_lcms_profile_save_to_data (GimpColorProfile profile,
gsize *length,
@@ -186,6 +233,14 @@ gimp_lcms_profile_save_to_data (GimpColorProfile profile,
return NULL;
}
+/**
+ * gimp_lcms_profile_close:
+ * @profile: a #GimpColorProfile
+ *
+ * This function closes a #GimpColorProfile and frees its memory.
+ *
+ * Since: GIMP 2.10
+ **/
void
gimp_lcms_profile_close (GimpColorProfile profile)
{
@@ -220,30 +275,78 @@ gimp_lcms_profile_get_info (GimpColorProfile profile,
return text;
}
+/**
+ * gimp_lcms_profile_get_description:
+ * @profile: a #GimpColorProfile
+ *
+ * Return value: a newly allocated string containing @profile's
+ * description. Free with g_free().
+ *
+ * Since: GIMP 2.10
+ **/
gchar *
gimp_lcms_profile_get_description (GimpColorProfile profile)
{
return gimp_lcms_profile_get_info (profile, cmsInfoDescription);
}
+/**
+ * gimp_lcms_profile_get_manufacturer:
+ * @profile: a #GimpColorProfile
+ *
+ * Return value: a newly allocated string containing @profile's
+ * manufacturer. Free with g_free().
+ *
+ * Since: GIMP 2.10
+ **/
gchar *
gimp_lcms_profile_get_manufacturer (GimpColorProfile profile)
{
return gimp_lcms_profile_get_info (profile, cmsInfoManufacturer);
}
+/**
+ * gimp_lcms_profile_get_model:
+ * @profile: a #GimpColorProfile
+ *
+ * Return value: a newly allocated string containing @profile's
+ * model. Free with g_free().
+ *
+ * Since: GIMP 2.10
+ **/
gchar *
gimp_lcms_profile_get_model (GimpColorProfile profile)
{
return gimp_lcms_profile_get_info (profile, cmsInfoModel);
}
+/**
+ * gimp_lcms_profile_get_copyright:
+ * @profile: a #GimpColorProfile
+ *
+ * Return value: a newly allocated string containing @profile's
+ * copyright. Free with g_free().
+ *
+ * Since: GIMP 2.10
+ **/
gchar *
gimp_lcms_profile_get_copyright (GimpColorProfile profile)
{
return gimp_lcms_profile_get_info (profile, cmsInfoCopyright);
}
+/**
+ * gimp_lcms_profile_get_label:
+ * @profile: a #GimpColorProfile
+ *
+ * This function returns a newly allocated string containing
+ * @profile's "title", a string that can be used to label the profile
+ * in a user interface.
+ *
+ * Return value: the @profile's label. Free with g_free().
+ *
+ * Since: GIMP 2.10
+ **/
gchar *
gimp_lcms_profile_get_label (GimpColorProfile profile)
{
@@ -274,6 +377,19 @@ gimp_lcms_profile_get_label (GimpColorProfile profile)
return label;
}
+/**
+ * gimp_lcms_profile_get_summary:
+ * @profile: a #GimpColorProfile
+ *
+ * This function return a newly allocated string containing a
+ * multi-line summary of @profile's description, model, manufacturer
+ * and copyright, to be used as detailled information about the
+ * prpfile in a user interface.
+ *
+ * Return value: the @profile's summary. Free with g_free().
+ *
+ * Since: GIMP 2.10
+ **/
gchar *
gimp_lcms_profile_get_summary (GimpColorProfile profile)
{
@@ -321,6 +437,17 @@ gimp_lcms_profile_get_summary (GimpColorProfile profile)
return g_string_free (string, FALSE);
}
+/**
+ * gimp_lcms_profile_is_equal:
+ * @profile1: a #GimpColorProfile
+ * @profile2: a #GimpColorProfile
+ *
+ * Compares two profiles.
+ *
+ * Return value: %TRUE if the profiles are equal, %FALSE otherwise.
+ *
+ * Since: GIMP 2.10
+ **/
gboolean
gimp_lcms_profile_is_equal (GimpColorProfile profile1,
GimpColorProfile profile2)
@@ -343,6 +470,15 @@ gimp_lcms_profile_is_equal (GimpColorProfile profile1,
return (memcmp (digest1, digest2, GIMP_LCMS_MD5_DIGEST_LENGTH) == 0);
}
+/**
+ * gimp_lcms_profile_is_rgb:
+ * @profile: a #GimpColorProfile
+ *
+ * Return value: %TRUE if the profile's color space is RGB, %FALSE
+ * otherwise.
+ *
+ * Since: GIMP 2.10
+ **/
gboolean
gimp_lcms_profile_is_rgb (GimpColorProfile profile)
{
@@ -351,6 +487,15 @@ gimp_lcms_profile_is_rgb (GimpColorProfile profile)
return (cmsGetColorSpace (profile) == cmsSigRgbData);
}
+/**
+ * gimp_lcms_profile_is_cmyk:
+ * @profile: a #GimpColorProfile
+ *
+ * Return value: %TRUE if the profile's color space is CMYK, %FALSE
+ * otherwise.
+ *
+ * Since: GIMP 2.10
+ **/
gboolean
gimp_lcms_profile_is_cmyk (GimpColorProfile profile)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]