Skip to content

Commit

Permalink
fix doxygen warnings and add copyright headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 26, 2012
1 parent 9980b45 commit 812a51e
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 14 deletions.
15 changes: 8 additions & 7 deletions src/core/qgsrasterdataprovider.cpp
Expand Up @@ -22,8 +22,7 @@
#include <QTime>
#include <QMap>
#include <QByteArray>

#include <cmath>
#include <qmath>

void QgsRasterDataProvider::readBlock( int bandNo, QgsRectangle
const & viewExtent, int width,
Expand Down Expand Up @@ -271,7 +270,8 @@ QByteArray QgsRasterDataProvider::noValueBytes( int theBandNo )
}
return ba;
}
/*

#if 0
QgsRasterBandStats QgsRasterDataProvider::bandStatistics( int theBandNo )
{
// TODO: cache stats here in provider
Expand Down Expand Up @@ -398,7 +398,7 @@ QgsRasterBandStats QgsRasterDataProvider::bandStatistics( int theBandNo )
}

myRasterBandStats.sumOfSquares += static_cast < double >
( pow( myValue - myRasterBandStats.mean, 2 ) );
( qPow( myValue - myRasterBandStats.mean, 2 ) );
}
}
} //end of column wise loop
Expand All @@ -420,7 +420,8 @@ QgsRasterBandStats QgsRasterDataProvider::bandStatistics( int theBandNo )
myRasterBandStats.statsGathered = true;
return myRasterBandStats;
}
*/
#endif

QgsRasterBandStats QgsRasterDataProvider::statisticsDefaults( int theBandNo,
const QgsRectangle & theExtent,
int theSampleSize )
Expand Down Expand Up @@ -565,7 +566,7 @@ QgsRasterBandStats QgsRasterDataProvider::bandStatistics( int theBandNo,
}

//myRasterBandStats.sumOfSquares += static_cast < double >
// ( pow( myValue - myRasterBandStats.mean, 2 ) );
// ( qPow( myValue - myRasterBandStats.mean, 2 ) );

// Single pass stdev
double myDelta = myValue - myMean;
Expand Down Expand Up @@ -813,7 +814,7 @@ QgsRasterHistogram QgsRasterDataProvider::histogram( int theBandNo,
continue; // NULL
}

int myBinIndex = static_cast <int>( floor(( myValue - myMinimum ) / myBinSize ) ) ;
int myBinIndex = static_cast <int>( qFloor(( myValue - myMinimum ) / myBinSize ) ) ;
//QgsDebugMsg( QString( "myValue = %1 myBinIndex = %2" ).arg( myValue ).arg( myBinIndex ) );

