CONTRASTPARM Class Reference

Contrast parameters. More...

#include <mi32/contrastparm.h>

List of all members.

Public Types

enum  METHOD {
  METHOD_None = 0, METHOD_Linear = 1, METHOD_Normalize = 2, METHOD_Equalize = 3,
  METHOD_Exponential = 4, METHOD_SavedTable = 7, METHOD_Logarithmic = 9, METHOD_Constant = 10
}

Public Member Functions

 CONTRASTPARM (const CONTRASTPARM &rhs)
 CONTRASTPARM ()
 ~CONTRASTPARM ()
void AttachTable (UINT8 *&Table, UINT32 NumItems, double TableBinMinimum, double TableBinInterval)
bool CanComputeWithoutStats () const
void Clear ()
void ClearTable ()
ERRVALUE ComputeTable ()
ERRVALUE ComputeTable (const STAT_UNIVARIATE &stats, const float *outspec=0)
void DetachTable (SIMPLE_ARRAY< UINT8 > &Table)
const DOUBLE_RANGEGetInputRangePct () const
const DOUBLE_RANGEGetInputStretchRange () const
bool GetInvert () const
METHOD GetMethod () const
UINT8 GetOutputAboveMaxBin () const
UINT8 GetOutputBelowMinBin () const
UINT8 GetOutputConstant () const
UINT8 GetOutputInvalid () const
UINT8 GetOutputMedian () const
UINT8 GetOutputStdDevAboveMedian () const
UINT8 GetOutputStdDevBelowMedian () const
UINT8 GetOutputStretchMax () const
UINT8 GetOutputStretchMin () const
double GetPower () const
const SIMPLE_ARRAY< UINT8 > & GetTable () const
double GetTableBinInterval () const
const DOUBLE_RANGEGetTableBinRange () const
bool HasTable () const
bool IsInputRangePct () const
CONTRASTPARMoperator= (const CONTRASTPARM &rhs)
ERRVALUE Process (UINT32 count, const void *ibuffer, const UINT8 *validity, UINT8 *obuffer, NUMTYPE NumType) const
ERRVALUE Process (UINT32 count, const double *ibuffer, const UINT8 *validity, UINT8 *obuffer) const
ERRVALUE Process (UINT32 count, const float *ibuffer, const UINT8 *validity, UINT8 *obuffer) const
ERRVALUE Process (UINT32 count, const INT32 *ibuffer, const UINT8 *validity, UINT8 *obuffer) const
ERRVALUE Process (UINT32 count, const UINT32 *ibuffer, const UINT8 *validity, UINT8 *obuffer) const
ERRVALUE Process (UINT32 count, const INT16 *ibuffer, const UINT8 *validity, UINT8 *obuffer) const
ERRVALUE Process (UINT32 count, const UINT16 *ibuffer, const UINT8 *validity, UINT8 *obuffer) const
ERRVALUE Process (UINT32 count, const INT8 *ibuffer, const UINT8 *validity, UINT8 *obuffer) const
ERRVALUE Process (UINT32 count, const UINT8 *ibuffer, const UINT8 *validity, UINT8 *obuffer) const
void SetConstant (UINT8 OutConstant)
void SetExponential (double power)
void SetInputRangePct (double MinPct, double MaxPct)
void SetInputRangeUsePct (bool InputRangeUsePct)
void SetInputStretchMax (double value)
void SetInputStretchMin (double value)
void SetInputStretchRange (const DOUBLE_RANGE InputRangeAbsolute)
void SetInvert (bool Invert)
void SetMethod (METHOD method, bool usedefaults=true)
void SetNormalize (UINT8 median, UINT8 StDevBelowMedian=50, UINT8 StDevAboveMedian=50)
void SetOutputAboveMaxBin (UINT8 OutAboveMaxBin)
void SetOutputBelowMinBin (UINT8 OutBelowMinBin)
void SetOutputInvalid (UINT8 OutInvalid)
void SetOutputMedian (UINT8 median)
void SetOutputStdDevAboveMedian (UINT8 StdDevAboveMedian)
void SetOutputStdDevBelowMedian (UINT8 StdDevBelowMedian)
void SetOutputStretchMax (UINT8 OutStretchMax)
void SetOutputStretchMin (UINT8 OutStretchMin)
ERRVALUE SetTable (const SIMPLE_ARRAY< UINT8 > &Table, double TableBinMinimum, double TableBinInterval)
ERRVALUE SetTableBinRange (const DOUBLE_RANGE TableBinRange, double BinInterval)

