diff options
-rw-r--r-- | eel/eel-graphic-effects.c | 59 | ||||
-rw-r--r-- | eel/eel-graphic-effects.h | 15 |
2 files changed, 1 insertions, 73 deletions
diff --git a/eel/eel-graphic-effects.c b/eel/eel-graphic-effects.c index b193a0fa7..8bb4a5326 100644 --- a/eel/eel-graphic-effects.c +++ b/eel/eel-graphic-effects.c @@ -105,63 +105,6 @@ eel_create_spotlight_pixbuf (GdkPixbuf* src) return dest; } - -/* the following routine was stolen from the panel to darken a pixbuf, by manipulating the saturation */ - -/* saturation is 0-255, darken is 0-255 */ - -GdkPixbuf * -eel_create_darkened_pixbuf (GdkPixbuf *src, int saturation, int darken) -{ - gint i, j; - gint width, height, src_row_stride, dest_row_stride; - gboolean has_alpha; - guchar *target_pixels, *original_pixels; - guchar *pixsrc, *pixdest; - guchar intensity; - guchar alpha; - guchar negalpha; - guchar r, g, b; - GdkPixbuf *dest; - - 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) - || (gdk_pixbuf_get_has_alpha (src) - && gdk_pixbuf_get_n_channels (src) == 4), NULL); - g_return_val_if_fail (gdk_pixbuf_get_bits_per_sample (src) == 8, NULL); - - dest = create_new_pixbuf (src); - - has_alpha = gdk_pixbuf_get_has_alpha (src); - width = gdk_pixbuf_get_width (src); - height = gdk_pixbuf_get_height (src); - dest_row_stride = gdk_pixbuf_get_rowstride (dest); - src_row_stride = gdk_pixbuf_get_rowstride (src); - target_pixels = gdk_pixbuf_get_pixels (dest); - original_pixels = gdk_pixbuf_get_pixels (src); - - for (i = 0; i < height; i++) { - pixdest = target_pixels + i * dest_row_stride; - pixsrc = original_pixels + i * src_row_stride; - for (j = 0; j < width; j++) { - r = *pixsrc++; - g = *pixsrc++; - b = *pixsrc++; - intensity = (r * 77 + g * 150 + b * 28) >> 8; - negalpha = ((255 - saturation) * darken) >> 8; - alpha = (saturation * darken) >> 8; - *pixdest++ = (negalpha * intensity + alpha * r) >> 8; - *pixdest++ = (negalpha * intensity + alpha * g) >> 8; - *pixdest++ = (negalpha * intensity + alpha * b) >> 8; - if (has_alpha) { - *pixdest++ = *pixsrc++; - } - } - } - return dest; -} - /* this routine colorizes the passed-in pixbuf by multiplying each pixel with the passed in color */ GdkPixbuf * @@ -246,7 +189,7 @@ draw_frame_column (GdkPixbuf *frame_image, int target_height, int source_height, } } -GdkPixbuf * +static GdkPixbuf * eel_stretch_frame_image (GdkPixbuf *frame_image, int left_offset, int top_offset, int right_offset, int bottom_offset, int dest_width, int dest_height, gboolean fill_flag) { diff --git a/eel/eel-graphic-effects.h b/eel/eel-graphic-effects.h index b8d8b32fd..2fe6fabea 100644 --- a/eel/eel-graphic-effects.h +++ b/eel/eel-graphic-effects.h @@ -31,25 +31,10 @@ /* return a lightened pixbuf for pre-lighting */ GdkPixbuf *eel_create_spotlight_pixbuf (GdkPixbuf *source_pixbuf); -/* return a darkened pixbuf for selection hiliting */ -GdkPixbuf *eel_create_darkened_pixbuf (GdkPixbuf *source_pixbuf, - int saturation, - int darken); - /* return a pixbuf colorized with the color specified by the parameters */ GdkPixbuf* eel_create_colorized_pixbuf (GdkPixbuf *source_pixbuf, GdkRGBA *color); -/* stretch a image frame */ -GdkPixbuf *eel_stretch_frame_image (GdkPixbuf *frame_image, - int left_offset, - int top_offset, - int right_offset, - int bottom_offset, - int dest_width, - int dest_height, - gboolean fill_flag); - /* embed in image in a frame */ GdkPixbuf *eel_embed_image_in_frame (GdkPixbuf *source_image, GdkPixbuf *frame_image, |