Skip to content
Permalink
Browse files

fix doxygen warnings and add copyright headers

  • Loading branch information
jef-n committed Jul 26, 2012
1 parent 9980b45 commit 812a51e33f37795e34635790992a169d54036e65
@@ -22,8 +22,7 @@
#include <QTime>
#include <QMap>
#include <QByteArray>

#include <cmath>
#include <qmath>

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

#if 0
QgsRasterBandStats QgsRasterDataProvider::bandStatistics( int theBandNo )
{
// TODO: cache stats here in provider
@@ -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
@@ -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 )
@@ -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;
@@ -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 )
@@ -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,
@@ -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;
@@ -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"
@@ -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

@@ -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 );

@@ -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"
@@ -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

@@ -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,
@@ -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

0 comments on commit 812a51e

Please sign in to comment.
You can’t perform that action at this time.