26 , mRasterViewPort( 0 )
39 QgsDebugMsg(
"coordinateTransform set -> project extents." );
63 myProjectedViewExtent = rendererContext.
extent();
64 myProjectedLayerExtent = layer->
extent();
90 mRasterViewPort->mDrawnExtent = myRasterExtent;
93 mRasterViewPort->mSrcCRS = layer->
crs();
102 mRasterViewPort->mSrcDatumTransform = -1;
103 mRasterViewPort->mDestDatumTransform = -1;
116 mRasterViewPort->mTopLeftPoint.
setX( floor( mRasterViewPort->mTopLeftPoint.x() ) );
117 mRasterViewPort->mTopLeftPoint.setY( floor( mRasterViewPort->mTopLeftPoint.y() ) );
118 mRasterViewPort->mBottomRightPoint.setX( ceil( mRasterViewPort->mBottomRightPoint.x() ) );
119 mRasterViewPort->mBottomRightPoint.setY( ceil( mRasterViewPort->mBottomRightPoint.y() ) );
123 mRasterViewPort->mBottomRightPoint.y() ),
125 mRasterViewPort->mTopLeftPoint.y() )
129 mRasterViewPort->mWidth =
static_cast<int>( mRasterViewPort->mBottomRightPoint.x() - mRasterViewPort->mTopLeftPoint.x() );
130 mRasterViewPort->mHeight =
static_cast<int>( mRasterViewPort->mBottomRightPoint.y() - mRasterViewPort->mTopLeftPoint.y() );
145 QgsDebugMsgLevel( QString(
"mTopLeftPoint.x() = %1" ).arg( mRasterViewPort->mTopLeftPoint.x() ), 3 );
146 QgsDebugMsgLevel( QString(
"mBottomRightPoint.x() = %1" ).arg( mRasterViewPort->mBottomRightPoint.x() ), 3 );
147 QgsDebugMsgLevel( QString(
"mTopLeftPoint.y() = %1" ).arg( mRasterViewPort->mTopLeftPoint.y() ), 3 );
148 QgsDebugMsgLevel( QString(
"mBottomRightPoint.y() = %1" ).arg( mRasterViewPort->mBottomRightPoint.y() ), 3 );
150 QgsDebugMsgLevel( QString(
"mWidth = %1" ).arg( mRasterViewPort->mWidth ), 3 );
151 QgsDebugMsgLevel( QString(
"mHeight = %1" ).arg( mRasterViewPort->mHeight ), 3 );
201 QgsDebugMsg( QString(
"total raster draw time (ms): %1" ).arg( time.elapsed(), 5 ) );
A rectangle specified with double values.
bool isEmpty() const
test if rectangle is empty.
void setMinimal()
Set a rectangle so that min corner is at max and max corner is at min.
Base class for processing modules.
void setCRS(const QgsCoordinateReferenceSystem &theSrcCRS, const QgsCoordinateReferenceSystem &theDestCRS, int srcDatumTransform=-1, int destDatumTransform=-1)
set source and destination CRS
Iterator for sequentially processing raster cells.
double yMaximum() const
Get the y maximum value (top side of rectangle)
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
QgsRasterPipe * pipe()
Get raster pipe.
~QgsRasterLayerRenderer()
const QgsMapToPixel * mMapToPixel
QgsPoint transform(const QgsPoint &p) const
QgsRasterInterface * last() const
const QgsRectangle & extent() const
double scaleFactor() const
const QgsCoordinateTransform * coordinateTransform() const
static void logMessage(QString message, QString tag=QString::null, MessageLevel level=WARNING)
add a message to the instance (and create it if necessary)
QgsCoordinateReferenceSystem mDestCRS
Target coordinate system.
void set(const QgsPoint &p1, const QgsPoint &p2)
Set the rectangle from two QgsPoints.
Perform transforms between map coordinates and device coordinates.
The drawing pipe for raster layers.
int height() const
Accessor that returns the height of the (unclipped) raster.
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
double xMaximum() const
Get the x maximum value (right side of rectangle)
#define QgsDebugMsgLevel(str, level)
QgsRasterLayerRenderer(QgsRasterLayer *layer, QgsRenderContext &rendererContext)
double rasterScaleFactor() const
double mapUnitsPerPixel() const
Return current map units per pixel.
QgsRasterProjector * projector() const
QgsCoordinateReferenceSystem mSrcCRS
Source coordinate system.
QgsPoint toMapCoordinatesF(double x, double y) const
QgsRasterViewPort * mRasterViewPort
Contains information about the context of a rendering operation.
QgsRectangle intersect(const QgsRectangle *rect) const
return the intersection with the given rectangle
Class for storing a coordinate reference system (CRS)
const QgsMapToPixel & mapToPixel() const
Base class for utility classes that encapsulate information necessary for rendering of map layers...
const QgsCoordinateReferenceSystem & crs() const
Returns layer's spatial reference system.
QgsRasterDataProvider * dataProvider()
Returns the data provider.
Custom exception class for Coordinate Reference System related exceptions.
virtual bool render()
Do the rendering (based on data stored in the class)
This class provides details of the viewable area that a raster will be rendered into.
virtual QgsRectangle extent()
Return the extent of the layer.
QString toString(bool automaticPrecision=false) const
returns string representation of form xmin,ymin xmax,ymax
double xMinimum() const
Get the x minimum value (left side of rectangle)
void setDpi(int dpi)
Sets the output device resolution.
int width() const
Accessor that returns the width of the (unclipped) raster.