diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 6 | ||||
-rw-r--r-- | gdk/gdkpixbuf-render.c | 34 |
8 files changed, 67 insertions, 9 deletions
@@ -1,3 +1,9 @@ +Wed Sep 19 16:12:16 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkpixbuf-render.c: Allow -1 for width/height + to mean "width/height of pixbuf" (Patch from Matthias Clasen, + #59723) + Wed Sep 19 16:01:27 2001 Owen Taylor <otaylor@redhat.com> Patch from Frank Belew #59037 for Solaris compilation. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 43f32d45d..3a0e49704 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Wed Sep 19 16:12:16 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkpixbuf-render.c: Allow -1 for width/height + to mean "width/height of pixbuf" (Patch from Matthias Clasen, + #59723) + Wed Sep 19 16:01:27 2001 Owen Taylor <otaylor@redhat.com> Patch from Frank Belew #59037 for Solaris compilation. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 43f32d45d..3a0e49704 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Wed Sep 19 16:12:16 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkpixbuf-render.c: Allow -1 for width/height + to mean "width/height of pixbuf" (Patch from Matthias Clasen, + #59723) + Wed Sep 19 16:01:27 2001 Owen Taylor <otaylor@redhat.com> Patch from Frank Belew #59037 for Solaris compilation. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 43f32d45d..3a0e49704 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Wed Sep 19 16:12:16 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkpixbuf-render.c: Allow -1 for width/height + to mean "width/height of pixbuf" (Patch from Matthias Clasen, + #59723) + Wed Sep 19 16:01:27 2001 Owen Taylor <otaylor@redhat.com> Patch from Frank Belew #59037 for Solaris compilation. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 43f32d45d..3a0e49704 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Wed Sep 19 16:12:16 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkpixbuf-render.c: Allow -1 for width/height + to mean "width/height of pixbuf" (Patch from Matthias Clasen, + #59723) + Wed Sep 19 16:01:27 2001 Owen Taylor <otaylor@redhat.com> Patch from Frank Belew #59037 for Solaris compilation. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 43f32d45d..3a0e49704 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Wed Sep 19 16:12:16 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkpixbuf-render.c: Allow -1 for width/height + to mean "width/height of pixbuf" (Patch from Matthias Clasen, + #59723) + Wed Sep 19 16:01:27 2001 Owen Taylor <otaylor@redhat.com> Patch from Frank Belew #59037 for Solaris compilation. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 43f32d45d..3a0e49704 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Wed Sep 19 16:12:16 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkpixbuf-render.c: Allow -1 for width/height + to mean "width/height of pixbuf" (Patch from Matthias Clasen, + #59723) + Wed Sep 19 16:01:27 2001 Owen Taylor <otaylor@redhat.com> Patch from Frank Belew #59037 for Solaris compilation. diff --git a/gdk/gdkpixbuf-render.c b/gdk/gdkpixbuf-render.c index 5a534be73..23c75121b 100644 --- a/gdk/gdkpixbuf-render.c +++ b/gdk/gdkpixbuf-render.c @@ -35,8 +35,8 @@ * @src_y: source Y coordinate. * @dest_x: Destination X coordinate. * @dest_y: Destination Y coordinate. - * @width: Width of region to threshold. - * @height: Height of region to threshold. + * @width: Width of region to threshold, or -1 to use pixbuf width + * @height: Height of region to threshold, or -1 to use pixbuf height * @alpha_threshold: Opacity values below this will be painted as zero; all * other values will be painted as one. * @@ -60,11 +60,16 @@ gdk_pixbuf_render_threshold_alpha (GdkPixbuf *pixbuf, int start, start_status; int status; - g_return_if_fail (pixbuf != NULL); + g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB); g_return_if_fail (pixbuf->n_channels == 3 || pixbuf->n_channels == 4); g_return_if_fail (pixbuf->bits_per_sample == 8); + if (width == -1) + width = pixbuf->width; + if (height == -1) + height = pixbuf->height; + g_return_if_fail (bitmap != NULL); g_return_if_fail (width >= 0 && height >= 0); g_return_if_fail (src_x >= 0 && src_x + width <= pixbuf->width); @@ -139,8 +144,8 @@ gdk_pixbuf_render_threshold_alpha (GdkPixbuf *pixbuf, * @src_y: Source Y coordinate within pixbuf. * @dest_x: Destination X coordinate within drawable. * @dest_y: Destination Y coordinate within drawable. - * @width: Width of region to render, in pixels. - * @height: Height of region to render, in pixels. + * @width: Width of region to render, in pixels, or -1 to use pixbuf width + * @height: Height of region to render, in pixels, or -1 to use pixbuf height * @dither: Dithering mode for GdkRGB. * @x_dither: X offset for dither. * @y_dither: Y offset for dither. @@ -171,7 +176,7 @@ gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf, int rowstride; guchar *buf; - g_return_if_fail (pixbuf != NULL); + g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB); g_return_if_fail (pixbuf->n_channels == 3 || pixbuf->n_channels == 4); g_return_if_fail (pixbuf->bits_per_sample == 8); @@ -179,6 +184,11 @@ gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf, g_return_if_fail (drawable != NULL); g_return_if_fail (gc != NULL); + if (width == -1) + width = pixbuf->width; + if (height == -1) + height = pixbuf->height; + g_return_if_fail (width >= 0 && height >= 0); g_return_if_fail (src_x >= 0 && src_x + width <= pixbuf->width); g_return_if_fail (src_y >= 0 && src_y + height <= pixbuf->height); @@ -225,8 +235,8 @@ gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf, * @src_y: Source Y coordinates within pixbuf. * @dest_x: Destination X coordinate within drawable. * @dest_y: Destination Y coordinate within drawable. - * @width: Width of region to render, in pixels. - * @height: Height of region to render, in pixels. + * @width: Width of region to render, in pixels, or -1 to use pixbuf width. + * @height: Height of region to render, in pixels, or -1 to use pixbuf height. * @alpha_mode: If the image does not have opacity information, this is ignored. * Otherwise, specifies how to handle transparency when rendering. * @alpha_threshold: If the image does have opacity information and @alpha_mode @@ -271,12 +281,18 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf, GdkRegion *drect; GdkRectangle tmp_rect; - g_return_if_fail (pixbuf != NULL); + g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB); g_return_if_fail (pixbuf->n_channels == 3 || pixbuf->n_channels == 4); g_return_if_fail (pixbuf->bits_per_sample == 8); g_return_if_fail (drawable != NULL); + + if (width == -1) + width = pixbuf->width; + if (height == -1) + height = pixbuf->height; + g_return_if_fail (width >= 0 && height >= 0); g_return_if_fail (src_x >= 0 && src_x + width <= pixbuf->width); g_return_if_fail (src_y >= 0 && src_y + height <= pixbuf->height); |