Skip to content

Commit

Permalink
Fixed wrappers from QgsRasterLayer::computeMinimumMaximumFromLastExte…
Browse files Browse the repository at this point in the history
…nt, computeMinimumMaximumEstimates

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14017 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Aug 6, 2010
1 parent b4ec703 commit ff71ad6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
16 changes: 12 additions & 4 deletions python/core/qgsrasterlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
void computeMinimumMaximumFromLastExtent( int theBand, double* theMinMax );
// (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( QString 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
\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 );
Expand Down
16 changes: 16 additions & 0 deletions src/core/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/core/raster/qgsrasterlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit ff71ad6

Please sign in to comment.