Index: src/app/qgsrasterlayerproperties.cpp =================================================================== --- src/app/qgsrasterlayerproperties.cpp (revision 6440) +++ src/app/qgsrasterlayerproperties.cpp (working copy) @@ -84,6 +84,16 @@ cboStdDev->insertItem("2.75"); cboStdDev->insertItem("3"); + //add items to the color stretch combo box + cboColorScalingAlgorithm->insertItem(tr("No Stretch")); + cboColorScalingAlgorithm->insertItem(tr("Stretch To MinMax")); + cboColorScalingAlgorithm->insertItem(tr("Stretch And Clip To MinMax")); + cboColorScalingAlgorithm->insertItem(tr("Clip To MinMax")); + + //add current NoDataValue to NoDataValue line edit + QString myStringHelper; + leNoDataValue->setText(myStringHelper.sprintf("%5.1f", rasterLayer->getNoDataValue())); + // // Set up the combo boxes that contain band lists using the qstring list generated above // @@ -277,11 +287,41 @@ rasterLayer->setMaxScale(spinMaximumScale->value()); rasterLayer->setTransparency(static_cast < unsigned int >(255 - sliderTransparency->value())); + + //set NoDataValue + bool myDoubleOk; + double myNoDataValue = leNoDataValue->text().toDouble(&myDoubleOk); + if(myDoubleOk) + { + rasterLayer->setNoDataValue(myNoDataValue); + } + else + { + leNoDataValue->setText("-9999.0"); + rasterLayer->setNoDataValue(-9999.0); + } + //set the color scaling algorithm + if(cboColorScalingAlgorithm->currentText() == tr("Stretch To MinMax")) + { + rasterLayer->setColorScalingAlgorithm(QgsRasterLayer::STRETCH_TO_MINMAX); + } + else if(cboColorScalingAlgorithm->currentText() == tr("Stretch And Clip To MinMax")) + { + rasterLayer->setColorScalingAlgorithm(QgsRasterLayer::STRETCH_AND_CLIP_TO_MINMAX); + } + else if(cboColorScalingAlgorithm->currentText() == tr("Clip To MinMax")) + { + rasterLayer->setColorScalingAlgorithm(QgsRasterLayer::CLIP_TO_MINMAX); + } + else + { + rasterLayer->setColorScalingAlgorithm(QgsRasterLayer::NO_STRETCH); + } + //set the std deviations to be plotted rasterLayer->setStdDevsToPlot(cboStdDev->currentText().toDouble()); //set whether the layer histogram should be inverted - if (cboxInvertColorMap->isChecked() - ) + if (cboxInvertColorMap->isChecked()) { rasterLayer->setInvertHistogramFlag(true); } @@ -777,9 +817,10 @@ bool myIgnoreOutOfRangeFlag = chkHistIgnoreOutOfRange->isChecked(); bool myThoroughBandScanFlag = chkHistAllowApproximation->isChecked(); +#ifdef QGISDEBUG long myCellCount = rasterLayer->getRasterXDim() * rasterLayer->getRasterYDim(); +#endif - #ifdef QGISDEBUG std::cout << "Computing histogram minima and maxima" << std::endl; #endif Index: src/ui/qgsrasterlayerpropertiesbase.ui =================================================================== --- src/ui/qgsrasterlayerpropertiesbase.ui (revision 6440) +++ src/ui/qgsrasterlayerpropertiesbase.ui (working copy) @@ -5,10 +5,18 @@ 0 0 - 564 - 522 + 589 + 619 + + + 7 + 7 + 0 + 0 + + Raster Layer Properties @@ -21,1071 +29,1105 @@ true - - - 9 + + + + 9 + 579 + 569 + 29 + - - 6 + + + 0 + + + 6 + + + + + true + + + &Help + + + F1 + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 280 + 20 + + + + + + + + &Apply + + + Alt+A + + + true + + + true + + + + + + + &OK + + + + + + true + + + true + + + + + + + &Cancel + + + + + + true + + + + + + + + + 9 + 9 + 571 + 561 + - - - - - Symbology - - - - 9 + + 0 + + + + Symbology + + + + 9 + + + 6 + + + + + Display - - 6 - - - - - Display - - + + + 9 + + + 6 + + + - 9 + 0 6 - - + + - Transparency: + NoDataValue sliderTransparency - - - - <p align="right">Full</p> - - + + - + + + + + + + 3 + 3 + 0 + 0 + + + + 255 + + + Qt::Horizontal + + + 25 + + + + + + + Invert Color Map + + + + + + + Transparency: + + + sliderTransparency + + + + + + + None + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 0% + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + <p align="right">Full</p> + + + + + + + true + + + + 7 + 1 + 0 + 0 + + + + <html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif"> +<p style="margin-top:14px" dir="ltr"><span style="font-weight:600">Notes</span></p> +</body></html> + + + + Q3TextEdit::WidgetWidth + + + + + + + Grayscale Image + + + + + + + Color Image + + + + + + + + + + Grayscale Image + + + + 9 + + + 6 + + + + + Qt::Vertical + + + + 20 + 21 + + + + + + + + + + + Color Map + + + cboColorMap + + + + + + + Qt::Vertical + + + + 20 + 21 + + + + + + + + + + + Gray + + + cboGray + + + + + + + + + + Color Image + + + + 9 + + + 6 + + + + + + + + + + + + + + + + + Transparent + + + + + + + <b><font color="#0000ff">Blue</font></b> + + + cboBlue + + + + + + + <b><font color="#ff0000">Red</font></b> + + + cboRed + + + + + + + <b><font color="#00ff00">Green</font></b> + + + cboGreen + + + + + + + Band + + + + + + + Color + + + + + + + + + + Stretch + + + + 9 + + + 6 + + + + + Color Scaling + + + cboStdDev + + + + + + + + + + Std Deviations + + + cboStdDev + + + + + + + + + + + + + + General + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + Thumbnail + + + Qt::Vertical + + + + 0 + + + 0 + + - Qt::Horizontal + Qt::Vertical + + QSizePolicy::Expanding + - 40 - 20 + 20 + 31 - - - - 0% - - - - - - - Qt::Horizontal - - + + + - 40 - 20 + 120 + 120 - - - - - - None + + QFrame::StyledPanel - - - - - - - 3 - 3 - 0 - 0 - - - - 255 - - - Qt::Horizontal - - - 25 - - - - - - - Grayscale Image - - - - - - - Color Image - - - - - - - Invert Color Map - - - - - - + true - - - 7 - 1 - 0 - 0 - - - - <html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif"> -<p style="margin-top:14px" dir="ltr"><span style="font-weight:600">Notes</span></p> -</body></html> - - - - Q3TextEdit::WidgetWidth - - - + + - Color Image + Legend: + + Qt::Vertical + - 9 + 0 - 6 + 0 - - - - - - - - - Color - - - - - - - Band - - - - Qt::Vertical + + QSizePolicy::Expanding + 20 - 40 + 71 - - - - - - - <b><font color="#00ff00">Green</font></b> - - - cboGreen - - - - - - <b><font color="#ff0000">Red</font></b> - - - cboRed - - - - - - - Qt::Vertical - - + + - 20 - 40 + 120 + 120 - - - - - - <b><font color="#0000ff">Blue</font></b> + + QFrame::Box - - cboBlue + + true - - - - Transparent - - - - - - - - + + - Grayscale Image + Palette: + + Qt::Vertical + - 9 + 0 - 6 + 0 - + Qt::Vertical + + QSizePolicy::Expanding + 20 - 21 + 61 - - - - Qt::Vertical - - + + + - 20 - 21 + 120 + 120 - - - - - - - - - Color Map + + QFrame::Box - - cboColorMap + + true - - - - Std Deviations - - - cboStdDev - - - - - - - - - - - - - Gray - - - cboGray - - - - - - - General - - + + + + + Display Name: + + + leDisplayName + + + + + + + + + + false + + + + + + + Layer Source: + + + leLayerSource + + + + + - 9 + 0 6 - - - - 0 - - - 6 - - - - - Thumbnail - - - Qt::Vertical - - - - 0 - - - 0 - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 31 - - - - - - - - - 120 - 120 - - - - QFrame::StyledPanel - - - true - - - - - - - - - - Legend: - - - Qt::Vertical - - - - 0 - - - 0 - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 71 - - - - - - - - - 120 - 120 - - - - QFrame::Box - - - true - - - - - - - - - - Palette: - - - Qt::Vertical - - - - 0 - - - 0 - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 61 - - - - - - - - - 120 - 120 - - - - QFrame::Box - - - true - - - - - - - - - - + + - Display Name: + Columns: - - leDisplayName - - - - - - - - false - - - - - + + - Layer Source: + Rows: - - leLayerSource - - - - - 0 - - - 6 - - - - - Columns: - - - - - - - Rows: - - - - - - - No Data: - - - - - - - + + - DebugInfo + No Data: - - - - Scale Dependent Visibility - - - true - - - - 9 + + + + + + DebugInfo + + + + + + + Scale Dependent Visibility + + + true + + + + 9 + + + 6 + + + + + Maximum scale at which this layer will be displayed. - - 6 + + 100000000 - - - - Maximum scale at which this layer will be displayed. - - - 100000000 - - - 1 - - - - - - - Maximum 1: - - - spinMaximumScale - - - - - - - Minimum scale at which this layer will be displayed. - - - 100000000 - - - 1 - - - - - - - Minimum 1: - - - spinMinimumScale - - - - - - - - - - Spatial Reference System - - - - 9 + + 1 - - 6 + + + + + + Maximum 1: - - - - Change - - - - - - - true - - - - - - - - - - - Metadata - - - - 9 + + spinMaximumScale + + + + + + + Minimum scale at which this layer will be displayed. + + + 100000000 + + + 1 + + + + + + + Minimum 1: + + + spinMinimumScale + + + + + + + + + + Spatial Reference System - - 6 + + + 9 + + + 6 + + + + + Change + + + + + + + true + + + + + + + + + + + Metadata + + + + 9 + + + 6 + + + + + + + + + Pyramids + + + + 9 + + + 6 + + + + + Pyramid Resolutions - - - - - - - - Pyramids - - - - 9 + + + + + + + 5 + 7 + 0 + 0 + - - 6 + + + 150 + 32767 + - - - - Pyramid Resolutions - - - - - - - - 5 - 7 - 0 - 0 - - - - - 150 - 32767 - - - - Q3ListBox::Multi - - - - - - - - 7 - 7 - 5 - 0 - - - - <html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif"> + + Q3ListBox::Multi + + + + + + + + 7 + 7 + 5 + 0 + + + + <html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif"> <p style="margin-top:18px" dir="ltr"><span style="font-size:15pt;font-weight:600">Description</span></p> <p dir="ltr">Large resolution raster layers can slow navigation in QGIS. By creating lower resolution copies of the data (pyramids) performance can be considerably improved as QGIS selects the most suitable resolution to use depending on the level of zoom. You must have write access in the directory where the original data is stored to build pyramids. </p> <p dir="ltr"><span style="color:#ff0000">Please note that building pyramids may alter the original data file and once created they cannot be removed.</span></p> <p dir="ltr"><span style="color:#ff0000">Please note that building pyramids could corrupt your image - always make a backup of your data first!</span></p> </body></html> - - - Q3TextEdit::WidgetWidth - - - - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 156 - 20 - - - - - - - - Resampling Method - - - cboResamplingMethod - - - - - - - - Average - - - - - Nearest Neighbour - - - - - - - - Build Pyramids - - - - - - - - - - Histogram - - + + + Q3TextEdit::WidgetWidth + + + + + - 9 + 0 6 - - - + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + - 256 - 32767 + 156 + 20 - - Q3ListBox::Multi - - + - - - - Options + + + + Resampling Method - - - 9 - - - 6 - - - - - Column Count: - - - - - - - Out Of Range OK? - - - - - - - Allow Approximation - - - true - - - - - - - 1024 - - - 8 - - - 8 - - - 64 - - - - + + cboResamplingMethod + - - - - Chart Type - - - - 9 + + + + + Average - - 6 + + + + Nearest Neighbour - - - - Line Graph - - - true - - - - - - - Bar Chart - - - - + - - + + - Refresh + Build Pyramids - - - - - 7 - 5 - 0 - 0 - - - - - 200 - 200 - - - - QFrame::Box - - - true - - - 0 - - - - - - - - + + + + + + Histogram + + - 0 + 9 6 - - - - true + + + + + 7 + 5 + 0 + 0 + - - &Help - - - F1 - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - + - 280 - 20 + 200 + 200 - - - - - - &Apply + + QFrame::Box - - Alt+A - - + true - - true + + 0 - - + + - &OK + Refresh - - + + + + + + Chart Type - - true + + + 9 + + + 6 + + + + + Line Graph + + + true + + + + + + + Bar Chart + + + + + + + + + + Options - - true - + + + 9 + + + 6 + + + + + Column Count: + + + + + + + Out Of Range OK? + + + + + + + Allow Approximation + + + true + + + + + + + 1024 + + + 8 + + + 8 + + + 64 + + + + - - - - &Cancel + + + + + 256 + 32767 + - - + + Q3ListBox::Multi - - true - - - + + - + - Q3TextEdit + Q3ListBox Q3Frame -
q3textedit.h
+
q3listbox.h
- Q3ListBox + Q3TextEdit Q3Frame -
q3listbox.h
+
q3textedit.h
Q3GroupBox @@ -1131,6 +1173,7 @@ chkHistAllowApproximation pbnHistRefresh +