QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
16 #ifndef QGSMAPRENDERERJOB_H
17 #define QGSMAPRENDERERJOB_H
19 #include "qgis_core.h"
21 #include <QFutureWatcher>
57 bool imageInitialized =
false;
59 QPainter::CompositionMode blendMode;
92 QImage *maskImage =
nullptr;
99 LayerRenderJob *firstPassJob =
nullptr;
107 QList<QPair<LayerRenderJob *, int>> maskJobs;
110 typedef QList<LayerRenderJob> LayerRenderJobs;
116 struct LabelRenderJob
124 QImage *img =
nullptr;
136 QVector<QImage *> maskImages;
147 bool canUseCache =
false;
149 bool complete =
false;
151 int renderingTime = -1;
153 QList< QPointer< QgsMapLayer > > participatingLayers;
252 Error(
const QString &lid,
const QString &msg )
261 typedef QList<QgsMapRendererJob::Error>
Errors;
308 void renderingLayersFinished();
316 QElapsedTimer mRenderingStart;
321 int mRenderingTime = 0;
329 bool mRecordRenderingTime = true;
366 LayerRenderJobs prepareSecondPassJobs( LayerRenderJobs &firstPassJobs, LabelRenderJob &labelJob )
SIP_SKIP;
369 static QImage composeImage( const
QgsMapSettings &settings, const LayerRenderJobs &jobs, const LabelRenderJob &labelJob )
SIP_SKIP;
377 static
void composeSecondPass( LayerRenderJobs &secondPassJobs, LabelRenderJob &labelJob )
SIP_SKIP;
380 void logRenderingTime( const LayerRenderJobs &jobs, const LayerRenderJobs &secondPassJobs, const LabelRenderJob &labelJob )
SIP_SKIP;
383 void cleanupJobs( LayerRenderJobs &jobs )
SIP_SKIP;
386 void cleanupSecondPassJobs( LayerRenderJobs &jobs )
SIP_SKIP;
394 void cleanupLabelJob( LabelRenderJob &job )
SIP_SKIP;
425 QImage *allocateImage( QString layerId );
428 QPainter *allocateImageAndPainter( QString layerId, QImage *&image );
452 #endif // QGSMAPRENDERERJOB_H
Error(const QString &lid, const QString &msg)
virtual bool usedCachedLabels() const =0
Returns true if the render job was able to use a cached labeling solution.
virtual bool isActive() const =0
Tell whether the rendering job is currently running in background.
QgsMapRendererJob(const QgsMapSettings &settings)
virtual QImage renderedImage()=0
Gets a preview/resulting image.
Class that stores computed placement from labeling engine.
Contains information about the context of a rendering operation.
A rectangle specified with double values.
This class is responsible for keeping cache of rendered images resulting from a map rendering job.
Base class for utility classes that encapsulate information necessary for rendering of map layers.
int renderingTime() const
Returns the total time it took to finish the job (in milliseconds).
void setFeatureFilterProvider(const QgsFeatureFilterProvider *f)
Set the feature filter provider used by the QgsRenderContext of each LayerRenderJob.
Errors errors() const
List of errors that happened during the rendering job - available when the rendering has been finishe...
QHash< QgsMapLayer *, int > perLayerRenderingTime() const
Returns the render time (in ms) per layer.
virtual void waitForFinished()=0
Block until the job has finished.
void setCache(QgsMapRendererCache *cache)
Assign a cache to be used for reading and storing rendered images of individual layers.
const QgsFeatureFilterProvider * featureFilterProvider() const
Returns the feature filter provider used by the QgsRenderContext of each LayerRenderJob.
QPointer< QgsMapLayer > QgsWeakMapLayerPointer
Weak pointer for QgsMapLayer.
virtual void start()=0
Start the rendering job and immediately return.
The QgsLabelingEngine class provides map labeling functionality.
Intermediate base class adding functionality that allows client to query the rendered image.
Some rendering operations may need multiple mask images.
Base class for all map layer types.
virtual void cancelWithoutBlocking()=0
Triggers cancellation of the rendering job without blocking.
Abstract base class for map rendering implementations.
Abstract interface for use by classes that filter the features of a layer.
virtual QgsLabelingResults * takeLabelingResults()=0
Gets pointer to internal labeling engine (in order to get access to the results).
QList< QgsMapRendererJob::Error > Errors
virtual void cancel()=0
Stop the rendering job - does not return until the job has terminated.
QgsMapRendererQImageJob(const QgsMapSettings &settings)
The QgsMapSettings class contains configuration for rendering of the map.