26 , mRasterViewPort( nullptr )
28 , mContext( rendererContext )
65 myProjectedViewExtent = rendererContext.
extent();
93 myProjectedViewExtent = rendererContext.
extent();
94 myProjectedLayerExtent = layer->
extent();
101 QgsDebugMsg(
"draw request outside view extent." );
120 mRasterViewPort->mDrawnExtent = myRasterExtent;
123 mRasterViewPort->mSrcCRS = layer->
crs();
132 mRasterViewPort->mSrcDatumTransform = -1;
133 mRasterViewPort->mDestDatumTransform = -1;
146 mRasterViewPort->mTopLeftPoint.
setX( floor( mRasterViewPort->mTopLeftPoint.x() ) );
147 mRasterViewPort->mTopLeftPoint.setY( floor( mRasterViewPort->mTopLeftPoint.y() ) );
148 mRasterViewPort->mBottomRightPoint.setX( ceil( mRasterViewPort->mBottomRightPoint.x() ) );
149 mRasterViewPort->mBottomRightPoint.setY( ceil( mRasterViewPort->mBottomRightPoint.y() ) );
153 mRasterViewPort->mBottomRightPoint.y() ),
155 mRasterViewPort->mTopLeftPoint.y() )
159 mRasterViewPort->mWidth =
static_cast<int>( mRasterViewPort->mBottomRightPoint.x() - mRasterViewPort->mTopLeftPoint.x() );
160 mRasterViewPort->mHeight =
static_cast<int>( mRasterViewPort->mBottomRightPoint.y() - mRasterViewPort->mTopLeftPoint.y() );
244 , mMinimalPreviewInterval( 250 )
int width() const
Accessor that returns the width of the (unclipped) raster.
virtual QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be null)
A rectangle specified with double values.
void setMapRotation(double degrees, double cx, double cy)
Set map rotation in degrees (clockwise)
bool renderPartialOutput() const
Whether our painter is drawing to a temporary image used just by this layer.
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.
Specific internal feedback class to provide preview of raster layer rendering.
Feedback(QgsRasterLayerRenderer *r)
Create feedback object based on our layer renderer.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
QgsRasterPipe * pipe()
Get raster pipe.
~QgsRasterLayerRenderer()
const QgsMapToPixel * mMapToPixel
QgsRasterProjector * projector() const
const QgsCoordinateReferenceSystem & crs() const
Returns layer's spatial reference system.
QgsRasterInterface * last() const
QgsPoint toMapCoordinates(int x, int y) const
int msecsTo(const QTime &t) const
QgsRectangle intersect(const QgsRectangle *rect) const
return the intersection with the given rectangle
void setRenderPartialOutput(bool enable)
Set whether our painter is drawing to a temporary image used just by this layer.
int height() const
Accessor that returns the height of the (unclipped) raster.
Implementation of threaded rendering for raster layers.
QString tr(const char *sourceText, const char *disambiguation, int n)
virtual bool render() override
Do the rendering (based on data stored in the class)
QgsRenderContext & mContext
double y() const
Get the y value of the point.
double mapRotation() const
Return current map rotation in degrees.
QgsCoordinateReferenceSystem mDestCRS
Target coordinate system.
void set(const QgsPoint &p1, const QgsPoint &p2)
Set the rectangle from two QgsPoints.
Base class for feedback objects to be used for cancellation of something running in a worker thread...
QgsPoint transform(const QgsPoint &p) const
Transform the point from map (world) coordinates to device coordinates.
QString toString(bool automaticPrecision=false) const
returns string representation of form xmin,ymin xmax,ymax
Perform transforms between map coordinates and device coordinates.
The drawing pipe for raster layers.
int mapWidth() const
Return current map width in pixels The information is only known if setRotation was used...
int mapHeight() const
Return current map height in pixels.
void setPreviewOnly(bool preview)
set flag whether the block request is for preview purposes only
#define QgsDebugMsgLevel(str, level)
bool isEmpty() const
test if rectangle is empty.
const QgsRectangle & extent() const
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)
const QgsCoordinateTransform * coordinateTransform() const
double mapUnitsPerPixel() const
Return current map units per pixel.
A class to represent a point.
void setX(double x)
Sets the x value of the point.
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
QgsCoordinateReferenceSystem mSrcCRS
Source coordinate system.
Feedback * mFeedback
feedback class for cancellation and preview generation
double xMaximum() const
Get the x maximum value (right side of rectangle)
QgsRasterProjector implements approximate projection support for it calculates grid of points in sour...
QgsRasterViewPort * mRasterViewPort
Contains information about the context of a rendering operation.
const QgsMapToPixel & mapToPixel() const
virtual void onNewData() override
when notified of new data in data provider it launches a preview draw of the raster ...
Whether to make extra effort to update map image with partially rendered layers (better for interacti...
Class for storing a coordinate reference system (CRS)
double xMinimum() const
Get the x minimum value (left side of rectangle)
Base class for utility classes that encapsulate information necessary for rendering of map layers...
double yMaximum() const
Get the y maximum value (top side of rectangle)
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.
double rasterScaleFactor() const
bool testFlag(Flag flag) const
Check whether a particular flag is enabled.
QgsPoint toMapCoordinatesF(double x, double y) const
Transform device coordinates to map (world) coordinates.
virtual QgsRectangle extent()
Return the extent of the layer.
double scaleFactor() const
Feedback object tailored for raster block reading.
void setDpi(int dpi)
Sets the output device resolution.
double x() const
Get the x value of the point.