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;
197 virtual void start() = 0;
203 virtual void cancel() = 0;
210 virtual void cancelWithoutBlocking() = 0;
213 virtual void waitForFinished() = 0;
216 virtual bool isActive()
const = 0;
225 virtual bool usedCachedLabels()
const = 0;
252 Error(
const QString &lid,
const QString &msg )
261 typedef QList<QgsMapRendererJob::Error>
Errors;
264 Errors errors()
const;
284 QHash< QgsMapLayer *, int > perLayerRenderingTime()
const SIP_SKIP;
308 void renderingLayersFinished();
321 int mRenderingTime = 0;
329 bool mRecordRenderingTime =
true;
336 bool prepareLabelCache() const SIP_SKIP;
349 LayerRenderJobs prepareJobs( QPainter *painter,
QgsLabelingEngine *labelingEngine2,
bool deferredPainterSet = false ) SIP_SKIP;
356 LabelRenderJob prepareLabelingJob( QPainter *painter,
QgsLabelingEngine *labelingEngine2,
bool canUseLabelCache = true ) SIP_SKIP;
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;
421 QImage *allocateImage( QString layerId );
424 QPainter *allocateImageAndPainter( QString layerId, QImage *&image );
443 virtual QImage renderedImage() = 0;
448 #endif // QGSMAPRENDERERJOB_H Some rendering operations may need multiple mask images.
A rectangle specified with double values.
Base class for all map layer types.
QElapsedTimer mRenderingStart
Abstract base class for map rendering implementations.
QPointer< QgsMapLayer > QgsWeakMapLayerPointer
Weak pointer for QgsMapLayer.
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.
The QgsMapSettings class contains configuration for rendering of the map.
QHash< QgsWeakMapLayerPointer, int > mPerLayerRenderingTime
Render time (in ms) per layer, by layer ID.
const QgsFeatureFilterProvider * featureFilterProvider() const
Returns the feature filter provider used by the QgsRenderContext of each LayerRenderJob.
Abstract interface for use by classes that filter the features of a layer.
The QgsLabelingEngine class provides map labeling functionality.
Contains information about the context of a rendering operation.
QList< QgsMapRendererJob::Error > Errors
Intermediate base class adding functionality that allows client to query the rendered image...
Base class for utility classes that encapsulate information necessary for rendering of map layers...
Class that stores computed placement from labeling engine.
This class is responsible for keeping cache of rendered images resulting from a map rendering job...
Error(const QString &lid, const QString &msg)