Static Public Member Functions

static const SERIALIZERITEMSerialGetItemDef ()

Detailed Description

Contrast parameters.


Member Enumeration Documentation

Contrast table types.

Enumerator:
METHOD_None 

No contrasting.

METHOD_Linear 

Linear stretch between limits.

METHOD_Normalize 

Normalize, uses median, stdevl, stdevr to determine curve.

METHOD_Equalize 

Equalization.

METHOD_Exponential 

Exponential using power member.

METHOD_SavedTable 

Previously saved table.

METHOD_Logarithmic 

Logarithmic.

METHOD_Constant 

Constructor & Destructor Documentation

CONTRASTPARM::CONTRASTPARM (  ) 

Default constructor.

CONTRASTPARM::CONTRASTPARM ( const CONTRASTPARM rhs  ) 

Copy constructor.

CONTRASTPARM::~CONTRASTPARM (  ) 

Destructor.


Member Function Documentation

void CONTRASTPARM::AttachTable ( UINT8 *&  Table,
UINT32  NumItems,
double  TableBinMinimum,
double  TableBinInterval 
)

Attach table with bin range and interval.

Ownership of table is transferred to class instance, avoiding need to copy.

Parameters:
Table Table to attach, will be returned as NULL
NumItems Number of items
TableBinMinimum Table bin minimum (maximum determined based on other parameters)
TableBinInterval Table bin interval
bool CONTRASTPARM::CanComputeWithoutStats (  )  const

Determine if can recompute table without statistics.

void CONTRASTPARM::Clear (  ) 

Clear all values.

void CONTRASTPARM::ClearTable (  ) 

Clear current table without changing any other settings.

ERRVALUE CONTRASTPARM::ComputeTable (  ) 

Compute contrast table from current parameters only.

Requires table bin range and interval to be set for some methods. Not suitable for methods requiring statistics (Normalize, Equalize)

ERRVALUE CONTRASTPARM::ComputeTable ( const STAT_UNIVARIATE stats,
const float *  outspec = 0 
)

Compute contrast table from statistics and optional specification.

Suitable for all methods.

Parameters:
stats Statistics to compute from
outspec Specification array, must have 256 entries
void CONTRASTPARM::DetachTable ( SIMPLE_ARRAY< UINT8 > &  Table  )  [inline]

Detach table.

const DOUBLE_RANGE& CONTRASTPARM::GetInputRangePct (  )  const [inline]

Get input percentage range.

const DOUBLE_RANGE& CONTRASTPARM::GetInputStretchRange (  )  const [inline]

Get input absolute range.

bool CONTRASTPARM::GetInvert (  )  const [inline]

Get setting for whether inverted.

METHOD CONTRASTPARM::GetMethod (  )  const [inline]

Get method.

UINT8 CONTRASTPARM::GetOutputAboveMaxBin (  )  const [inline]

Get output value to use above maximum bin.

UINT8 CONTRASTPARM::GetOutputBelowMinBin (  )  const [inline]

Get output value to use below minimum bin.

UINT8 CONTRASTPARM::GetOutputConstant (  )  const [inline]

Get output value to use for "constant" method.

UINT8 CONTRASTPARM::GetOutputInvalid (  )  const [inline]

Get output value to use for invalid input values.

UINT8 CONTRASTPARM::GetOutputMedian (  )  const [inline]

Get output "median" value for normalize method.

