Marble::StackedTile

Search for usage in LXR

Marble::StackedTile Class Reference

#include <StackedTile.h>

Inheritance diagram for Marble::StackedTile:

Public Member Functions

 StackedTile (TileId const &id, QImage const &resultImage, QList< 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)
 
QList< 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 50 of file StackedTile.h.

Constructor & Destructor Documentation

◆ StackedTile()

StackedTile::StackedTile ( TileId const & id,
QImage const & resultImage,
QList< QSharedPointer< TextureTile > > const & tiles )
explicit

Definition at line 68 of file StackedTile.cpp.

◆ ~StackedTile()

StackedTile::~StackedTile ( )
override

Definition at line 86 of file StackedTile.cpp.

Member Function Documentation

◆ byteCount()

int StackedTile::byteCount ( ) const

Definition at line 303 of file StackedTile.cpp.

◆ depth()

int StackedTile::depth ( ) const

Definition at line 298 of file StackedTile.cpp.

◆ pixel()

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 92 of file StackedTile.cpp.

◆ pixelF() [1/2]

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 288 of file StackedTile.cpp.

◆ pixelF() [2/2]

uint StackedTile::pixelF ( qreal x,
qreal y,
const QRgb & pixel ) const

Definition at line 113 of file StackedTile.cpp.

◆ resultImage()

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 313 of file StackedTile.cpp.

◆ setUsed()

void StackedTile::setUsed ( bool used)

Definition at line 278 of file StackedTile.cpp.

◆ tiles()

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

Returns the stack of Tiles.

Returns
A container of Tile objects.

Definition at line 308 of file StackedTile.cpp.

◆ used()

bool StackedTile::used ( ) const

Definition at line 283 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-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.