summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-03-16 20:35:48 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-03-16 20:35:48 +0100
commit40b830740a3670625b58ab2c64d4093e7b1d95d7 (patch)
tree68ba2a614b982825e3575c8a374a653f5881b9c7
parenta3b7f7b06583d0e38db3cfc72386da7f48e4cdbf (diff)
adjust TIFF and JPEG output
-rw-r--r--src/JPEGOutputImage.cxx6
-rw-r--r--src/TIFFOutputImage.cxx6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/JPEGOutputImage.cxx b/src/JPEGOutputImage.cxx
index bfe4595..0a5eb00 100644
--- a/src/JPEGOutputImage.cxx
+++ b/src/JPEGOutputImage.cxx
@@ -69,9 +69,9 @@ JPEGOutputImage::init_internal(int w1, int h1) {
int
JPEGOutputImage::set_pixel_internal(int x, int r, int g, int b) {
- row[x*3+0] = (unsigned char) r;
- row[x*3+1] = (unsigned char) g;
- row[x*3+2] = (unsigned char) b;
+ row[x*3+0] = (unsigned char) (r / 255);
+ row[x*3+1] = (unsigned char) (g / 255);
+ row[x*3+2] = (unsigned char) (b / 255);
return 0;
}
diff --git a/src/TIFFOutputImage.cxx b/src/TIFFOutputImage.cxx
index 4034c97..156079c 100644
--- a/src/TIFFOutputImage.cxx
+++ b/src/TIFFOutputImage.cxx
@@ -62,9 +62,9 @@ TIFFOutputImage::init_internal(int w1, int h1) {
int
TIFFOutputImage::set_pixel_internal(int x, int r, int g, int b) {
- row[x*4+0] = (unsigned char) r;
- row[x*4+1] = (unsigned char) g;
- row[x*4+2] = (unsigned char) b;
+ row[x*4+0] = (unsigned char) (r / 255);
+ row[x*4+1] = (unsigned char) (g / 255);
+ row[x*4+2] = (unsigned char) (b / 255);
row[x*4+3] = 255;
return 0;