QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsrasterfilewritertask.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasterfilewritertask.h
3  -------------------------
4  begin : April 2017
5  copyright : (C) 2017 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSRASTERFILEWRITERTASK_H
19 #define QGSRASTERFILEWRITERTASK_H
20 
21 #include "qgis_core.h"
22 #include "qgstaskmanager.h"
23 #include "qgsrasterfilewriter.h"
25 #include "qgsrasterinterface.h"
26 
27 class QgsRasterPipe;
28 
39 class CORE_EXPORT QgsRasterFileWriterTask : public QgsTask
40 {
41  Q_OBJECT
42 
43  public:
44 
52  Q_DECL_DEPRECATED QgsRasterFileWriterTask( const QgsRasterFileWriter &writer, QgsRasterPipe *pipe SIP_TRANSFER,
53  int columns, int rows,
54  const QgsRectangle &outputExtent,
56 
57 
66  int columns, int rows,
67  const QgsRectangle &outputExtent,
69  const QgsCoordinateTransformContext &transformContext
70  );
71 
72  ~QgsRasterFileWriterTask() override;
73 
74  void cancel() override;
75 
76  signals:
77 
82  void writeComplete( const QString &outputUrl );
83 
89  void errorOccurred( int error );
90 
97  void errorOccurred( int error, const QString &errorMessage );
98 
99  protected:
100 
101  bool run() override;
102  void finished( bool result ) override;
103 
104  private:
105 
106  QgsRasterFileWriter mWriter;
107  int mRows = 0;
108  int mColumns = 0;
109  QgsRectangle mExtent;
111  std::unique_ptr< QgsRasterPipe > mPipe;
112 
113  QString mDestFileName;
114 
115  std::unique_ptr< QgsRasterBlockFeedback > mFeedback;
116 
118 
119  QgsCoordinateTransformContext mTransformContext;
120 };
121 
122 #endif //QGSRASTERFILEWRITERTASK_H
QgsRasterFileWriter::NoError
@ NoError
Definition: qgsrasterfilewriter.h:49
QgsCoordinateTransformContext
Contains information about the context in which a coordinate transform is executed.
Definition: qgscoordinatetransformcontext.h:57
qgstaskmanager.h
qgscoordinatetransformcontext.h
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:105
QgsRasterPipe
Contains a pipeline of raster interfaces for sequential raster processing.
Definition: qgsrasterpipe.h:49
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:41
QgsRasterFileWriter::WriterError
WriterError
Definition: qgsrasterfilewriter.h:47
QgsTask::finished
virtual void finished(bool result)
If the task is managed by a QgsTaskManager, this will be called after the task has finished (whether ...
Definition: qgstaskmanager.h:284
qgsrasterfilewriter.h
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
QgsTask::cancel
virtual void cancel()
Notifies the task that it should terminate.
Definition: qgstaskmanager.cpp:91
qgsrasterinterface.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:211
QgsRasterFileWriter
The raster file writer which allows you to save a raster to a new file.
Definition: qgsrasterfilewriter.h:39
QgsTask::run
virtual bool run()=0
Performs the task's operation.
QgsRasterFileWriterTask
QgsTask task which performs a QgsRasterFileWriter layer saving operation as a background task....
Definition: qgsrasterfilewritertask.h:39
QgsTask
Abstract base class for long running background tasks. Tasks can be controlled directly,...
Definition: qgstaskmanager.h:54