if (( myBinIndex < 0 || myBinIndex > ( myBinCount - 1 ) ) && !theIncludeOutOfRange )
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsrasterdataprovider.h
Expand Up @@ -322,6 +322,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
* @param theMaximum Maximum value, if NaN, raster minimum value will be used.
* @param theExtent Extent used to calc histogram, if empty, whole raster extent is used.
* @param theSampleSize Approximate number of cells in sample. If 0, all cells (whole raster will be used). If raster does not have exact size (WCS without exact size for example), provider decides size of sample.
* @param theIncludeOutOfRange include out of range values
* @return Vector of non NULL cell counts for each bin.
*/
virtual QgsRasterHistogram histogram( int theBandNo,
Expand Down
3 changes: 3 additions & 0 deletions src/core/raster/qgsrasterdrawer.h
Expand Up @@ -37,6 +37,9 @@ class QgsRasterDrawer

protected:
/**Draws raster part
@param p the painter to draw to
@param viewPort view port to draw to
@param img image to draw
@param topLeftCol Left position relative to left border of viewport
@param topLeftRow Top position relative to top border of viewport*/
void drawImage( QPainter* p, QgsRasterViewPort* viewPort, const QImage& img, int topLeftCol, int topLeftRow ) const;
Expand Down
14 changes: 14 additions & 0 deletions src/core/raster/qgsrasterfilewriter.cpp
@@ -1,3 +1,17 @@
/***************************************************************************
qgsrasterfilewriter.cpp
---------------------
begin : July 2012
copyright : (C) 2012 by Marco Hugentobler
email : marco dot hugentobler at sourcepole dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "qgsrasterfilewriter.h"
#include "qgsproviderregistry.h"
#include "qgsrasterinterface.h"
Expand Down
20 changes: 19 additions & 1 deletion src/core/raster/qgsrasterfilewriter.h
@@ -1,3 +1,17 @@
/***************************************************************************
qgsrasterfilewriter.h
---------------------
begin : July 2012
copyright : (C) 2012 by Marco Hugentobler
email : marco dot hugentobler at sourcepole dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSRASTERFILEWRITER_H
#define QGSRASTERFILEWRITER_H

Expand Down Expand Up @@ -27,8 +41,12 @@ class CORE_EXPORT QgsRasterFileWriter
~QgsRasterFileWriter();

/**Write raster file
@param iter raster iterator
@param nCols number of output columns
@param nRows number of output rows (or -1 to automatically calculate row number to have square pixels)*/
@param nRows number of output rows (or -1 to automatically calculate row number to have square pixels)
@param outputExtent extent to output
@param crs crs to reproject to
@param p dialog to show progress in */
WriterError writeRaster( QgsRasterIterator* iter, int nCols, int nRows, QgsRectangle outputExtent,
const QgsCoordinateReferenceSystem& crs, QProgressDialog* p = 0 );

Expand Down
14 changes: 14 additions & 0 deletions src/core/raster/qgsrasteriterator.cpp
@@ -1,3 +1,17 @@
/***************************************************************************
qgsrasteriterator.cpp
---------------------
begin : July 2012
copyright : (C) 2012 by Marco Hugentobler
email : marco dot hugentobler at sourcepole dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "qgsrasteriterator.h"
#include "qgsrasterinterface.h"
#include "qgsrasterprojector.h"
Expand Down
27 changes: 23 additions & 4 deletions src/core/raster/qgsrasteriterator.h
@@ -1,3 +1,17 @@
/***************************************************************************
qgsrasteriterator.h
---------------------
begin : July 2012
copyright : (C) 2012 by Marco Hugentobler
email : marco dot hugentobler at sourcepole dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSRASTERITERATOR_H
#define QGSRASTERITERATOR_H

Expand Down Expand Up @@ -27,16 +41,21 @@ class CORE_EXPORT QgsRasterIterator
~QgsRasterIterator();

/**Start reading of raster band. Raster data can then be retrieved by calling readNextRasterPart until it returns false.
@param bandNumer number of raster band to read
@param viewPort describes raster position on screen
@param bandNumber number of raster band to read
@param nCols number of columns
@param nRows number of rows
@param extent area to read
*/
void startRasterRead( int bandNumber, int nCols, int nRows, const QgsRectangle& extent );

/**Fetches next part of raster data
@param bandNumber band to read
@param nCols number of columns on output device
@param nRows number of rows on output device
@param nColsRaster number of raster columns (different to nCols if oversamplingX != 1.0)
@param nRowsRaster number of raster rows (different to nRows if oversamplingY != 0)*/
@param rasterData to return the pointer to raster data in
@param topLeftCol top left column
@param topLeftRow top left row
@return false if the last part was already returned*/
bool readNextRasterPart( int bandNumber,
int& nCols, int& nRows,
void** rasterData,
Expand Down
4 changes: 2 additions & 2 deletions src/gui/raster/qgsrasterhistogramwidget.cpp
Expand Up @@ -204,8 +204,8 @@ void QgsRasterHistogramWidget::on_btnHistoCompute_clicked()
bool QgsRasterHistogramWidget::computeHistogram( bool forceComputeFlag )
{
const int BINCOUNT = RASTER_HISTOGRAM_BINS; // 256 - defined in qgsrasterdataprovider.h
bool myIgnoreOutOfRangeFlag = true;
bool myThoroughBandScanFlag = false;
//bool myIgnoreOutOfRangeFlag = true;
//bool myThoroughBandScanFlag = false;
int myBandCountInt = mRasterLayer->bandCount();

// if forceComputeFlag = false make sure raster has cached histogram, else return false
Expand Down

0 comments on commit 812a51e

Please sign in to comment.