[gtk+/color-management: 1/6] Add GtkColorProfile which is a high level abstraction of a color profile suitable for color manageme
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/color-management: 1/6] Add GtkColorProfile which is a high level abstraction of a color profile suitable for color manageme
- Date: Tue, 2 Mar 2010 14:19:27 +0000 (UTC)
commit 0ceb1b2afde9461fed51bdb2d464352c8c220990
Author: Richard Hughes <richard hughsie com>
Date: Tue Mar 2 14:01:20 2010 +0000
Add GtkColorProfile which is a high level abstraction of a color profile suitable for color management
Typically this will be an ICC profile loaded from disk, or embedded in a source
image. A color profile will allow you to change the colors of the image either to
correctly render the colors on a given output device, or to deliberatly
change the colors e.g. introducing a sepia effect on photographs.
gtk/Makefile.am | 2 +
gtk/gtk.h | 1 +
gtk/gtkcolorprofile.c | 60 ++++++++++++++++++++++++++++++++++++++++++++
gtk/gtkcolorprofile.h | 66 +++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 129 insertions(+), 0 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 291cbf2..023d4ae 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -196,6 +196,7 @@ gtk_public_h_sources = \
gtkcheckmenuitem.h \
gtkclipboard.h \
gtkcolorbutton.h \
+ gtkcolorprofile.h \
gtkcolorsel.h \
gtkcolorseldialog.h \
gtkcombobox.h \
@@ -453,6 +454,7 @@ gtk_base_c_sources = \
gtkcheckbutton.c \
gtkcheckmenuitem.c \
gtkcolorbutton.c \
+ gtkcolorprofile.c \
gtkcolorsel.c \
gtkcolorseldialog.c \
gtkcombobox.c \
diff --git a/gtk/gtk.h b/gtk/gtk.h
index bbeabae..5b3c7c9 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -67,6 +67,7 @@
#include <gtk/gtkcheckmenuitem.h>
#include <gtk/gtkclipboard.h>
#include <gtk/gtkcolorbutton.h>
+#include <gtk/gtkcolorprofile.h>
#include <gtk/gtkcolorsel.h>
#include <gtk/gtkcolorseldialog.h>
#include <gtk/gtkcombobox.h>
diff --git a/gtk/gtkcolorprofile.c b/gtk/gtkcolorprofile.c
new file mode 100644
index 0000000..7a1bb4b
--- /dev/null
+++ b/gtk/gtkcolorprofile.c
@@ -0,0 +1,60 @@
+/* GTK - The GIMP Toolkit
+ *
+ * Copyright (C) 2010 Richard Hughes <richard hughsie com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * SECTION:gtk-color-profile
+ * @short_description: Base class for implementing ICC color profiles
+ * @include: gtk/gtk.h
+ * @title: GtkColorProfile
+ * @see_also: #GtkColorTransform, #GtkColorProfile
+ *
+ * #GtkColorProfile is a high level abstraction of a color profile. Typically
+ * this will be an ICC profile loaded from disk, or embedded in a source image.
+ * A color profile will allow you to change the colors of the image either to
+ * correctly render the colors on a given output device, or to deliberatly
+ * change the colors e.g. introducing a sepia effect on photographs.
+ *
+ * To construct a #GtkColorProfile, you have to get an instance of
+ * #GtkColorEngine, and then call gtk_color_engine_create_profile().
+ *
+ * You cannot create "empty" #GtkColorProfile objects, you always have to
+ * create them from ICC data.
+ */
+
+#include "config.h"
+
+#include "gtkcolorprofile.h"
+
+G_DEFINE_TYPE (GtkColorProfile, gtk_color_profile, G_TYPE_OBJECT)
+
+static void
+gtk_color_profile_class_init (GtkColorProfileClass *klass)
+{
+}
+
+static void
+gtk_color_profile_init (GtkColorProfile *color_profile)
+{
+}
+
+#define __GTK_COLOR_PROFILE_C__
+#include "gtkaliasdef.c"
diff --git a/gtk/gtkcolorprofile.h b/gtk/gtkcolorprofile.h
new file mode 100644
index 0000000..41267cc
--- /dev/null
+++ b/gtk/gtkcolorprofile.h
@@ -0,0 +1,66 @@
+/* GTK - The GIMP Toolkit
+ *
+ * Copyright (C) 2010 Richard Hughes <richard hughsie com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#ifndef __GTK_COLOR_PROFILE_H
+#define __GTK_COLOR_PROFILE_H
+
+#include <glib-object.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_COLOR_PROFILE (gtk_color_profile_get_type ())
+#define GTK_COLOR_PROFILE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_COLOR_PROFILE, GtkColorProfile))
+#define GTK_COLOR_PROFILE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GTK_TYPE_COLOR_PROFILE, GtkColorProfileClass))
+#define GTK_IS_COLOR_PROFILE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_COLOR_PROFILE))
+#define GTK_IS_COLOR_PROFILE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_COLOR_PROFILE))
+#define GTK_COLOR_PROFILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_COLOR_PROFILE, GtkColorProfileClass))
+
+typedef struct _GtkColorProfilePrivate GtkColorProfilePrivate;
+typedef struct _GtkColorProfile GtkColorProfile;
+typedef struct _GtkColorProfileClass GtkColorProfileClass;
+
+struct _GtkColorProfile
+{
+ GObject parent;
+ GtkColorProfilePrivate *priv;
+};
+
+struct _GtkColorProfileClass
+{
+ GObjectClass parent_class;
+ /* padding for future expansion */
+ void (*_gtk_reserved1) (void);
+ void (*_gtk_reserved2) (void);
+ void (*_gtk_reserved3) (void);
+ void (*_gtk_reserved4) (void);
+ void (*_gtk_reserved5) (void);
+};
+
+GType gtk_color_profile_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __GTK_COLOR_PROFILE_H */
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]