aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-06-17 11:21:32 +0200
committerSebastian Geerken <devnull@localhost>2013-06-17 11:21:32 +0200
commite29d48718515b0afe04fecc396f7c34865726cab (patch)
treebb72f513ccc03e5f81d7447a02dc7b203e67fa0f
parent126ae913efb3829c980a2151db5bbcfd68c5b39c (diff)
Corrections of gamma.
-rw-r--r--dw/fltkimgbuf.cc4
-rw-r--r--dw/platform.hh3
-rw-r--r--src/gif.c3
-rw-r--r--src/jpeg.c2
-rw-r--r--src/png.c2
5 files changed, 7 insertions, 7 deletions
diff --git a/dw/fltkimgbuf.cc b/dw/fltkimgbuf.cc
index 4b93601f..56a673fa 100644
--- a/dw/fltkimgbuf.cc
+++ b/dw/fltkimgbuf.cc
@@ -91,8 +91,8 @@ void FltkImgbuf::init (Type type, int width, int height, double gamma,
case RGB: bpp = 3; break;
default: bpp = 1; break;
}
- _MSG("FltkImgbuf::init width=%d height=%d bpp=%d gamma=%g\n",
- width, height, bpp, gamma);
+ MSG("FltkImgbuf::init width=%d height=%d bpp=%d gamma=%g\n",
+ width, height, bpp, gamma);
rawdata = new uchar[bpp * width * height];
// Set light-gray as interim background color.
memset(rawdata, 222, width*height*bpp);
diff --git a/dw/platform.hh b/dw/platform.hh
index 532f4cf9..227cda33 100644
--- a/dw/platform.hh
+++ b/dw/platform.hh
@@ -149,8 +149,7 @@ public:
/**
* \brief Create a (platform speficic) image buffer.
*
- * "gamma" is the value by which the image data is already
- * corrected.
+ * "gamma" is the value by which the image data is gamma-encoded.
*/
virtual Imgbuf *createImgbuf (Imgbuf::Type type, int width, int height,
double gamma) = 0;
diff --git a/src/gif.c b/src/gif.c
index a4233267..69fcf5d3 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -816,7 +816,8 @@ static size_t Gif_do_img_desc(DilloGif *gif, void *Buf,
/** \todo Gamma for GIF? */
a_Dicache_set_parms(gif->url, gif->version, gif->Image,
- gif->Width, gif->Height, DILLO_IMG_TYPE_INDEXED, 2.2);
+ gif->Width, gif->Height, DILLO_IMG_TYPE_INDEXED,
+ 1 / 2.2);
Flags = buf[8];
diff --git a/src/jpeg.c b/src/jpeg.c
index 7efdbfbb..625808fb 100644
--- a/src/jpeg.c
+++ b/src/jpeg.c
@@ -303,7 +303,7 @@ static void Jpeg_write(DilloJpeg *jpeg, void *Buf, uint_t BufSize)
a_Dicache_set_parms(jpeg->url, jpeg->version, jpeg->Image,
(uint_t)jpeg->cinfo.image_width,
(uint_t)jpeg->cinfo.image_height,
- type, 2.2);
+ type, 1 / 2.2);
/* decompression step 4 (see libjpeg.doc) */
jpeg->state = DILLO_JPEG_STARTING;
diff --git a/src/png.c b/src/png.c
index 767df994..44d55733 100644
--- a/src/png.c
+++ b/src/png.c
@@ -204,7 +204,7 @@ Png_datainfo_callback(png_structp png_ptr, png_infop info_ptr)
/** \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, 2.2);
+ DILLO_IMG_TYPE_RGB, 1 / 2.2);
}
static void