Marble::StackedTile

Marble::StackedTile Class Reference

#include <StackedTile.h>

Inheritance diagram for Marble::StackedTile:

Public Member Functions

 StackedTile (TileId const &id, QImage const &resultImage, QVector< QSharedPointer< TextureTile > > const &tiles)
 
int byteCount () const
 
int depth () const
 
uint pixel (int x, int y) const
 
uint pixelF (qreal x, qreal y) const
 
uint pixelF (qreal x, qreal y, const QRgb &pixel) const
 
QImage const * resultImage () const
 
void setUsed (bool used)
 
QVector< QSharedPointer< TextureTile > > tiles () const
 
bool used () const
 
- Public Member Functions inherited from Marble::Tile
 Tile (TileId const &tileId)
 
TileId const & id () const
 

Detailed Description

A single tile that consists of a stack of Tile layers.

The StackedTile is a tile container that covers a certain area and is used for a particular zoom level. It consists of a stack of several individual thematic Tiles that cover the very same area and are used for the very same zoom level: This stack of Tiles is built up from the ground: The first Tile at the bottom usually represents the ground surface. Optionally there might be a range of other Tiles stacked on top which cover e.g. relief, streets and clouds.

For rendering the whole stack of tiles gets merged and blended into a single QImage. This merging/blending operation is usually only performed once the stack of tiles changes visually. As a result access to the visual composition of all TextureTile layers is very fast since it is reduced to a single QImage that also consumes very little memory.

The whole mechanism is comparable to layers in applications like Gimp or Photoshop (TM) which can be blended on top of each other via so called filters and can be merged into a single layer if required.

Restrictions: The Tiles that are part of the stack need to be of the same size and need to cover the same area at the same zoom level using the very same projection.

Definition at line 55 of file StackedTile.h.

Member Function Documentation

uint StackedTile::pixel ( int  x,
int  y 
) const

Returns the color value of the result tile at the given integer position.

Returns
The uint that describes the color value of the given pixel

Note: for gray scale images the color value of a single pixel is described via a uchar (1 byte) while for RGB(A) images uint (4 bytes) are used.

Definition at line 83 of file StackedTile.cpp.

uint StackedTile::pixelF ( qreal  x,
qreal  y 
) const

Returns the color value of the result tile at a given floating point position.

Returns
The uint that describes the color value of the given pixel

Subpixel calculation is done via bilinear interpolation.

Note: for gray scale images the color value of a single pixel is described via a uchar (1 byte) while for RGB(A) images uint (4 bytes) are used.

Definition at line 237 of file StackedTile.cpp.

QImage const * StackedTile::resultImage ( ) const

Returns the QImage that describes the merged stack of Tiles.

Returns
A non-zero pointer to the resulting QImage

Definition at line 262 of file StackedTile.cpp.

QVector< QSharedPointer< TextureTile > > StackedTile::tiles ( ) const

Returns the stack of Tiles.

Returns
A container of Tile objects.

Definition at line 257 of file StackedTile.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jul 6 2020 23:19:03 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.