Marble

TextureTile.h
1/*
2 SPDX-FileCopyrightText: 2010 Jens-Michael Hoffmann <jmho@c-xx.com>
3 SPDX-FileCopyrightText: 2012 Ander Pijoan <ander.pijoan@deusto.es>
4
5 SPDX-License-Identifier: LGPL-2.1-or-later
6*/
7
8#ifndef MARBLE_TEXTURETILE_H
9#define MARBLE_TEXTURETILE_H
10
11#include <QImage>
12
13#include "Tile.h"
14
15namespace Marble
16{
17class Blending;
18class TileId;
19
20/*!
21 \class TextureTile
22 \brief A class that resembles an image tile (extends Tile).
23
24 This tile provides a bitmap image for a certain (geographic) area and
25 for a given zoom level. Each Tile can be identified via a unique
26 TileId.
27
28 A stack of Tiles that cover the same area and the same
29 zoom level can be stored (and painted) layer by layer in a StackedTile object.
30 For this purpose each Tile specifies a blending type.
31
32 Usually the tiles are organized in so called quad tiles: This means that
33 with increasing zoom level four other tiles cover the same area as a
34 single "parent" tile in the previous zoom level. These four tiles have
35 the same pixel size as the "parent" tile.
36
37 The process of "filling the tile with data is done in stages: The
38 State describes the current progress of loading the data (Empty, Scaled,
39 Expired, StateUptodate).
40
41 The life time cycle of a Tile can also be influenced by its
42 expiration time which will trigger a reload of the tile data.
43*/
44
45class TextureTile : public Tile
46{
47 public:
48 TextureTile(TileId const & tileId, QImage const & image, const Blending * blending );
49 ~TextureTile() override;
50
51/*!
52 \brief Returns the QImage that describes the look of the Tile
53 \return A non-zero pointer to a QImage associated with the tile.
54*/
55 QImage const * image() const;
56
57/*!
58 \brief Returns the kind of blending used for the texture tile.
59 \return A pointer to the blending object used for painting/merging the Tile.
60
61 If no blending is set the pointer returned will be zero.
62*/
63 Blending const * blending() const;
64
65 int byteCount() const;
66
67 private:
68 Q_DISABLE_COPY( TextureTile )
69
70 QImage const m_image;
71 Blending const * const m_blending;
72
73};
74
75inline QImage const * TextureTile::image() const
76{
77 return &m_image;
78}
79
80inline Blending const * TextureTile::blending() const
81{
82 return m_blending;
83}
84
85inline int TextureTile::byteCount() const
86{
87#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
88 return m_image.sizeInBytes();
89#else
90 return m_image.byteCount();
91#endif
92}
93
94}
95
96#endif // MARBLE_TEXTURETILE_H
A class that resembles an image tile (extends Tile).
Definition TextureTile.h:46
QImage const * image() const
Returns the QImage that describes the look of the Tile.
Definition TextureTile.h:75
Blending const * blending() const
Returns the kind of blending used for the texture tile.
Definition TextureTile.h:80
A class that resembles a tile (then it is extended to TextureTile or Vectortile).
Definition Tile.h:43
Binds a QML item to a specific geodetic location in screen coordinates.
qsizetype sizeInBytes() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 7 2024 12:03:14 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.