mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
-Fixed problem restoring min max values from project file
-Closes ticket #945 -Added ability choose in the GUI to load estimated or actual min max values from the band -Cleaned and reorganized raster properties gui a little -Added a set default constrast enhancement option in gui that is persistent between sessions -Closes ticket #1055 and #778 git-svn-id: http://svn.osgeo.org/qgis/trunk@8398 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
759fb39413
commit
ce7c48f907
@ -260,6 +260,12 @@ public:
|
|||||||
|
|
||||||
void setMaximumValue(QString theBand, double theValue, bool theGenerateLookupTableFlag=true);
|
void setMaximumValue(QString theBand, double theValue, bool theGenerateLookupTableFlag=true);
|
||||||
|
|
||||||
|
/** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */
|
||||||
|
void computeMinimumMaximumEstimates(int theBand, double* theMinMax);
|
||||||
|
|
||||||
|
/** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */
|
||||||
|
void computeMinimumMaximumEstimates(QString theBand, double* theMinMax);
|
||||||
|
|
||||||
QgsContrastEnhancement* getContrastEnhancement(unsigned int theBand);
|
QgsContrastEnhancement* getContrastEnhancement(unsigned int theBand);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#include <QPolygonF>
|
#include <QPolygonF>
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QSettings>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
@ -298,6 +298,7 @@ mRasterLayer( dynamic_cast<QgsRasterLayer*>(lyr) )
|
|||||||
pbnDefaultValues->setIcon(QIcon(QPixmap(myThemePath + "/mActionCopySelected.png")));
|
pbnDefaultValues->setIcon(QIcon(QPixmap(myThemePath + "/mActionCopySelected.png")));
|
||||||
pbnImportTransparentPixelValues->setIcon(QIcon(QPixmap(myThemePath + "/mActionFileOpen.png")));
|
pbnImportTransparentPixelValues->setIcon(QIcon(QPixmap(myThemePath + "/mActionFileOpen.png")));
|
||||||
pbnExportTransparentPixelValues->setIcon(QIcon(QPixmap(myThemePath + "/mActionFileSave.png")));
|
pbnExportTransparentPixelValues->setIcon(QIcon(QPixmap(myThemePath + "/mActionFileSave.png")));
|
||||||
|
pbtnMakeContrastEnhancementAlgorithmDefault->setIcon(QIcon(QPixmap(myThemePath + "/mActionFileSave.png")));
|
||||||
|
|
||||||
// Only do pyramids if dealing directly with GDAL.
|
// Only do pyramids if dealing directly with GDAL.
|
||||||
if (mRasterLayerIsGdal)
|
if (mRasterLayerIsGdal)
|
||||||
@ -613,11 +614,6 @@ void QgsRasterLayerProperties::sync()
|
|||||||
cboxInvertColorMap->setChecked(false);
|
cboxInvertColorMap->setChecked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//set the transparency slider
|
|
||||||
sliderTransparency->setValue(255 - mRasterLayer->getTransparency());
|
|
||||||
//update the transparency percentage label
|
|
||||||
sliderTransparency_valueChanged(255 - mRasterLayer->getTransparency());
|
|
||||||
|
|
||||||
//set the combos to the correct values
|
//set the combos to the correct values
|
||||||
cboRed->setCurrentText(mRasterLayer->getRedBandName());
|
cboRed->setCurrentText(mRasterLayer->getRedBandName());
|
||||||
cboGreen->setCurrentText(mRasterLayer->getGreenBandName());
|
cboGreen->setCurrentText(mRasterLayer->getGreenBandName());
|
||||||
@ -713,12 +709,44 @@ void QgsRasterLayerProperties::sync()
|
|||||||
cboxContrastEnhancementAlgorithm->setCurrentText(tr("No Scaling"));
|
cboxContrastEnhancementAlgorithm->setCurrentText(tr("No Scaling"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Display the current default contrast enhancement algorithm
|
||||||
|
QSettings myQSettings;
|
||||||
|
QString myDefaultAlgorithm = myQSettings.value("/Raster/defaultContrastEnhancementAlgorithm", "NO_STRETCH").toString();
|
||||||
|
if(myDefaultAlgorithm == "NO_STRETCH")
|
||||||
|
{
|
||||||
|
labelDefaultContrastEnhancementAlgorithm->setText(tr("No Scaling"));
|
||||||
|
}
|
||||||
|
if(myDefaultAlgorithm == "STRETCH_TO_MINMAX")
|
||||||
|
{
|
||||||
|
labelDefaultContrastEnhancementAlgorithm->setText(tr("Stretch To MinMax"));
|
||||||
|
}
|
||||||
|
else if(myDefaultAlgorithm == "STRETCH_AND_CLIP_TO_MINMAX")
|
||||||
|
{
|
||||||
|
labelDefaultContrastEnhancementAlgorithm->setText(tr("Stretch And Clip To MinMax"));
|
||||||
|
}
|
||||||
|
else if(myDefaultAlgorithm == "CLIP_TO_MINMAX")
|
||||||
|
{
|
||||||
|
labelDefaultContrastEnhancementAlgorithm->setText(tr("Clip To MinMax"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
labelDefaultContrastEnhancementAlgorithm->setText(tr("No Scaling"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef QGISDEBUG
|
#ifdef QGISDEBUG
|
||||||
QgsDebugMsg("QgsRasterLayerProperties::sync populate transparency tab");
|
QgsDebugMsg("QgsRasterLayerProperties::sync populate transparency tab");
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* Transparent Pixel Tab
|
* Transparent Pixel Tab
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//set the transparency slider
|
||||||
|
sliderTransparency->setValue(255 - mRasterLayer->getTransparency());
|
||||||
|
//update the transparency percentage label
|
||||||
|
sliderTransparency_valueChanged(255 - mRasterLayer->getTransparency());
|
||||||
|
|
||||||
int myIndex = cboxTransparencyLayer->findText(mRasterLayer->getTransparentLayerName());
|
int myIndex = cboxTransparencyLayer->findText(mRasterLayer->getTransparentLayerName());
|
||||||
if(-1 != myIndex)
|
if(-1 != myIndex)
|
||||||
{
|
{
|
||||||
@ -2697,6 +2725,9 @@ void QgsRasterLayerProperties::on_pbtnLoadMinMax_clicked()
|
|||||||
if(rbtnThreeBand->isChecked())
|
if(rbtnThreeBand->isChecked())
|
||||||
{
|
{
|
||||||
rbtnThreeBandMinMax->setChecked(true);
|
rbtnThreeBandMinMax->setChecked(true);
|
||||||
|
|
||||||
|
if(rbtnActualMinMax->isChecked())
|
||||||
|
{
|
||||||
myRasterBandStats = mRasterLayer->getRasterBandStats(mRasterLayer->getRasterBandNumber(cboRed->currentText()));
|
myRasterBandStats = mRasterLayer->getRasterBandStats(mRasterLayer->getRasterBandNumber(cboRed->currentText()));
|
||||||
leRedMin->setText(QString::number(myRasterBandStats.minVal));
|
leRedMin->setText(QString::number(myRasterBandStats.minVal));
|
||||||
leRedMax->setText(QString::number(myRasterBandStats.maxVal));
|
leRedMax->setText(QString::number(myRasterBandStats.maxVal));
|
||||||
@ -2708,12 +2739,74 @@ void QgsRasterLayerProperties::on_pbtnLoadMinMax_clicked()
|
|||||||
leBlueMax->setText(QString::number(myRasterBandStats.maxVal));
|
leBlueMax->setText(QString::number(myRasterBandStats.maxVal));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
rbtnEstimateMinMax->setChecked(true);
|
||||||
|
double myMinimumMaximum[2];
|
||||||
|
mRasterLayer->computeMinimumMaximumEstimates(mRasterLayer->getRasterBandNumber(cboRed->currentText()), myMinimumMaximum);
|
||||||
|
leRedMin->setText(QString::number(myMinimumMaximum[0]));
|
||||||
|
leRedMax->setText(QString::number(myMinimumMaximum[1]));
|
||||||
|
mRasterLayer->computeMinimumMaximumEstimates(mRasterLayer->getRasterBandNumber(cboGreen->currentText()), myMinimumMaximum);
|
||||||
|
leGreenMin->setText(QString::number(myMinimumMaximum[0]));
|
||||||
|
leGreenMax->setText(QString::number(myMinimumMaximum[1]));
|
||||||
|
mRasterLayer->computeMinimumMaximumEstimates(mRasterLayer->getRasterBandNumber(cboBlue->currentText()), myMinimumMaximum);
|
||||||
|
leBlueMin->setText(QString::number(myMinimumMaximum[0]));
|
||||||
|
leBlueMax->setText(QString::number(myMinimumMaximum[1]));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rbtnSingleBandMinMax->setChecked(true);
|
rbtnSingleBandMinMax->setChecked(true);
|
||||||
|
if(rbtnActualMinMax->isChecked())
|
||||||
|
{
|
||||||
myRasterBandStats = mRasterLayer->getRasterBandStats(mRasterLayer->getRasterBandNumber(cboGray->currentText()));
|
myRasterBandStats = mRasterLayer->getRasterBandStats(mRasterLayer->getRasterBandNumber(cboGray->currentText()));
|
||||||
leGrayMin->setText(QString::number(myRasterBandStats.minVal));
|
leGrayMin->setText(QString::number(myRasterBandStats.minVal));
|
||||||
leGrayMax->setText(QString::number(myRasterBandStats.maxVal));
|
leGrayMax->setText(QString::number(myRasterBandStats.maxVal));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rbtnEstimateMinMax->setChecked(true);
|
||||||
|
double myMinimumMaximum[2];
|
||||||
|
mRasterLayer->computeMinimumMaximumEstimates(mRasterLayer->getRasterBandNumber(cboGray->currentText()), myMinimumMaximum);
|
||||||
|
leGrayMin->setText(QString::number(myMinimumMaximum[0]));
|
||||||
|
leGrayMax->setText(QString::number(myMinimumMaximum[1]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QgsRasterLayerProperties::on_pbtnMakeContrastEnhancementAlgorithmDefault_clicked()
|
||||||
|
{
|
||||||
|
//Like some of the other functionality in the raster properties GUI this deviated a little from the
|
||||||
|
//best practice of GUI design as this pressing cancel will not undo setting the default
|
||||||
|
//contrast enhancement algorithm
|
||||||
|
if(cboxContrastEnhancementAlgorithm->currentText() != tr("User Defined"))
|
||||||
|
{
|
||||||
|
QSettings myQSettings;
|
||||||
|
if(cboxContrastEnhancementAlgorithm->currentText() == tr("No Stretch"))
|
||||||
|
{
|
||||||
|
myQSettings.setValue("/Raster/defaultContrastEnhancementAlgorithm", "NO_STRETCH");
|
||||||
|
labelDefaultContrastEnhancementAlgorithm->setText(cboxContrastEnhancementAlgorithm->currentText());
|
||||||
|
}
|
||||||
|
else if(cboxContrastEnhancementAlgorithm->currentText() == tr("Stretch To MinMax"))
|
||||||
|
{
|
||||||
|
myQSettings.setValue("/Raster/defaultContrastEnhancementAlgorithm", "STRETCH_TO_MINMAX");
|
||||||
|
labelDefaultContrastEnhancementAlgorithm->setText(cboxContrastEnhancementAlgorithm->currentText());
|
||||||
|
}
|
||||||
|
else if(cboxContrastEnhancementAlgorithm->currentText() == tr("Stretch And Clip To MinMax"))
|
||||||
|
{
|
||||||
|
myQSettings.setValue("/Raster/defaultContrastEnhancementAlgorithm", "STRETCH_AND_CLIP_TO_MINMAX");
|
||||||
|
labelDefaultContrastEnhancementAlgorithm->setText(cboxContrastEnhancementAlgorithm->currentText());
|
||||||
|
}
|
||||||
|
else if(cboxContrastEnhancementAlgorithm->currentText() == tr("Clip To MinMax"))
|
||||||
|
{
|
||||||
|
myQSettings.setValue("/Raster/defaultContrastEnhancementAlgorithm", "CLIP_TO_MINMAX");
|
||||||
|
labelDefaultContrastEnhancementAlgorithm->setText(cboxContrastEnhancementAlgorithm->currentText());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,6 +109,8 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
|
|||||||
void handleColormapTreeWidgetDoubleClick(QTreeWidgetItem* item, int column);
|
void handleColormapTreeWidgetDoubleClick(QTreeWidgetItem* item, int column);
|
||||||
/**This slot loads the minimum and maximum values from the raster band and updates the gui*/
|
/**This slot loads the minimum and maximum values from the raster band and updates the gui*/
|
||||||
void on_pbtnLoadMinMax_clicked();
|
void on_pbtnLoadMinMax_clicked();
|
||||||
|
/**This slot save the current contrast enhancement algorithm as the default algorithm */
|
||||||
|
void on_pbtnMakeContrastEnhancementAlgorithmDefault_clicked();
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -60,7 +60,7 @@ email : tim at linfiniti.com
|
|||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include <QSlider>
|
#include <QSlider>
|
||||||
|
#include <QSettings>
|
||||||
// workaround for MSVC compiler which already has defined macro max
|
// workaround for MSVC compiler which already has defined macro max
|
||||||
// that interferes with calling std::numeric_limits<int>::max
|
// that interferes with calling std::numeric_limits<int>::max
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
@ -592,7 +592,9 @@ bool QgsRasterLayer::readFile( QString const & fileName )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//defaults - Needs to be set after the Contrast list has been build
|
//defaults - Needs to be set after the Contrast list has been build
|
||||||
setContrastEnhancementAlgorithm(QgsContrastEnhancement::STRETCH_TO_MINMAX);
|
//Try to read the default contrast enhancement from the config file
|
||||||
|
QSettings myQSettings;
|
||||||
|
setContrastEnhancementAlgorithm(myQSettings.value("/Raster/defaultContrastEnhancementAlgorithm", "NO_STRETCH").toString());
|
||||||
|
|
||||||
//decide what type of layer this is...
|
//decide what type of layer this is...
|
||||||
//note that multiband images can have one or more 'undefindd' bands,
|
//note that multiband images can have one or more 'undefindd' bands,
|
||||||
@ -4320,6 +4322,16 @@ bool QgsRasterLayer::readXML_( QDomNode & layer_node )
|
|||||||
myElement = snode.toElement();
|
myElement = snode.toElement();
|
||||||
setStdDevsToPlot(myElement.text().toDouble());
|
setStdDevsToPlot(myElement.text().toDouble());
|
||||||
|
|
||||||
|
snode = mnl.namedItem("mUserDefinedRGBMinMaxFlag");
|
||||||
|
myElement = snode.toElement();
|
||||||
|
myQVariant = (QVariant) myElement.attribute("boolean");
|
||||||
|
setUserDefinedRGBMinMax(myQVariant.toBool());
|
||||||
|
|
||||||
|
snode = mnl.namedItem("mUserDefinedGrayMinMaxFlag");
|
||||||
|
myElement = snode.toElement();
|
||||||
|
myQVariant = (QVariant) myElement.attribute("boolean");
|
||||||
|
setUserDefinedGrayMinMax(myQVariant.toBool());
|
||||||
|
|
||||||
snode = mnl.namedItem("mContrastEnhancementAlgorithm");
|
snode = mnl.namedItem("mContrastEnhancementAlgorithm");
|
||||||
myElement = snode.toElement();
|
myElement = snode.toElement();
|
||||||
setContrastEnhancementAlgorithm(myElement.text(), false);
|
setContrastEnhancementAlgorithm(myElement.text(), false);
|
||||||
@ -4659,6 +4671,34 @@ bool QgsRasterLayer::readXML_( QDomNode & layer_node )
|
|||||||
|
|
||||||
rasterPropertiesElement.appendChild( mStandardDeviationsElement );
|
rasterPropertiesElement.appendChild( mStandardDeviationsElement );
|
||||||
|
|
||||||
|
// <mUserDefinedRGBMinMaxFlag>
|
||||||
|
QDomElement userDefinedRGBMinMaxFlag = document.createElement( "mUserDefinedRGBMinMaxFlag" );
|
||||||
|
|
||||||
|
if ( getUserDefinedRGBMinMax() )
|
||||||
|
{
|
||||||
|
userDefinedRGBMinMaxFlag.setAttribute( "boolean", "true" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
userDefinedRGBMinMaxFlag.setAttribute( "boolean", "false" );
|
||||||
|
}
|
||||||
|
|
||||||
|
rasterPropertiesElement.appendChild( userDefinedRGBMinMaxFlag );
|
||||||
|
|
||||||
|
// <mUserDefinedGrayMinMaxFlag>
|
||||||
|
QDomElement userDefinedGrayMinMaxFlag = document.createElement( "mUserDefinedGrayMinMaxFlag" );
|
||||||
|
|
||||||
|
if ( getUserDefinedGrayMinMax() )
|
||||||
|
{
|
||||||
|
userDefinedGrayMinMaxFlag.setAttribute( "boolean", "true" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
userDefinedGrayMinMaxFlag.setAttribute( "boolean", "false" );
|
||||||
|
}
|
||||||
|
|
||||||
|
rasterPropertiesElement.appendChild( userDefinedGrayMinMaxFlag );
|
||||||
|
|
||||||
// <contrastEnhancementAlgorithm>
|
// <contrastEnhancementAlgorithm>
|
||||||
QDomElement contrastEnhancementAlgorithmElement = document.createElement( "mContrastEnhancementAlgorithm" );
|
QDomElement contrastEnhancementAlgorithmElement = document.createElement( "mContrastEnhancementAlgorithm" );
|
||||||
QDomText contrastEnhancementAlgorithmText = document.createTextNode( getContrastEnhancementAlgorithmAsQString() );
|
QDomText contrastEnhancementAlgorithmText = document.createTextNode( getContrastEnhancementAlgorithmAsQString() );
|
||||||
@ -5391,4 +5431,8 @@ void QgsRasterLayer::setContrastEnhancementAlgorithm(QString theAlgorithm, bool
|
|||||||
{
|
{
|
||||||
setContrastEnhancementAlgorithm(QgsContrastEnhancement::USER_DEFINED, theGenerateLookupTableFlag);
|
setContrastEnhancementAlgorithm(QgsContrastEnhancement::USER_DEFINED, theGenerateLookupTableFlag);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setContrastEnhancementAlgorithm(QgsContrastEnhancement::NO_STRETCH, theGenerateLookupTableFlag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -463,6 +463,7 @@ public:
|
|||||||
|
|
||||||
// Accessor and mutator for minimum maximum values
|
// Accessor and mutator for minimum maximum values
|
||||||
//TODO: Move these out of the header file...
|
//TODO: Move these out of the header file...
|
||||||
|
/** \brief Accessor for minimum value user for contrast enhancement */
|
||||||
double getMinimumValue(unsigned int theBand)
|
double getMinimumValue(unsigned int theBand)
|
||||||
{
|
{
|
||||||
if(0 < theBand && theBand <= getBandCount())
|
if(0 < theBand && theBand <= getBandCount())
|
||||||
@ -473,11 +474,13 @@ public:
|
|||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Accessor for minimum value user for contrast enhancement */
|
||||||
double getMinimumValue(QString theBand)
|
double getMinimumValue(QString theBand)
|
||||||
{
|
{
|
||||||
return getMinimumValue(getRasterBandNumber(theBand));
|
return getMinimumValue(getRasterBandNumber(theBand));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Mutator for setting the minimum value for contrast enhancement */
|
||||||
void setMinimumValue(unsigned int theBand, double theValue, bool theGenerateLookupTableFlag=true)
|
void setMinimumValue(unsigned int theBand, double theValue, bool theGenerateLookupTableFlag=true)
|
||||||
{
|
{
|
||||||
if(0 < theBand && theBand <= getBandCount())
|
if(0 < theBand && theBand <= getBandCount())
|
||||||
@ -486,6 +489,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Mutator for setting the minimum value for contrast enhancement */
|
||||||
void setMinimumValue(QString theBand, double theValue, bool theGenerateLookupTableFlag=true)
|
void setMinimumValue(QString theBand, double theValue, bool theGenerateLookupTableFlag=true)
|
||||||
{
|
{
|
||||||
if(theBand != tr("Not Set"))
|
if(theBand != tr("Not Set"))
|
||||||
@ -495,6 +499,7 @@ public:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Accessor for maximum value user for contrast enhancement */
|
||||||
double getMaximumValue(unsigned int theBand)
|
double getMaximumValue(unsigned int theBand)
|
||||||
{
|
{
|
||||||
if(0 < theBand && theBand <= getBandCount())
|
if(0 < theBand && theBand <= getBandCount())
|
||||||
@ -505,6 +510,7 @@ public:
|
|||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Accessor for maximum value user for contrast enhancement */
|
||||||
double getMaximumValue(QString theBand)
|
double getMaximumValue(QString theBand)
|
||||||
{
|
{
|
||||||
if(theBand != tr("Not Set"))
|
if(theBand != tr("Not Set"))
|
||||||
@ -515,6 +521,7 @@ public:
|
|||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Mutator for setting the maximum value for contrast enhancement */
|
||||||
void setMaximumValue(unsigned int theBand, double theValue, bool theGenerateLookupTableFlag=true)
|
void setMaximumValue(unsigned int theBand, double theValue, bool theGenerateLookupTableFlag=true)
|
||||||
{
|
{
|
||||||
if(0 < theBand && theBand <= getBandCount())
|
if(0 < theBand && theBand <= getBandCount())
|
||||||
@ -523,6 +530,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Mutator for setting the maximum value for contrast enhancement */
|
||||||
void setMaximumValue(QString theBand, double theValue, bool theGenerateLookupTableFlag=true)
|
void setMaximumValue(QString theBand, double theValue, bool theGenerateLookupTableFlag=true)
|
||||||
{
|
{
|
||||||
if(theBand != tr("Not Set"))
|
if(theBand != tr("Not Set"))
|
||||||
@ -531,6 +539,22 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */
|
||||||
|
void computeMinimumMaximumEstimates(int theBand, double* theMinMax)
|
||||||
|
{
|
||||||
|
if(0 < theBand && theBand <= getBandCount())
|
||||||
|
{
|
||||||
|
GDALRasterBandH myGdalBand = GDALGetRasterBand(mGdalDataset,theBand);
|
||||||
|
GDALComputeRasterMinMax( myGdalBand, 1, theMinMax );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */
|
||||||
|
void computeMinimumMaximumEstimates(QString theBand, double* theMinMax)
|
||||||
|
{
|
||||||
|
computeMinimumMaximumEstimates(getRasterBandNumber(theBand), theMinMax);
|
||||||
|
}
|
||||||
|
|
||||||
QgsContrastEnhancement* getContrastEnhancement(unsigned int theBand)
|
QgsContrastEnhancement* getContrastEnhancement(unsigned int theBand)
|
||||||
{
|
{
|
||||||
return &mContrastEnhancementList[theBand - 1];
|
return &mContrastEnhancementList[theBand - 1];
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user