diff options
author | Jasmine Hassan <[email protected]> | 2012-10-18 16:23:26 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-11-14 09:42:33 +0200 |
commit | 739bd11c7853e0e760c2373d44ff934729e5cbe0 (patch) | |
tree | bfb0da68fbee3369af410d18d6a7986aa8ac1faa /eel/eel-graphic-effects.c | |
parent | f61503852a1ba50b0a258438e7ce3ca4c7545f45 (diff) | |
download | caja-739bd11c7853e0e760c2373d44ff934729e5cbe0.tar.bz2 caja-739bd11c7853e0e760c2373d44ff934729e5cbe0.tar.xz |
[eel] remove unused eel_make_semitransparent()
http://git.gnome.org/browse/nautilus/commit/?id=48c6012e89fb1362e418d4bf56c05614f1515eab
Diffstat (limited to 'eel/eel-graphic-effects.c')
-rw-r--r-- | eel/eel-graphic-effects.c | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/eel/eel-graphic-effects.c b/eel/eel-graphic-effects.c index b234b914..ffb5beba 100644 --- a/eel/eel-graphic-effects.c +++ b/eel/eel-graphic-effects.c @@ -47,22 +47,6 @@ create_new_pixbuf (GdkPixbuf *src) gdk_pixbuf_get_height (src)); } -static GdkPixbuf * -create_new_pixbuf_with_alpha (GdkPixbuf *src) -{ - g_assert (gdk_pixbuf_get_colorspace (src) == GDK_COLORSPACE_RGB); - g_assert ((!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)); - - return gdk_pixbuf_new (gdk_pixbuf_get_colorspace (src), - TRUE, - gdk_pixbuf_get_bits_per_sample (src), - gdk_pixbuf_get_width (src), - gdk_pixbuf_get_height (src)); -} - /* utility routine to bump the level of a color component with pinning */ static guchar @@ -351,71 +335,3 @@ eel_embed_image_in_frame (GdkPixbuf *source_image, GdkPixbuf *frame_image, int l return result_pixbuf; } - -/* this routine takes the source pixbuf and returns a new one that's semi-transparent, by - clearing every other pixel's alpha value in a checkerboard grip. We have to do the - checkerboard instead of reducing the alpha since it will be turned into an alpha-less - gdkpixmap and mask for the actual dragging */ - -GdkPixbuf * -eel_make_semi_transparent (GdkPixbuf *src) -{ - gint i, j, temp_alpha; - gint width, height, has_alpha, src_row_stride, dst_row_stride; - guchar *target_pixels, *original_pixels; - guchar *pixsrc, *pixdest; - guchar alpha_value; - GdkPixbuf *dest_pixbuf; - guchar start_alpha_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) - || (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_pixbuf = create_new_pixbuf_with_alpha (src); - - has_alpha = gdk_pixbuf_get_has_alpha (src); - width = gdk_pixbuf_get_width (src); - height = gdk_pixbuf_get_height (src); - src_row_stride = gdk_pixbuf_get_rowstride (src); - dst_row_stride = gdk_pixbuf_get_rowstride (dest_pixbuf); - - /* set up pointers to the actual pixels */ - target_pixels = gdk_pixbuf_get_pixels (dest_pixbuf); - original_pixels = gdk_pixbuf_get_pixels (src); - - /* loop through the pixels to do the actual work, copying from the source to the destination */ - start_alpha_value = ~0; - for (i = 0; i < height; i++) - { - pixdest = target_pixels + i * dst_row_stride; - pixsrc = original_pixels + i * src_row_stride; - alpha_value = start_alpha_value; - for (j = 0; j < width; j++) - { - *pixdest++ = *pixsrc++; /* red */ - *pixdest++ = *pixsrc++; /* green */ - *pixdest++ = *pixsrc++; /* blue */ - - if (has_alpha) - { - temp_alpha = *pixsrc++; - } - else - { - temp_alpha = ~0; - } - *pixdest++ = temp_alpha & alpha_value; - - alpha_value = ~alpha_value; - } - - start_alpha_value = ~start_alpha_value; - } - - return dest_pixbuf; -} - |