Marble

TileCreator.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2004-2007 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2007-2008 Inge Wallin <ingwa@kde.org>
5//
6
7#ifndef MARBLE_TILECREATOR_H
8#define MARBLE_TILECREATOR_H
9
10#include <QString>
11#include <QThread>
12
13#include "marble_export.h"
14
15class QSize;
16class QImage;
17
18namespace Marble
19{
20
21class TileCreatorPrivate;
22
23/**
24 * Base Class for custom tile source
25 *
26 * Implement this class to have more control over the tile creating process. This
27 * is needed when creating with a high tileLevel where the whole source image can't
28 * be loaded at once.
29 **/
30class MARBLE_EXPORT TileCreatorSource
31{
32public:
33 virtual ~TileCreatorSource() {}
34
35 /**
36 * Must return the full size of the source image
37 */
38 virtual QSize fullImageSize() const = 0;
39
40 /**
41 * Must return one specific tile
42 *
43 * tileLevel can be used to calculate the number of tiles in a row or column
44 */
45 virtual QImage tile( int n, int m, int tileLevel ) = 0;
46};
47
48class MARBLE_EXPORT TileCreator : public QThread
49{
50 Q_OBJECT
51
52 public:
53 /**
54 * Constructor for standard Image source
55 */
56 TileCreator( const QString& sourceDir, const QString& installMap,
57 const QString& dem, const QString& targetDir=QString() );
58
59 /**
60 * Constructor for own, custom source class
61 *
62 * Ownership of source is taken by TileCreator
63 */
64 TileCreator( TileCreatorSource *source, const QString& dem, const QString& targetDir );
65
66 ~TileCreator() override;
67
68 void cancelTileCreation();
69
70 void setTileFormat( const QString &format );
71 void setTileQuality( int quality );
72 void setResume( bool resume );
73 void setVerifyExactResult( bool verify );
74 QString tileFormat() const;
75 int tileQuality() const;
76 bool resume() const;
77 bool verifyExactResult() const;
78
79 protected:
80 void run() override;
81
82 Q_SIGNALS:
83 void progress( int value );
84
85
86 private:
87 Q_DISABLE_COPY( TileCreator )
88 TileCreatorPrivate * const d;
89};
90
91}
92
93#endif
Base Class for custom tile source.
Definition TileCreator.h:31
virtual QSize fullImageSize() const =0
Must return the full size of the source image.
virtual QImage tile(int n, int m, int tileLevel)=0
Must return one specific tile.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.