diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dicache.c | 5 | ||||
-rw-r--r-- | src/dicache.h | 3 | ||||
-rw-r--r-- | src/gif.c | 3 | ||||
-rw-r--r-- | src/imgbuf.cc | 5 | ||||
-rw-r--r-- | src/imgbuf.hh | 3 | ||||
-rw-r--r-- | src/jpeg.c | 3 | ||||
-rw-r--r-- | src/png.c | 3 |
7 files changed, 16 insertions, 9 deletions
diff --git a/src/dicache.c b/src/dicache.c index 23721685..55232846 100644 --- a/src/dicache.c +++ b/src/dicache.c @@ -259,7 +259,8 @@ void a_Dicache_invalidate_entry(const DilloUrl *Url) * (By now, we'll use the image information despite the html tags --Jcid) */ void a_Dicache_set_parms(DilloUrl *url, int version, DilloImage *Image, - uint_t width, uint_t height, DilloImgType type) + uint_t width, uint_t height, DilloImgType type, + double gamma) { DICacheEntry *DicEntry; @@ -275,7 +276,7 @@ void a_Dicache_set_parms(DilloUrl *url, int version, DilloImage *Image, /* BUG: there's just one image-type now */ #define I_RGB 0 - DicEntry->v_imgbuf = a_Imgbuf_new(Image->dw, I_RGB, width, height); + DicEntry->v_imgbuf = a_Imgbuf_new(Image->dw, I_RGB, width, height, gamma); DicEntry->TotalSize = width * height * 3; DicEntry->width = width; diff --git a/src/dicache.h b/src/dicache.h index 76fdba92..df8a8b89 100644 --- a/src/dicache.h +++ b/src/dicache.h @@ -59,7 +59,8 @@ void *a_Dicache_jpeg_image(const char *Type, void *Ptr, CA_Callback_t *Call, void a_Dicache_callback(int Op, CacheClient_t *Client); void a_Dicache_set_parms(DilloUrl *url, int version, DilloImage *Image, - uint_t width, uint_t height, DilloImgType type); + uint_t width, uint_t height, DilloImgType type, + double gamma); void a_Dicache_set_cmap(DilloUrl *url, int version, DilloImage *Image, const uchar_t *cmap, uint_t num_colors, int num_colors_max, int bg_index); @@ -814,8 +814,9 @@ static size_t Gif_do_img_desc(DilloGif *gif, void *Buf, return 0; } + /** \todo Gamma for GIF? */ a_Dicache_set_parms(gif->url, gif->version, gif->Image, - gif->Width, gif->Height, DILLO_IMG_TYPE_INDEXED); + gif->Width, gif->Height, DILLO_IMG_TYPE_INDEXED, 2.2); Flags = buf[8]; diff --git a/src/imgbuf.cc b/src/imgbuf.cc index 51f86b74..16eb5c31 100644 --- a/src/imgbuf.cc +++ b/src/imgbuf.cc @@ -90,7 +90,8 @@ void a_Imgbuf_unref(void *v_imgbuf) /* * Create a new Imgbuf */ -void *a_Imgbuf_new(void *v_dw, int img_type, uint_t width, uint_t height) +void *a_Imgbuf_new(void *v_dw, int img_type, uint_t width, uint_t height, + double gamma) { Layout *layout = ((Widget*)v_dw)->getLayout(); if (!layout) { @@ -103,7 +104,7 @@ void *a_Imgbuf_new(void *v_dw, int img_type, uint_t width, uint_t height) linebuf = (uchar_t*) dRealloc(linebuf, linebuf_size); } - return (void*)layout->createImgbuf(Imgbuf::RGB, width, height); + return (void*)layout->createImgbuf(Imgbuf::RGB, width, height, gamma); } /* diff --git a/src/imgbuf.hh b/src/imgbuf.hh index 9a6e3ff7..af0bf9a6 100644 --- a/src/imgbuf.hh +++ b/src/imgbuf.hh @@ -16,7 +16,8 @@ extern "C" { */ void a_Imgbuf_ref(void *v_imgbuf); void a_Imgbuf_unref(void *v_imgbuf); -void *a_Imgbuf_new(void *v_dw, int img_type, uint_t width, uint_t height); +void *a_Imgbuf_new(void *v_dw, int img_type, uint_t width, uint_t height, + double gamma); int a_Imgbuf_last_reference(void *v_imgbuf); void a_Imgbuf_update(void *v_imgbuf, const uchar_t *buf, DilloImgType type, uchar_t *cmap, uint_t width, uint_t height, uint_t y); @@ -299,10 +299,11 @@ static void Jpeg_write(DilloJpeg *jpeg, void *Buf, uint_t BufSize) return; } + /** \todo Gamma for JPEG? */ a_Dicache_set_parms(jpeg->url, jpeg->version, jpeg->Image, (uint_t)jpeg->cinfo.image_width, (uint_t)jpeg->cinfo.image_height, - type); + type, 2.2); /* decompression step 4 (see libjpeg.doc) */ jpeg->state = DILLO_JPEG_STARTING; @@ -201,9 +201,10 @@ Png_datainfo_callback(png_structp png_ptr, png_infop info_ptr) png->linebuf = dMalloc(3 * png->width); /* Initialize the dicache-entry here */ + /** \todo Gamma for PNG? */ a_Dicache_set_parms(png->url, png->version, png->Image, (uint_t)png->width, (uint_t)png->height, - DILLO_IMG_TYPE_RGB); + DILLO_IMG_TYPE_RGB, 2.2); } static void |