Skip to content
Permalink
Browse files

preliminary raster pipes support

  • Loading branch information
blazek committed Jul 1, 2012
1 parent 778f20b commit 87607187779861a5dc5a126f375281e825a7917a
@@ -160,11 +160,13 @@ SET(QGIS_CORE_SRCS
raster/qgslinearminmaxenhancement.cpp
raster/qgslinearminmaxenhancementwithclip.cpp
raster/qgspseudocolorshader.cpp
raster/qgsrasterface.cpp
raster/qgsrasterlayer.cpp
raster/qgsrastertransparency.cpp
raster/qgsrastershader.cpp
raster/qgsrastershaderfunction.cpp

raster/qgsrasterdrawer.cpp
raster/qgsrasterrendererregistry.cpp
raster/qgsrasterrenderer.cpp
raster/qgsbilinearrasterresampler.cpp
@@ -385,6 +387,7 @@ SET(QGIS_CORE_HDRS
raster/qgspseudocolorshader.h
raster/qgsrasterpyramid.h
raster/qgsrasterbandstats.h
raster/qgsrasterface.h
raster/qgsrasterlayer.h
raster/qgsrastertransparency.h
raster/qgsrastershader.h
@@ -93,6 +93,16 @@ void QgsRasterDataProvider::readBlock( int bandNo, QgsRectangle
free( mySrcData );
}

void * QgsRasterDataProvider::readBlock( int bandNo, QgsRectangle const & extent, int width, int height )
{
QgsDebugMsg( QString( "bandNo = %1 width = %2 height = %3" ).arg( bandNo ).arg( width ).arg( height ) );

// TODO: replace VSIMalloc, it is GDAL function
void * data = VSIMalloc( dataTypeSize( bandNo ) * width * height );
readBlock( bandNo, extent, width, height, data );

return data;
}

QgsRasterDataProvider::QgsRasterDataProvider(): mDpi( -1 )
{
@@ -25,6 +25,7 @@
#include "qgslogger.h"
#include "qgsrectangle.h"
#include "qgsdataprovider.h"
#include "qgsrasterface.h"
#include "qgscolorrampshader.h"
#include "qgsrasterpyramid.h"
#include "qgscoordinatereferencesystem.h"
@@ -47,7 +48,7 @@ class QByteArray;
* QgsVectorDataProvider, and does not yet make
* sense for Raster layers.
*/
class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider
class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRasterFace
{

Q_OBJECT
@@ -328,6 +329,9 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider
/** read block of data using give extent and size */
virtual void readBlock( int bandNo, QgsRectangle const & viewExtent, int width, int height, QgsCoordinateReferenceSystem theSrcCRS, QgsCoordinateReferenceSystem theDestCRS, void *data );

/** Read block of data using given extent and size. */
virtual void * readBlock( int bandNo, QgsRectangle const & extent, int width, int height );

/* Read a value from a data block at a given index. */
virtual double readValue( void *data, int type, int index );

0 comments on commit 8760718

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