diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2010-12-06 15:37:36 +0100 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2010-12-06 15:37:36 +0100 |
commit | 020adaf997cc63a2b78ccb21c34b7f7f5244008e (patch) | |
tree | bb1acdc9bb294bb801b27c883822d09ae74fcbb6 /eel/eel-graphic-effects.c | |
parent | d6e07c7803b3d70968e7a37bcf1ef730b8ca4bac (diff) | |
download | nautilus-020adaf997cc63a2b78ccb21c34b7f7f5244008e.tar.gz |
eel-gdk-pixbuf: use GdkRGBA everywhere
Diffstat (limited to 'eel/eel-graphic-effects.c')
-rw-r--r-- | eel/eel-graphic-effects.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/eel/eel-graphic-effects.c b/eel/eel-graphic-effects.c index 0dc40d207..ad25dd7c4 100644 --- a/eel/eel-graphic-effects.c +++ b/eel/eel-graphic-effects.c @@ -26,7 +26,10 @@ and selection hilighting */ #include <config.h> + #include "eel-graphic-effects.h" +#include "eel-glib-extensions.h" + #include <string.h> /* shared utility to create a new pixbuf from the passed-in one */ @@ -162,9 +165,7 @@ eel_create_darkened_pixbuf (GdkPixbuf *src, int saturation, int darken) GdkPixbuf * eel_create_colorized_pixbuf (GdkPixbuf *src, - int red_value, - int green_value, - int blue_value) + GdkRGBA *color) { int i, j; int width, height, has_alpha, src_row_stride, dst_row_stride; @@ -173,7 +174,8 @@ eel_create_colorized_pixbuf (GdkPixbuf *src, guchar *pixsrc; guchar *pixdest; GdkPixbuf *dest; - + gint red_value, green_value, blue_value; + g_return_val_if_fail (gdk_pixbuf_get_colorspace (src) == GDK_COLORSPACE_RGB, NULL); g_return_val_if_fail ((!gdk_pixbuf_get_has_alpha (src) && gdk_pixbuf_get_n_channels (src) == 3) @@ -181,6 +183,10 @@ eel_create_colorized_pixbuf (GdkPixbuf *src, && gdk_pixbuf_get_n_channels (src) == 4), NULL); g_return_val_if_fail (gdk_pixbuf_get_bits_per_sample (src) == 8, NULL); + red_value = eel_round (color->red * 255); + green_value = eel_round (color->green * 255); + blue_value = eel_round (color->blue * 255); + dest = create_new_pixbuf (src); has_alpha = gdk_pixbuf_get_has_alpha (src); |