summaryrefslogtreecommitdiffstats
path: root/src/display/cairo-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/display/cairo-utils.h')
-rw-r--r--src/display/cairo-utils.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/display/cairo-utils.h b/src/display/cairo-utils.h
index e67872891..d240545eb 100644
--- a/src/display/cairo-utils.h
+++ b/src/display/cairo-utils.h
@@ -15,6 +15,7 @@
#include <glib.h>
#include <cairomm/cairomm.h>
#include <2geom/forward.h>
+#include "style.h"
struct SPColor;
struct _GdkPixbuf;
@@ -81,6 +82,17 @@ public:
} // namespace Inkscape
+/**
+ * Key for cairo_surface_t to keep track of current color interpolation value
+ * Only the address of the structure is used, it is never initialized. See:
+ * http://www.cairographics.org/manual/cairo-Types.html#cairo-user-data-key-t
+ */
+static cairo_user_data_key_t ci_key;
+SPColorInterpolation get_cairo_surface_ci(cairo_surface_t *surface);
+void set_cairo_surface_ci(cairo_surface_t *surface, SPColorInterpolation cif);
+void copy_cairo_surface_ci(cairo_surface_t *in, cairo_surface_t *out);
+void convert_cairo_surface_ci(cairo_surface_t *surface, SPColorInterpolation cif);
+
void ink_cairo_set_source_color(cairo_t *ct, SPColor const &color, double opacity);
void ink_cairo_set_source_rgba32(cairo_t *ct, guint32 rgba);
void ink_cairo_transform(cairo_t *ct, Geom::Affine const &m);
@@ -102,6 +114,9 @@ guint32 ink_cairo_surface_average_color(cairo_surface_t *surface);
void ink_cairo_surface_average_color(cairo_surface_t *surface, double &r, double &g, double &b, double &a);
void ink_cairo_surface_average_color_premul(cairo_surface_t *surface, double &r, double &g, double &b, double &a);
+int ink_cairo_surface_srgb_to_linear(cairo_surface_t *surface);
+int ink_cairo_surface_linear_to_srgb(cairo_surface_t *surface);
+
cairo_pattern_t *ink_cairo_pattern_create_checkerboard();
void convert_pixels_pixbuf_to_argb32(guchar *data, int w, int h, int rs);