diff --git a/python/core/qgsrasterlayer.sip b/python/core/qgsrasterlayer.sip index 9cac02f8deb..7eb2db548eb 100644 --- a/python/core/qgsrasterlayer.sip +++ b/python/core/qgsrasterlayer.sip @@ -269,16 +269,24 @@ public: QString colorShadingAlgorithmAsString() const; /** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */ - void computeMinimumMaximumEstimates( int theBand, double* theMinMax ); + // (would need MethodCode directive) void computeMinimumMaximumEstimates( int theBand, double* theMinMax ); /** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */ - void computeMinimumMaximumEstimates( QString theBand, double* theMinMax ); + // (would need MethodCode directive) void computeMinimumMaximumEstimates( QString theBand, double* theMinMax ); + + /** \brief Wrapper for GDALComputeRasterMinMax with the estimate option + \note added in v1.6 */ + void computeMinimumMaximumEstimates( int theBand, double& theMin /Out/, double& theMax /Out/ ); + + /** \brief Compute the actual minimum maximum pixel values based on the current (last) display extent */ + // (would need MethodCode directive) void computeMinimumMaximumFromLastExtent( int theBand, double* theMinMax ); /** \brief Compute the actual minimum maximum pixel values based on the current (last) display extent */ - void computeMinimumMaximumFromLastExtent( int theBand, double* theMinMax ); + // (would need MethodCode directive) void computeMinimumMaximumFromLastExtent( QString theBand, double* theMinMax ); - /** \brief Compute the actual minimum maximum pixel values based on the current (last) display extent */ - void computeMinimumMaximumFromLastExtent( QString theBand, double* theMinMax ); + /** \brief Compute the actual minimum maximum pixel values based on the current (last) display extent + \note added in v1.6 */ + void computeMinimumMaximumFromLastExtent( int theBand, double& theMin /Out/, double& theMax /Out/ ); /** \brief Get a pointer to the contrast enhancement for the selected band */ QgsContrastEnhancement* contrastEnhancement( unsigned int theBand ); diff --git a/src/core/raster/qgsrasterlayer.cpp b/src/core/raster/qgsrasterlayer.cpp index 004f32b9141..e9ee586f732 100644 --- a/src/core/raster/qgsrasterlayer.cpp +++ b/src/core/raster/qgsrasterlayer.cpp @@ -1243,6 +1243,14 @@ void QgsRasterLayer::computeMinimumMaximumEstimates( QString theBand, double* th computeMinimumMaximumEstimates( bandNumber( theBand ), theMinMax ); } +void QgsRasterLayer::computeMinimumMaximumEstimates( int theBand, double& theMin, double& theMax ) +{ + double theMinMax[2]; + computeMinimumMaximumEstimates( theBand, theMinMax ); + theMin = theMinMax[0]; + theMax = theMinMax[1]; +} + /** * @param theBand The band (number) for which to calculate the min max values * @param theMinMax Pointer to a double[2] which hold the estimated min max @@ -1293,6 +1301,14 @@ void QgsRasterLayer::computeMinimumMaximumFromLastExtent( QString theBand, doubl computeMinimumMaximumFromLastExtent( bandNumber( theBand ), theMinMax ); } +void QgsRasterLayer::computeMinimumMaximumFromLastExtent( int theBand, double& theMin, double& theMax ) +{ + double theMinMax[2]; + computeMinimumMaximumFromLastExtent( theBand, theMinMax ); + theMin = theMinMax[0]; + theMax = theMinMax[1]; +} + /** * @param theBand The band (number) for which to get the contrast enhancement for * @return Pointer to the contrast enhancement or 0 on failure diff --git a/src/core/raster/qgsrasterlayer.h b/src/core/raster/qgsrasterlayer.h index 92974522555..fc690a9ac1d 100644 --- a/src/core/raster/qgsrasterlayer.h +++ b/src/core/raster/qgsrasterlayer.h @@ -440,11 +440,19 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer /** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */ void computeMinimumMaximumEstimates( QString theBand, double* theMinMax ); + /** \brief Wrapper for GDALComputeRasterMinMax with the estimate option + \note added in v1.6 */ + void computeMinimumMaximumEstimates( int theBand, double& theMin, double& theMax ); + /** \brief Compute the actual minimum maximum pixel values based on the current (last) display extent */ void computeMinimumMaximumFromLastExtent( int theBand, double* theMinMax ); /** \brief Compute the actual minimum maximum pixel values based on the current (last) display extent */ void computeMinimumMaximumFromLastExtent( QString theBand, double* theMinMax ); + + /** \brief Compute the actual minimum maximum pixel values based on the current (last) display extent + \note added in v1.6 */ + void computeMinimumMaximumFromLastExtent( int theBand, double& theMin, double& theMax ); /** \brief Get a pointer to the contrast enhancement for the selected band */ QgsContrastEnhancement* contrastEnhancement( unsigned int theBand );