Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 13, 2018
1 parent 059f343 commit 3ca9618
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmreclassifybylayer.cpp
Expand Up @@ -37,7 +37,7 @@ QString QgsReclassifyAlgorithmBase::groupId() const
return QStringLiteral( "rasteranalysis" );
}

void QgsReclassifyAlgorithmBase::initAlgorithm( const QVariantMap &configuration )
void QgsReclassifyAlgorithmBase::initAlgorithm( const QVariantMap & )
{
addParameter( new QgsProcessingParameterRasterLayer( QStringLiteral( "INPUT_RASTER" ),
QObject::tr( "Raster layer" ) ) );
Expand Down
14 changes: 7 additions & 7 deletions src/analysis/processing/qgsreclassifyutils.cpp 100755 → 100644
Expand Up @@ -26,10 +26,10 @@

///@cond PRIVATE

void QgsReclassifyUtils::reclassify(const QVector<QgsReclassifyUtils::RasterClass> &classes, QgsRasterInterface *sourceRaster, int band,
const QgsRectangle &extent, int sourceWidthPixels, int sourceHeightPixels,
void QgsReclassifyUtils::reclassify( const QVector<QgsReclassifyUtils::RasterClass> &classes, QgsRasterInterface *sourceRaster, int band,
const QgsRectangle &extent, int sourceWidthPixels, int sourceHeightPixels,
QgsRasterDataProvider *destinationRaster, double destNoDataValue, bool useNoDataForMissingValues,
QgsProcessingFeedback *feedback )
QgsProcessingFeedback *feedback )
{
int maxWidth = 4000;
int maxHeight = 4000;
Expand All @@ -52,8 +52,8 @@ void QgsReclassifyUtils::reclassify(const QVector<QgsReclassifyUtils::RasterClas
bool reclassed = false;
while ( iter.readNextRasterPart( band, iterCols, iterRows, &rasterBlock, iterLeft, iterTop ) )
{
if ( feedback )
feedback->setProgress( 100 * ( ( iterTop / maxHeight * nbBlocksWidth ) + iterLeft / maxWidth ) / nbBlocks );
if ( feedback )
feedback->setProgress( 100 * ( ( iterTop / maxHeight * nbBlocksWidth ) + iterLeft / maxWidth ) / nbBlocks );
std::unique_ptr< QgsRasterBlock > reclassifiedBlock = qgis::make_unique< QgsRasterBlock >( Qgis::Float32, iterCols, iterRows );

for ( int row = 0; row < iterRows; row++ )
Expand Down Expand Up @@ -82,14 +82,14 @@ void QgsReclassifyUtils::reclassify(const QVector<QgsReclassifyUtils::RasterClas
destinationRaster->setEditable( false );
}

double QgsReclassifyUtils::reclassifyValue(const QVector<QgsReclassifyUtils::RasterClass> &classes, double input, bool &reclassified)
double QgsReclassifyUtils::reclassifyValue( const QVector<QgsReclassifyUtils::RasterClass> &classes, double input, bool &reclassified )
{
reclassified = false;
for ( const QgsReclassifyUtils::RasterClass &c : classes )
{
if ( c.contains( input ) )
{
reclassified = true;
reclassified = true;
return c.value;
}
}
Expand Down
48 changes: 24 additions & 24 deletions src/analysis/processing/qgsreclassifyutils.h 100755 → 100644
Expand Up @@ -46,22 +46,22 @@ class ANALYSIS_EXPORT QgsReclassifyUtils
*/
class RasterClass : public QgsRasterRange
{
public:
public:

//! Default constructor for an empty class
RasterClass() = default;

/**
* Constructor for RasterClass, with the specified range of min to max values.
* The \a value argument gives the desired output value for this raster class.
*/
RasterClass( double minValue, double maxValue, QgsRasterRange::BoundsType type, double value )
: QgsRasterRange( minValue, maxValue, type )
, value( value )
{}

//! Desired output value for class
double value = 0;
RasterClass() = default;

/**
* Constructor for RasterClass, with the specified range of min to max values.
* The \a value argument gives the desired output value for this raster class.
*/
RasterClass( double minValue, double maxValue, QgsRasterRange::BoundsType type, double value )
: QgsRasterRange( minValue, maxValue, type )
, value( value )
{}

//! Desired output value for class
double value = 0;
};

/**
Expand All @@ -85,15 +85,15 @@ class ANALYSIS_EXPORT QgsReclassifyUtils
* The \a feedback argument gives an optional processing feedback, for progress reports
* and cancelation.
*/
static void reclassify(const QVector< RasterClass > &classes,
QgsRasterInterface *sourceRaster,
int band,
const QgsRectangle& extent,
int sourceWidthPixels,
int sourceHeightPixels,
QgsRasterDataProvider *destinationRaster,
double destNoDataValue, bool useNoDataForMissingValues,
QgsProcessingFeedback *feedback = nullptr );
static void reclassify( const QVector< RasterClass > &classes,
QgsRasterInterface *sourceRaster,
int band,
const QgsRectangle &extent,
int sourceWidthPixels,
int sourceHeightPixels,
QgsRasterDataProvider *destinationRaster,
double destNoDataValue, bool useNoDataForMissingValues,
QgsProcessingFeedback *feedback = nullptr );

/**
* Reclassifies a single \a input value, using the specified list of \a classes.
Expand All @@ -104,7 +104,7 @@ class ANALYSIS_EXPORT QgsReclassifyUtils
* If no matching class was found then \a reclassified will be set to false, and the
* original \a input value returned unchanged.
*/
static double reclassifyValue( const QVector< RasterClass > &classes, double input, bool& reclassified );
static double reclassifyValue( const QVector< RasterClass > &classes, double input, bool &reclassified );

};

Expand Down

0 comments on commit 3ca9618

Please sign in to comment.