gammaAdjust

[ XITE Reference Manual | XITE home ]

Name

gammaAdjust - Simple gamma correction

Syntax

 #include <xite/histo.h>

 BiffStatus gammaAdjust( IBAND inband,
    IBAND outband, double adjust );

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
 4 - Illegal value for adjust.

Restrictions

Works on unsigned byte bands only.

Author

Otto Milvang