Re: GDK: fast image scaling - how?



        This is the most basic methid I know.
(You probably want GDK_INTERP_NEAREST
but GDK_INTERP_HYPER is working good
for me with downscaling).


Cheers,
                -Tristan

****** extract from gdk-pixbuf.h *********

/* Interpolation modes */
typedef enum {
        GDK_INTERP_NEAREST,
        GDK_INTERP_TILES,
        GDK_INTERP_BILINEAR,
        GDK_INTERP_HYPER
} GdkInterpType;


GdkPixbuf *gdk_pixbuf_scale_simple           (const GdkPixbuf *src,
                                              int              dest_width,
                                              int              dest_height,
                                              GdkInterpType    interp_type);

******* end extract *********

RevX gmx at wrote:

Hi,

I'm using gtk+ 1.2 and want to display some image data by using GDK. The
image is already in memory but I want it to display at half size only (in each
axis). Is there already a function that can do that ("scale down")? And if
not, what would be the best (=fastest working) approach to it? (Btw, Gnome is
not installed if there are any libraries for this).

A second, related problem is, that I want to take a part of the original
image and scale it up by a factor of 2 (like a magnifying glass). Now, is that
the same problem as above or is it more simple to achieve?

Btw, the up and down scaling hasn't to be of good quality (no anti-aliasing,
etc.), simple pixel cutting/duplicating is fine. The image I have is an 8bit
grayscale image (748x576).

Thanks for helping in advance!
Michael.

--
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]