36 if ( !p || !mIterator || !viewPort || !theQgsMapToPixel )
58 &block, topLeftCol, topLeftRow ) )
71 if ( printer && printer->
outputFormat() == QPrinter::PdfFormat )
76 QRgb transparentBlack = qRgba( 0, 0, 0, 0 );
77 QRgb transparentWhite = qRgba( 255, 255, 255, 0 );
78 for (
int x = 0; x < img.
width(); x++ )
80 for (
int y = 0; y < img.
height(); y++ )
82 if ( img.
pixel( x, y ) == transparentBlack )
84 img.
setPixel( x, y, transparentWhite );
98 drawImage( p, viewPort, img, topLeftCol, topLeftRow, theQgsMapToPixel );
120 if ( !p || !viewPort )
135 if ( theQgsMapToPixel )
137 int w = theQgsMapToPixel->
mapWidth();
163 double nw = br.
width() * 0.5;
164 double nh = br.
height() * 0.5;
168 nw = br.
width() * 0.5;
void drawImage(QPainter *p, QgsRasterViewPort *viewPort, const QImage &img, int topLeftCol, int topLeftRow, const QgsMapToPixel *mapToPixel=nullptr) const
Draws raster part.
bool renderPartialOutput() const
Whether our painter is drawing to a temporary image used just by this layer.
Iterator for sequentially processing raster cells.
void setCompositionMode(CompositionMode mode)
void setRenderHint(RenderHint hint, bool on)
void setPixel(int x, int y, uint index_or_rgb)
int mWidth
Width, number of columns to be rendered.
bool renderingStopped() const
void drawLine(const QLineF &line)
bool isCancelled() const
Tells whether the operation has been cancelled already.
double y() const
Get the y value of the point.
double mapRotation() const
Return current map rotation in degrees.
double ANALYSIS_EXPORT max(double x, double y)
Returns the maximum of two doubles or the first argument if both are equal.
Perform transforms between map coordinates and device coordinates.
QRgb pixel(int x, int y) const
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.
#define QgsDebugMsgLevel(str, level)
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode)
void draw(QPainter *p, QgsRasterViewPort *viewPort, const QgsMapToPixel *theQgsMapToPixel, const QgsRenderContext *ctx=nullptr, QgsRasterBlockFeedback *feedback=nullptr)
Draws raster data.
QPaintDevice * device() const
QgsRasterDrawer(QgsRasterIterator *iterator)
void setBrush(const QBrush &brush)
bool readNextRasterPart(int bandNumber, int &nCols, int &nRows, QgsRasterBlock **block, int &topLeftCol, int &topLeftRow)
Fetches next part of raster data, caller takes ownership of the block and caller should delete the bl...
QImage image() const
Get image if type is color.
Contains information about the context of a rendering operation.
void drawImage(const QRectF &target, const QImage &image, const QRectF &source, QFlags< Qt::ImageConversionFlag > flags)
int mHeight
Distance in map units from bottom edge to top edge for the part of the raster that is to be rendered...
void translate(const QPointF &offset)
QgsPoint mTopLeftPoint
Coordinate (in output device coordinate system) of top left corner of the part of the raster that is ...
This class provides details of the viewable area that a raster will be rendered into.
Feedback object tailored for raster block reading.
void startRasterRead(int bandNumber, int nCols, int nRows, const QgsRectangle &extent, QgsRasterBlockFeedback *feedback=nullptr)
Start reading of raster band.
double x() const
Get the x value of the point.
QgsRectangle mDrawnExtent
Intersection of current map extent and layer extent.