From f37e52c39475e6efd3740c5ae1ec4f290662928f Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 13 Apr 2015 23:19:04 +0100 Subject: Move bitmap operations into an operation table. The generic bitmap handlers provided by each frontend are called back from the core and therefore should be in an operation table. This was one of the very few remaining interfaces stopping the core code from being split into a library. --- image/jpeg.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'image/jpeg.c') diff --git a/image/jpeg.c b/image/jpeg.c index a5d77b55b..309dec0a1 100644 --- a/image/jpeg.c +++ b/image/jpeg.c @@ -23,19 +23,17 @@ * This implementation uses the IJG JPEG library. */ -#include -#include -#include -#include +#include #include - -#include "content/content_protected.h" -#include "desktop/plotters.h" -#include "image/image_cache.h" +#include #include "utils/log.h" #include "utils/messages.h" -#include "utils/utils.h" +#include "content/content_protected.h" +#include "desktop/gui_internal.h" + +#include "image/image_cache.h" +#include "image/bitmap.h" #define JPEG_INTERNAL_OPTIONS #include "jpeglib.h" @@ -224,23 +222,23 @@ jpeg_cache_convert(struct content *c) height = cinfo.output_height; /* create opaque bitmap (jpegs cannot be transparent) */ - bitmap = bitmap_create(width, height, BITMAP_NEW | BITMAP_OPAQUE); + bitmap = guit->bitmap->create(width, height, BITMAP_NEW | BITMAP_OPAQUE); if (bitmap == NULL) { /* empty bitmap could not be created */ jpeg_destroy_decompress(&cinfo); return NULL; } - pixels = bitmap_get_buffer(bitmap); + pixels = guit->bitmap->get_buffer(bitmap); if (pixels == NULL) { /* bitmap with no buffer available */ - bitmap_destroy(bitmap); + guit->bitmap->destroy(bitmap); jpeg_destroy_decompress(&cinfo); return NULL; } /* Convert scanlines from jpeg into bitmap */ - rowstride = bitmap_get_rowstride(bitmap); + rowstride = guit->bitmap->get_rowstride(bitmap); do { JSAMPROW scanlines[1]; @@ -265,7 +263,7 @@ jpeg_cache_convert(struct content *c) } #endif } while (cinfo.output_scanline != cinfo.output_height); - bitmap_modified(bitmap); + guit->bitmap->modified(bitmap); jpeg_finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); -- cgit v1.2.3