te::rp::Contrast Class Reference

Contrast enhancement. More...

#include <Contrast.h>

Inheritance diagram for te::rp::Contrast:
te::rp::Algorithm

Classes

class  InputParameters
 Contrast input parameters. More...
 
class  OutputParameters
 Contrast output parameters. More...
 

Public Member Functions

 Contrast ()
 
bool execute (AlgorithmOutputParameters &outputParams) throw ( te::rp::Exception )
 Executes the algorithm using the supplied parameters. More...
 
bool initialize (const AlgorithmInputParameters &inputParams) throw ( te::rp::Exception )
 Initialize the algorithm instance making it ready for execution. More...
 
bool isInitialized () const
 Returns true if the algorithm instance is initialized and ready for execution. More...
 
void reset () throw ( te::rp::Exception )
 Clear all internal allocated objects and reset the algorithm to its initial state. More...
 
 ~Contrast ()
 

Protected Types

typedef void(Contrast::* RemapFuncPtrT) (const double &inValue, double &outValue)
 Type definition for a remapping function pointer. More...
 

Protected Member Functions

bool execDecorrelationEnhancement ()
 Execute the decorrelation enhancement contrast following the internal parameters. More...
 
bool execHistogramEqualizationContrast ()
 Execute the histogram equalization contrast following the internal parameters. More...
 
bool execLinearContrast ()
 Execute a linear contrast following the internal parameters. More...
 
bool execLogContrast ()
 Execute a log contrast following the internal parameters. More...
 
bool execSetMeanAndStdContrast ()
 Execute the histogram equalization contrast following the internal parameters. More...
 
bool execSquareContrast ()
 Execute a square contrast following the internal parameters. More...
 
bool execSquareRootContrast ()
 Execute a square root contrast following the internal parameters. More...
 
void logRemap (const double &inValue, double &outValue)
 Remap on gray level using a log. More...
 
void offSetGainRemap (const double &inValue, double &outValue)
 Remap on gray level using an offset and gain. More...
 
bool remapBandLevels (const te::rst::Band &inRasterBand, te::rst::Band &outRasterBand, RemapFuncPtrT remapFuncPtr, const bool enableProgress)
 Band gray levels remap using a remap function. More...
 
void squareRemap (const double &inValue, double &outValue)
 Remap on gray level using a square. More...
 
void squareRootRemap (const double &inValue, double &outValue)
 Remap on gray level using a square root. More...
 

Protected Attributes

Contrast::InputParameters m_inputParameters
 Contrast input execution parameters. More...
 
bool m_isInitialized
 Tells if this instance is initialized. More...
 
double m_logRemap_gain
 
double m_logRemap_offset
 
double m_offSetGainRemap_gain
 
double m_offSetGainRemap_offset1
 
double m_offSetGainRemap_offset2
 
Contrast::OutputParametersm_outputParametersPtr
 Contrast input execution parameters. More...
 
double m_squareRemap_factor
 
double m_squareRootRemap_gain
 

Detailed Description

Contrast enhancement.

Apply contrast enhencement on the selected bands.

Definition at line 57 of file Contrast.h.

Member Typedef Documentation

typedef void(Contrast::* te::rp::Contrast::RemapFuncPtrT) (const double &inValue, double &outValue)
protected

Type definition for a remapping function pointer.

Definition at line 234 of file Contrast.h.

Constructor & Destructor Documentation

te::rp::Contrast::Contrast ( )

Definition at line 169 of file Contrast.cpp.

References reset().

te::rp::Contrast::~Contrast ( )

Definition at line 174 of file Contrast.cpp.

Member Function Documentation

bool te::rp::Contrast::execute ( AlgorithmOutputParameters outputParams)
throw (te::rp::Exception
)
virtual

Executes the algorithm using the supplied parameters.

Parameters
outputParamsOutput parameters.
Returns
true if OK, false on errors.

Implements te::rp::Algorithm.

Definition at line 178 of file Contrast.cpp.

References te::rp::Contrast::InputParameters::DecorrelationEnhancementT, execDecorrelationEnhancement(), execHistogramEqualizationContrast(), execLinearContrast(), execLogContrast(), execSetMeanAndStdContrast(), execSquareContrast(), execSquareRootContrast(), te::rst::Raster::getAccessPolicy(), te::rst::Raster::getBand(), te::rst::Raster::getGrid(), te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rp::Contrast::InputParameters::HistogramEqualizationContrastT, te::rp::Contrast::InputParameters::LinearContrastT, te::rp::Contrast::InputParameters::LogContrastT, te::rp::Contrast::OutputParameters::m_createdOutRasterDSType, te::rp::Contrast::OutputParameters::m_createdOutRasterInfo, te::rp::Contrast::OutputParameters::m_createdOutRasterPtr, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, m_isInitialized, m_outputParametersPtr, te::rp::Contrast::OutputParameters::m_outRasterBands, te::rp::Contrast::OutputParameters::m_outRasterPtr, te::rp::Contrast::InputParameters::m_type, te::rst::RasterFactory::make(), te::rp::Contrast::InputParameters::MeanAndStdContrastT, te::rp::Contrast::InputParameters::SquareContrastT, te::rp::Contrast::InputParameters::SquareRootContrastT, TERP_LOG_AND_RETURN_FALSE, TERP_LOG_AND_THROW, TERP_TRUE_OR_RETURN_FALSE, and te::common::WAccess.

Referenced by te::qt::widgets::ContrastWizardPage::apply(), te::qt::widgets::ContrastWizard::execute(), and te::qt::widgets::ContrastDialog::on_okPushButton_clicked().

