gammaAdjust
[ XITE Reference Manual | XITE home ]
Name
gammaAdjust - Simple gamma correction
Syntax
gammaAdjust [-adjust <value>] <infile> <outfile>
Description
A simple gamma corretion to make images
darker or brigter. The adjust parameter must be
in the range -1.0 (much darker) to 1 (much brighter).
If adjust = 0.0 the band is not changed.
If adjust > 0:
a= adjust**2/0.16;
b= 255.0 / log(a*255.0+1.0);
c= 256.0/a * log(1.0 + (exp(a) - 1.0) * i / 256.0);
col[i] = c;
If adjust < 0;
a= adjust**2/0.16;
b= 255.0 / log(a*255.0+1.0);
c= 256.0/a * log(1.0 + (exp(a) - 1.0) * (255-i) / 256.0);
col[i] = 255-c;
Return value
0 - OK
2 - Bad pixtype
3 - Bad size
Restrictions
Works on unsigned byte bands only.
Author
Otto Milvang
Examples
gammaAdjust -adjust 0.4 file.img | biff2ps - | lpr
Id
$Id: gammaAdjust.c,v 1.16 1996/11/08 14:03:58 svein Exp $