UINT8 CONTRASTPARM::GetOutputStdDevAboveMedian (  )  const [inline]

Get output "std deviation above median" value for normalize method.

UINT8 CONTRASTPARM::GetOutputStdDevBelowMedian (  )  const [inline]

Get output "std deviation below median" value for normalize method.

UINT8 CONTRASTPARM::GetOutputStretchMax (  )  const [inline]

Get output value at maximum input stretch value.

UINT8 CONTRASTPARM::GetOutputStretchMin (  )  const [inline]

Get output value at minimum input stretch value.

double CONTRASTPARM::GetPower (  )  const [inline]

Get "power" value for exponential method.

const SIMPLE_ARRAY<UINT8>& CONTRASTPARM::GetTable (  )  const [inline]

Get table.

double CONTRASTPARM::GetTableBinInterval (  )  const [inline]

Get table bin interval.

const DOUBLE_RANGE& CONTRASTPARM::GetTableBinRange (  )  const [inline]

Get table bin range.

bool CONTRASTPARM::HasTable (  )  const [inline]

Determine if has lookup table.

bool CONTRASTPARM::IsInputRangePct (  )  const [inline]

Determine if input range specified as percentage.

CONTRASTPARM& CONTRASTPARM::operator= ( const CONTRASTPARM rhs  ) 

Assignment.

ERRVALUE CONTRASTPARM::Process ( UINT32  count,
const void *  ibuffer,
const UINT8 validity,
UINT8 obuffer,
NUMTYPE  NumType 
) const

Process values with specified NUMTYPE.

Parameters:
count Number of values
ibuffer Input buffer
validity Validity buffer, NULL if all values valid
obuffer Output buffer
NumType Numeric type
ERRVALUE CONTRASTPARM::Process ( UINT32  count,
const double *  ibuffer,
const UINT8 validity,
UINT8 obuffer 
) const

Process "double" values.

Parameters:
count Number of values
ibuffer Input buffer
validity Validity buffer, NULL if all values valid
obuffer Output buffer
ERRVALUE CONTRASTPARM::Process ( UINT32  count,
const float *  ibuffer,
const UINT8 validity,
UINT8 obuffer 
) const

Process "float" values.

Parameters:
count Number of values
ibuffer Input buffer
validity Validity buffer, NULL if all values valid
obuffer Output buffer
ERRVALUE CONTRASTPARM::Process ( UINT32  count,
const INT32 ibuffer,
const UINT8 validity,
UINT8 obuffer 
) const

Process INT32 values.

Parameters:
count Number of values
ibuffer Input buffer
validity Validity buffer, NULL if all values valid
obuffer Output buffer
ERRVALUE CONTRASTPARM::Process ( UINT32  count,
const UINT32 ibuffer,
const UINT8 validity,
UINT8 obuffer 
) const

Process UINT32 values.

Parameters:
count Number of values
ibuffer Input buffer
validity Validity buffer, NULL if all values valid
obuffer Output buffer
ERRVALUE CONTRASTPARM::Process ( UINT32  count,
const INT16 ibuffer,
const UINT8 validity,
UINT8 obuffer 
) const

Process INT16 values.

Parameters:
count Number of values
ibuffer Input buffer
validity Validity buffer, NULL if all values valid
obuffer Output buffer
ERRVALUE CONTRASTPARM::Process ( UINT32  count,
const UINT16 ibuffer,
const UINT8 validity,
UINT8 obuffer 
) const

Process UINT16 values.

Parameters:
count Number of values
ibuffer Input buffer
validity Validity buffer, NULL if all values valid
obuffer Output buffer
ERRVALUE CONTRASTPARM::Process ( UINT32  count,
const INT8 ibuffer,
const UINT8 validity,
UINT8 obuffer 
) const

Process INT8 values.

Parameters:
count Number of values
ibuffer Input buffer
validity Validity buffer, NULL if all values valid
obuffer Output buffer
ERRVALUE CONTRASTPARM::Process ( UINT32  count,
const UINT8 ibuffer,
const UINT8 validity,
UINT8 obuffer 
) const