bool te::rp::Contrast::initialize ( const AlgorithmInputParameters inputParams)
throw (te::rp::Exception
)
virtual

Initialize the algorithm instance making it ready for execution.

Parameters
inputParamsInput parameters.
Returns
true if OK, false on errors.
Note
A return error string can be obtained via te::rp::Module::getLastLogStr()

Implements te::rp::Algorithm.

Definition at line 299 of file Contrast.cpp.

References te::rp::Contrast::InputParameters::DecorrelationEnhancementT, te::rst::Raster::getAccessPolicy(), te::rst::Raster::getNumberOfBands(), te::rp::Contrast::InputParameters::HistogramEqualizationContrastT, te::rp::Contrast::InputParameters::LinearContrastT, te::rp::Contrast::InputParameters::LogContrastT, te::rp::Contrast::InputParameters::m_hECMaxInput, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, m_isInitialized, te::rp::Contrast::InputParameters::m_lCMaxInput, te::rp::Contrast::InputParameters::m_lCMinInput, te::rp::Contrast::InputParameters::m_logCMaxInput, te::rp::Contrast::InputParameters::m_logCMinInput, te::rp::Contrast::InputParameters::m_sMASCMeanInput, te::rp::Contrast::InputParameters::m_sMASCStdInput, te::rp::Contrast::InputParameters::m_squareCMaxInput, te::rp::Contrast::InputParameters::m_squareCMinInput, te::rp::Contrast::InputParameters::m_squareRootCMaxInput, te::rp::Contrast::InputParameters::m_squareRootCMinInput, te::rp::Contrast::InputParameters::m_type, te::rp::Contrast::InputParameters::MeanAndStdContrastT, te::common::RAccess, reset(), te::rp::Contrast::InputParameters::SquareContrastT, te::rp::Contrast::InputParameters::SquareRootContrastT, TERP_LOG_AND_THROW, and TERP_TRUE_OR_RETURN_FALSE.

Referenced by te::qt::widgets::ContrastWizardPage::apply(), te::qt::widgets::ContrastWizard::execute(), and te::qt::widgets::ContrastDialog::on_okPushButton_clicked().

bool te::rp::Contrast::isInitialized ( ) const
virtual

Returns true if the algorithm instance is initialized and ready for execution.

Returns
true if the algorithm instance is initialized and ready for execution.

Implements te::rp::Algorithm.

Definition at line 409 of file Contrast.cpp.

References m_isInitialized.

void te::rp::Contrast::logRemap ( const double &  inValue,
double &  outValue 
)
inlineprotected

Remap on gray level using a log.

Parameters
inValueInput gray level.
outValueOutput gray level.
Note
outValue = m_logRemap_gain * std::log10( inValue + m_logRemap_offset + 1.0 );

Definition at line 352 of file Contrast.h.

Referenced by execLogContrast().

void te::rp::Contrast::offSetGainRemap ( const double &  inValue,
double &  outValue 
)
inlineprotected

Remap on gray level using an offset and gain.

Parameters
inValueInput gray level.
outValueOutput gray level.
Note
outValue = ( ( inValue + m_offSetGainRemap_offset1 ) * m_offSetGainRemap_gain ) + m_offSetGainRemap_offset2

Definition at line 318 of file Contrast.h.

Referenced by execDecorrelationEnhancement(), and execLinearContrast().

bool te::rp::Contrast::remapBandLevels ( const te::rst::Band inRasterBand,
te::rst::Band outRasterBand,
RemapFuncPtrT  remapFuncPtr,
const bool  enableProgress 
)
protected
void te::rp::Contrast::squareRemap ( const double &  inValue,
double &  outValue 
)
inlineprotected

Remap on gray level using a square.

Parameters
inValueInput gray level.
outValueOutput gray level.
Note
outValue = m_squareRemap_factor * std::pow( inValue, 2.0 )

Definition at line 330 of file Contrast.h.

Referenced by execSquareContrast().

void te::rp::Contrast::squareRootRemap ( const double &  inValue,
double &  outValue 
)
inlineprotected

Remap on gray level using a square root.

Parameters
inValueInput gray level.
outValueOutput gray level.
Note
outValue = m_squareRootRemap_gain * std::sqrt( inValue );

Definition at line 341 of file Contrast.h.

Referenced by execSquareRootContrast().

Member Data Documentation

bool te::rp::Contrast::m_isInitialized
protected

Tells if this instance is initialized.

Definition at line 240 of file Contrast.h.

Referenced by execute(), initialize(), isInitialized(), and reset().

double te::rp::Contrast::m_logRemap_gain
protected

Definition at line 309 of file Contrast.h.

Referenced by execLogContrast().

double te::rp::Contrast::m_logRemap_offset
protected

Definition at line 310 of file Contrast.h.

Referenced by execLogContrast().

double te::rp::Contrast::m_offSetGainRemap_gain
protected

Definition at line 299 of file Contrast.h.

Referenced by execDecorrelationEnhancement(), and execLinearContrast().

double te::rp::Contrast::m_offSetGainRemap_offset1
protected

Definition at line 297 of file Contrast.h.

Referenced by execDecorrelationEnhancement(), and execLinearContrast().

double te::rp::Contrast::m_offSetGainRemap_offset2
protected

Definition at line 298 of file Contrast.h.

Referenced by execDecorrelationEnhancement(), and execLinearContrast().

double te::rp::Contrast::m_squareRemap_factor
protected

Definition at line 302 of file Contrast.h.

Referenced by execSquareContrast().

double te::rp::Contrast::m_squareRootRemap_gain
protected

Definition at line 306 of file Contrast.h.

Referenced by execSquareRootContrast().


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