diff options
author | John Hawthorn <jhawthor@uvic.ca> | 2009-02-17 00:30:07 -0800 |
---|---|---|
committer | John Hawthorn <jhawthor@uvic.ca> | 2009-02-17 00:30:07 -0800 |
commit | a55738cf6d32e1d18a3c793df3c6c2797c25ebfa (patch) | |
tree | 19d87e4038c462c0786de9eff91dcddd8ada2003 /src/xlib.c | |
parent | 7ef59ee989938c85e9cd3890c70e83309c9bf442 (diff) | |
download | mirror-meh-a55738cf6d32e1d18a3c793df3c6c2797c25ebfa.tar.gz mirror-meh-a55738cf6d32e1d18a3c793df3c6c2797c25ebfa.tar.bz2 mirror-meh-a55738cf6d32e1d18a3c793df3c6c2797c25ebfa.zip |
load jpegs scaled 1/8 first
Diffstat (limited to 'src/xlib.c')
-rw-r--r-- | src/xlib.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -25,7 +25,7 @@ void scale(struct image *img, XImage *ximg); void linearscale(struct image *img, XImage *ximg); XShmSegmentInfo *shminfo; -XImage *ximage(struct image *img, unsigned int width, unsigned int height) { +XImage *ximage(struct image *img, unsigned int width, unsigned int height, int fast){ int depth; XImage *ximg = NULL; Visual *vis; @@ -71,7 +71,7 @@ XImage *ximage(struct image *img, unsigned int width, unsigned int height) { ximg->data = malloc(ximg->bytes_per_line * ximg->height); XInitImage(ximg); } - scale(img, ximg); + (fast ? linearscale : scale)(img, ximg); }else{ /* TODO other depths */ fprintf(stderr, "This program does not yet support display depths <24.\n"); @@ -82,11 +82,11 @@ XImage *ximage(struct image *img, unsigned int width, unsigned int height) { return ximg; } -XImage *getimage(struct image *img, unsigned int width, unsigned int height){ +XImage *getimage(struct image *img, unsigned int width, unsigned int height, int fast){ if(width * img->bufheight > height * img->bufwidth){ - return ximage(img, img->bufwidth * height / img->bufheight, height); + return ximage(img, img->bufwidth * height / img->bufheight, height, fast); }else{ - return ximage(img, width, img->bufheight * width / img->bufwidth); + return ximage(img, width, img->bufheight * width / img->bufwidth, fast); } } |