[nautilus] eel: remove unused eel_pixbuf_render()
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] eel: remove unused eel_pixbuf_render()
- Date: Thu, 20 Jan 2011 11:59:14 +0000 (UTC)
commit f58a70a92a83f8979f43ed84fd79d9b764e6d7c6
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Jan 20 12:57:43 2011 +0100
eel: remove unused eel_pixbuf_render()
eel/eel-gdk-pixbuf-extensions.c | 104 ---------------------------------------
eel/eel-gdk-pixbuf-extensions.h | 10 ----
2 files changed, 0 insertions(+), 114 deletions(-)
---
diff --git a/eel/eel-gdk-pixbuf-extensions.c b/eel/eel-gdk-pixbuf-extensions.c
index f27340a..3a7fe9d 100644
--- a/eel/eel-gdk-pixbuf-extensions.c
+++ b/eel/eel-gdk-pixbuf-extensions.c
@@ -119,107 +119,3 @@ eel_gdk_pixbuf_load_from_stream_at_size (GInputStream *stream,
return pixbuf;
}
-static guchar
-eel_gdk_pixbuf_lighten_pixbuf_component (guchar cur_value,
- guint lighten_value)
-{
- int new_value = cur_value;
- if (lighten_value > 0) {
- new_value += lighten_value + (new_value >> 3);
- if (new_value > 255) {
- new_value = 255;
- }
- }
- return (guchar) new_value;
-}
-
-static GdkPixbuf *
-eel_gdk_pixbuf_lighten (GdkPixbuf* src,
- guint lighten_value)
-{
- GdkPixbuf *dest;
- int i, j;
- int width, height, has_alpha, src_row_stride, dst_row_stride;
- guchar *target_pixels, *original_pixels;
- guchar *pixsrc, *pixdest;
-
- 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));
- g_assert (gdk_pixbuf_get_bits_per_sample (src) == 8);
-
- dest = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (src),
- gdk_pixbuf_get_has_alpha (src),
- gdk_pixbuf_get_bits_per_sample (src),
- gdk_pixbuf_get_width (src),
- gdk_pixbuf_get_height (src));
-
- has_alpha = gdk_pixbuf_get_has_alpha (src);
- width = gdk_pixbuf_get_width (src);
- height = gdk_pixbuf_get_height (src);
- dst_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 * dst_row_stride;
- pixsrc = original_pixels + i * src_row_stride;
- for (j = 0; j < width; j++) {
- *pixdest++ = eel_gdk_pixbuf_lighten_pixbuf_component (*pixsrc++, lighten_value);
- *pixdest++ = eel_gdk_pixbuf_lighten_pixbuf_component (*pixsrc++, lighten_value);
- *pixdest++ = eel_gdk_pixbuf_lighten_pixbuf_component (*pixsrc++, lighten_value);
- if (has_alpha) {
- *pixdest++ = *pixsrc++;
- }
- }
- }
- return dest;
-}
-
-GdkPixbuf *
-eel_gdk_pixbuf_render (GdkPixbuf *pixbuf,
- guint render_mode,
- guint saturation,
- guint brightness,
- guint lighten_value,
- GdkRGBA *color)
-{
- GdkPixbuf *temp_pixbuf, *old_pixbuf;
-
- if (render_mode == 1) {
- /* lighten icon */
- temp_pixbuf = eel_create_spotlight_pixbuf (pixbuf);
- }
- else if (render_mode == 2) {
- /* colorize icon */
- temp_pixbuf = eel_create_colorized_pixbuf (pixbuf, color);
- } else if (render_mode == 3) {
- /* monochromely colorize icon */
- old_pixbuf = eel_create_darkened_pixbuf (pixbuf, 0, 255);
- temp_pixbuf = eel_create_colorized_pixbuf (old_pixbuf, color);
- g_object_unref (old_pixbuf);
- } else {
- temp_pixbuf = NULL;
- }
-
- if (saturation < 255 || brightness < 255 || temp_pixbuf == NULL) { // temp_pixbuf == NULL just for safer code (return copy)
- old_pixbuf = temp_pixbuf;
- temp_pixbuf = eel_create_darkened_pixbuf (temp_pixbuf ? temp_pixbuf : pixbuf, saturation, brightness);
- if (old_pixbuf) {
- g_object_unref (old_pixbuf);
- }
- }
-
- if (lighten_value > 0) {
- old_pixbuf = temp_pixbuf;
- temp_pixbuf = eel_gdk_pixbuf_lighten (temp_pixbuf ? temp_pixbuf : pixbuf, lighten_value);
- if (old_pixbuf) {
- g_object_unref (old_pixbuf);
- }
- }
-
- return temp_pixbuf;
-}
diff --git a/eel/eel-gdk-pixbuf-extensions.h b/eel/eel-gdk-pixbuf-extensions.h
index dc93abc..2601871 100644
--- a/eel/eel-gdk-pixbuf-extensions.h
+++ b/eel/eel-gdk-pixbuf-extensions.h
@@ -29,18 +29,8 @@
#include <gdk/gdk.h>
#include <gio/gio.h>
-#define EEL_OPACITY_FULLY_TRANSPARENT 0
-#define EEL_OPACITY_FULLY_OPAQUE 255
-
/* Loading a GdkPixbuf with a URI. */
GdkPixbuf * eel_gdk_pixbuf_load_from_stream_at_size (GInputStream *stream,
int size);
-GdkPixbuf * eel_gdk_pixbuf_render (GdkPixbuf *pixbuf,
- guint render_mode,
- guint saturation,
- guint brightness,
- guint lighten_value,
- GdkRGBA *color);
-
#endif /* EEL_GDK_PIXBUF_EXTENSIONS_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]