tiff2bw accuracy patch from Stanislav Brabec

This commit is contained in:
Frank Warmerdam 2000-10-12 14:16:22 +00:00
parent 8b6b975659
commit de9b66753d
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2000-10-12 Frank Warmerdam <warmerda@cs46980-c>
* Modified tiff2bw to ensure portions add to 100%, and that
white is properly recovered.
See bug http://bugzilla.remotesensing.org/show_bug.cgi?id=15
Patch c/o Stanislav Brabec <utx@penguin.cz>
2000-09-30 Frank Warmerdam <warmerda@cs46980-c>
* Modified TIFFClientOpen() to emit an error on an attempt to

View File

@ -1,4 +1,4 @@
/* $Header: /cvs/maptools/cvsroot/libtiff/tools/tiff2bw.c,v 1.3 1999-12-27 17:35:01 mwelles Exp $ */
/* $Header: /cvs/maptools/cvsroot/libtiff/tools/tiff2bw.c,v 1.4 2000-10-12 14:16:22 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -34,8 +34,8 @@
#define strneq(a,b,n) (strncmp(a,b,n) == 0)
/* x% weighting -> fraction of full color */
#define PCT(x) (((x)*255)/100)
int RED = PCT(28); /* 28% */
#define PCT(x) (((x)*255+127)/100)
int RED = PCT(30); /* 30% */
int GREEN = PCT(59); /* 59% */
int BLUE = PCT(11); /* 11% */