QGIS API Documentation  3.2.0-Bonn (bc43194)
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"
24 #include "qgsrasterinterface.h"
25 #include "qgsrasterpipe.h"
26 
37 class CORE_EXPORT QgsRasterFileWriterTask : public QgsTask
38 {
39  Q_OBJECT
40 
41  public:
42 
50  int columns, int rows,
51  const QgsRectangle &outputExtent,
52  const QgsCoordinateReferenceSystem &crs );
53 
54  void cancel() override;
55 
56  signals:
57 
62  void writeComplete( const QString &outputUrl );
63 
68  void errorOccurred( int error );
69 
70  protected:
71 
72  bool run() override;
73  void finished( bool result ) override;
74 
75  private:
76 
77  QgsRasterFileWriter mWriter;
78  int mRows = 0;
79  int mColumns = 0;
80  QgsRectangle mExtent;
82  std::unique_ptr< QgsRasterPipe > mPipe;
83 
84  QString mDestFileName;
85 
86  std::unique_ptr< QgsRasterBlockFeedback > mFeedback;
87 
89 
90 };
91 
92 #endif //QGSRASTERFILEWRITERTASK_H
QgsTask task which performs a QgsRasterFileWriter layer saving operation as a background task...
A rectangle specified with double values.
Definition: qgsrectangle.h:40
Base class for processing modules.
Definition: qgsrasterpipe.h:46
Abstract base class for long running background tasks.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
virtual void cancel()
Notifies the task that it should terminate.
This class represents a coordinate reference system (CRS).
virtual void finished(bool result)
If the task is managed by a QgsTaskManager, this will be called after the task has finished (whether ...
virtual bool run()=0
Performs the task&#39;s operation.
The raster file writer which allows you to save a raster to a new file.