Process UINT8 values.

Parameters:
count Number of values
ibuffer Input buffer
validity Validity buffer, NULL if all values valid
obuffer Output buffer
static const SERIALIZERITEM* CONTRASTPARM::SerialGetItemDef (  )  [static]

Get item definition array for serialization.

void CONTRASTPARM::SetConstant ( UINT8  OutConstant  ) 

Set to "constant" method with value specified.

void CONTRASTPARM::SetExponential ( double  power  ) 

Set to "exponential" method with power specified.

void CONTRASTPARM::SetInputRangePct ( double  MinPct,
double  MaxPct 
)

Set input value stretch range.

Automatically sets to use percentage when computing table.

Parameters:
MinPct Minimum percentage (0-100)
MaxPct Maximum percentage (0-100)
void CONTRASTPARM::SetInputRangeUsePct ( bool  InputRangeUsePct  )  [inline]

Set whether to use input percentage range or absolute range.

Parameters:
InputRangeUsePct True if range is percentage, false if absolute
void CONTRASTPARM::SetInputStretchMax ( double  value  )  [inline]

Set input value stretch maximum.

void CONTRASTPARM::SetInputStretchMin ( double  value  )  [inline]

Set input value stretch minimum.

void CONTRASTPARM::SetInputStretchRange ( const DOUBLE_RANGE  InputRangeAbsolute  )  [inline]

Set absolute input value stretch range.

Automatically sets to use absolute range when computing table.

void CONTRASTPARM::SetInvert ( bool  Invert  )  [inline]

Set whether inverted bright/dark.

void CONTRASTPARM::SetMethod ( METHOD  method,
bool  usedefaults = true 
)

Set contrast method.

Parameters:
method Method to set
usedefaults Set any value-specific parameters to defaults
void CONTRASTPARM::SetNormalize ( UINT8  median,
UINT8  StDevBelowMedian = 50,
UINT8  StDevAboveMedian = 50 
)

Set to "normalize" method with parameters.

void CONTRASTPARM::SetOutputAboveMaxBin ( UINT8  OutAboveMaxBin  )  [inline]

Set value to output above maximum bin.

void CONTRASTPARM::SetOutputBelowMinBin ( UINT8  OutBelowMinBin  )  [inline]

Set value to output below minimum bin.

void CONTRASTPARM::SetOutputInvalid ( UINT8  OutInvalid  )  [inline]

Set value to output for "invalid" input.

void CONTRASTPARM::SetOutputMedian ( UINT8  median  )  [inline]

Set output median value for normalize method.

Does not change method itself.

void CONTRASTPARM::SetOutputStdDevAboveMedian ( UINT8  StdDevAboveMedian  )  [inline]

Set output standard deviation above median for normalize method.

Does not change method itself.

void CONTRASTPARM::SetOutputStdDevBelowMedian ( UINT8  StdDevBelowMedian  )  [inline]

Set output standard deviation below median for normalize method.

Does not change method itself.

void CONTRASTPARM::SetOutputStretchMax ( UINT8  OutStretchMax  )  [inline]

Set value to output at maximum input stretch value.

void CONTRASTPARM::SetOutputStretchMin ( UINT8  OutStretchMin  )  [inline]

Set value to output at minimum input stretch value.

ERRVALUE CONTRASTPARM::SetTable ( const SIMPLE_ARRAY< UINT8 > &  Table,
double  TableBinMinimum,
double  TableBinInterval 
)

Set table with bin range and interval.

Parameters:
Table Table to set
TableBinMinimum Table bin minimum (maximum determined based on number of items in table)
TableBinInterval Table bin interval
ERRVALUE CONTRASTPARM::SetTableBinRange ( const DOUBLE_RANGE  TableBinRange,
double  BinInterval 
)

Set table bin range and interval.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:33:17 2012 for TNTsdk 2012 by  doxygen 1.6.1