26 , mRasterViewPort( nullptr )
77 myProjectedViewExtent = rendererContext.
extent();
78 myProjectedLayerExtent = layer->
extent();
104 mRasterViewPort->mDrawnExtent = myRasterExtent;
107 mRasterViewPort->mSrcCRS = layer->
crs();
116 mRasterViewPort->mSrcDatumTransform = -1;
117 mRasterViewPort->mDestDatumTransform = -1;
130 mRasterViewPort->mTopLeftPoint.
setX( floor( mRasterViewPort->mTopLeftPoint.x() ) );
131 mRasterViewPort->mTopLeftPoint.setY( floor( mRasterViewPort->mTopLeftPoint.y() ) );
132 mRasterViewPort->mBottomRightPoint.setX( ceil( mRasterViewPort->mBottomRightPoint.x() ) );
133 mRasterViewPort->mBottomRightPoint.setY( ceil( mRasterViewPort->mBottomRightPoint.y() ) );
137 mRasterViewPort->mBottomRightPoint.y() ),
139 mRasterViewPort->mTopLeftPoint.y() )
143 mRasterViewPort->mWidth =
static_cast<int>( mRasterViewPort->mBottomRightPoint.x() - mRasterViewPort->mTopLeftPoint.x() );
144 mRasterViewPort->mHeight =
static_cast<int>( mRasterViewPort->mBottomRightPoint.y() - mRasterViewPort->mTopLeftPoint.y() );
int mapWidth() const
Return current map width in pixels The information is only known if setRotation was used...
A rectangle specified with double values.
bool isEmpty() const
test if rectangle is empty.
void setMapRotation(double degrees, double cx, double cy)
Set map rotation in degrees (clockwise)
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
Transform the point from map (world) coordinates to device coordinates.
QgsRasterInterface * last() const
const QgsRectangle & extent() const
double scaleFactor() const
const QgsCoordinateTransform * coordinateTransform() const
QString tr(const char *sourceText, const char *disambiguation, int n)
double mapRotation() const
Return current map rotation in degrees.
virtual bool render() override
Do the rendering (based on data stored in the class)
double x() const
Get the x value of the point.
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)
static void logMessage(const QString &message, const QString &tag=QString::null, MessageLevel level=WARNING)
add a message to the instance (and create it if necessary)
double rasterScaleFactor() const
double mapUnitsPerPixel() const
Return current map units per pixel.
QgsRasterProjector * projector() const
A class to represent a point.
void setX(double x)
Sets the x value of the point.
QgsCoordinateReferenceSystem mSrcCRS
Source coordinate system.
QgsPoint toMapCoordinatesF(double x, double y) const
Transform device coordinates to map (world) coordinates.
QgsPoint toMapCoordinates(int x, int 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)
int mapHeight() const
Return current map height in pixels.
const QgsMapToPixel & mapToPixel() const
double y() const
Get the y value of the point.
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.
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.