#include <Contrast.h>
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 | execHistogramEqualizationContrast () |
Execute the histogram equalization contrast following the internal parameters. More... | |
bool | execLinearContrast () |
Execute a linear contrast following the internal parameters. More... | |
bool | execSetMeanAndStdContrast () |
Execute the histogram equalization contrast following the internal parameters. More... | |
void | offSetGainRemap (const double &inValue, double &outValue) |
Remap on gray level using an offset (Contrast::m_offSetGainRemap_offset) and a gain value (Contrast::m_offSetGainRemap_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... | |
Protected Attributes | |
Contrast::InputParameters | m_inputParameters |
Contrast input execution parameters. More... | |
bool | m_isInitialized |
Tells if this instance is initialized. More... | |
double | m_offSetGainRemap_gain |
double | m_offSetGainRemap_offset |
Contrast::OutputParameters * | m_outputParametersPtr |
Contrast input execution parameters. More... | |
Contrast enhancement.
Apply contrast enhencement on the selected bands.
Definition at line 56 of file Contrast.h.
|
protected |
Type definition for a remapping function pointer.
Definition at line 168 of file Contrast.h.
te::rp::Contrast::Contrast | ( | ) |
Definition at line 138 of file Contrast.cpp.
References reset().
te::rp::Contrast::~Contrast | ( | ) |
Definition at line 143 of file Contrast.cpp.
|
protected |
Execute the histogram equalization contrast following the internal parameters.
Definition at line 381 of file Contrast.cpp.
References te::rst::ConstBandIterator< T >::begin(), te::rst::ConstBandIterator< T >::end(), te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::common::Singleton< RasterSummaryManager >::getInstance(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), te::rp::Contrast::InputParameters::m_enableProgress, te::rp::Contrast::InputParameters::m_hECMaxInput, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, m_outputParametersPtr, te::rp::Contrast::OutputParameters::m_outRasterBands, te::rp::Contrast::OutputParameters::m_outRasterPtr, te::rst::Band::setValue(), and te::rst::SUMMARY_R_HISTOGRAM.
Referenced by execute().
|
protected |
Execute a linear contrast following the internal parameters.
Definition at line 326 of file Contrast.cpp.
References te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), te::rp::Contrast::InputParameters::m_enableProgress, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, te::rp::Contrast::InputParameters::m_lCMaxInput, te::rp::Contrast::InputParameters::m_lCMinInput, m_offSetGainRemap_gain, m_offSetGainRemap_offset, m_outputParametersPtr, te::rp::Contrast::OutputParameters::m_outRasterBands, te::rp::Contrast::OutputParameters::m_outRasterPtr, offSetGainRemap(), and remapBandLevels().
Referenced by execute().
|
protected |
Execute the histogram equalization contrast following the internal parameters.
Definition at line 454 of file Contrast.cpp.
References te::rst::ConstBandIterator< T >::begin(), te::rst::ConstBandIterator< T >::end(), te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::common::Singleton< RasterSummaryManager >::getInstance(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::Band::getRaster(), te::rst::BandProperty::getType(), te::rst::Band::getValue(), te::rp::Contrast::InputParameters::m_enableProgress, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, m_outputParametersPtr, te::rp::Contrast::OutputParameters::m_outRasterBands, te::rp::Contrast::OutputParameters::m_outRasterPtr, te::rp::Contrast::InputParameters::m_sMASCMeanInput, te::rp::Contrast::InputParameters::m_sMASCStdInput, te::rst::Band::setValue(), te::rst::SUMMARY_MEAN, and te::rst::SUMMARY_STD.
Referenced by execute().
|
virtual |
Executes the algorithm using the supplied parameters.
outputParams | Output parameters. |
Implements te::rp::Algorithm.
Definition at line 147 of file Contrast.cpp.
References execHistogramEqualizationContrast(), execLinearContrast(), execSetMeanAndStdContrast(), 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::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::SetMeanAndStdContrastT, 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().
|
virtual |
Initialize the algorithm instance making it ready for execution.
inputParams | Input parameters. |
Implements te::rp::Algorithm.
Definition at line 248 of file Contrast.cpp.
References te::rst::Raster::getAccessPolicy(), te::rst::Raster::getNumberOfBands(), te::rp::Contrast::InputParameters::HistogramEqualizationContrastT, te::rp::Contrast::InputParameters::LinearContrastT, 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_sMASCMeanInput, te::rp::Contrast::InputParameters::m_sMASCStdInput, te::rp::Contrast::InputParameters::m_type, te::common::RAccess, reset(), te::rp::Contrast::InputParameters::SetMeanAndStdContrastT, 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().
|
virtual |
Returns true if the algorithm instance is initialized and ready for execution.
Implements te::rp::Algorithm.
Definition at line 321 of file Contrast.cpp.
References m_isInitialized.
|
inlineprotected |
Remap on gray level using an offset (Contrast::m_offSetGainRemap_offset) and a gain value (Contrast::m_offSetGainRemap_gain.
inValue | Input gray level. |
outValue | Output gray level. |
Definition at line 217 of file Contrast.h.
Referenced by execLinearContrast().
|
protected |
Band gray levels remap using a remap function.
inRasterBand | Input raster band. |
outRasterBand | Output raster band. |
remapFuncPtr | The remap function pointer used. |
enableProgress | Enable the use of a progress interface. |
Definition at line 523 of file Contrast.cpp.
References te::rp::Convert2DoublesVector(), te::rp::ConvertDoublesVector(), te::rst::Band::getBlockSize(), te::rp::GetDataTypeRange(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), te::rst::Band::getValue(), te::rst::BandProperty::m_blkh, te::rst::BandProperty::m_blkw, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterPtr, te::rst::BandProperty::m_nblocksx, te::rst::BandProperty::m_nblocksy, te::rst::Band::read(), te::rst::Band::setValue(), and te::rst::Band::write().
Referenced by execLinearContrast().
|
virtual |
Clear all internal allocated objects and reset the algorithm to its initial state.
Implements te::rp::Algorithm.
Definition at line 241 of file Contrast.cpp.
References m_inputParameters, m_isInitialized, m_outputParametersPtr, and te::rp::Contrast::InputParameters::reset().
Referenced by Contrast(), initialize(), te::rp::Contrast::InputParameters::operator=(), te::rp::Contrast::OutputParameters::operator=(), te::rp::Contrast::OutputParameters::OutputParameters(), te::rp::Contrast::InputParameters::~InputParameters(), and te::rp::Contrast::OutputParameters::~OutputParameters().
|
protected |
Contrast input execution parameters.
Definition at line 171 of file Contrast.h.
Referenced by execHistogramEqualizationContrast(), execLinearContrast(), execSetMeanAndStdContrast(), execute(), initialize(), remapBandLevels(), and reset().
|
protected |
Tells if this instance is initialized.
Definition at line 174 of file Contrast.h.
Referenced by execute(), initialize(), isInitialized(), and reset().
|
protected |
Definition at line 208 of file Contrast.h.
Referenced by execLinearContrast().
|
protected |
Definition at line 207 of file Contrast.h.
Referenced by execLinearContrast().
|
protected |
Contrast input execution parameters.
Definition at line 172 of file Contrast.h.
Referenced by execHistogramEqualizationContrast(), execLinearContrast(), execSetMeanAndStdContrast(), execute(), and reset().