Marble
TileScalingTextureMapper.cpp
27TileScalingTextureMapper::TileScalingTextureMapper(StackedTileLoader *tileLoader, QObject *parent)
49 const QImage::Format optimalFormat = ScanlineTextureMapperContext::optimalCanvasImageFormat(viewport);
77void TileScalingTextureMapper::mapTexture(GeoPainter *painter, const ViewportParams *viewport, int tileZoomLevel, TextureColorizer *texColorizer)
83 const bool highQuality = (painter->mapQuality() == HighQuality || painter->mapQuality() == PrintQuality);
102 const int minTileY = qMax(qreal(numTilesY * (yNormalizedCenter - imageHeight / (8.0 * radius))), qreal(0.0));
103 const int maxTileY = qMin(qreal(numTilesY * (yNormalizedCenter + imageHeight / (8.0 * radius))), qreal(numTilesY - 1.0));
115 const qreal xLeft = (4.0 * radius) * ((tileX) / (qreal)numTilesX - xNormalizedCenter) + (imageWidth / 2.0);
116 const qreal xRight = (4.0 * radius) * ((tileX + 1) / (qreal)numTilesX - xNormalizedCenter) + (imageWidth / 2.0);
117 const qreal yTop = (4.0 * radius) * ((tileY) / (qreal)numTilesY - yNormalizedCenter) + (imageHeight / 2.0);
118 const qreal yBottom = (4.0 * radius) * ((tileY + 1) / (qreal)numTilesY - yNormalizedCenter) + (imageHeight / 2.0);
121 const TileId stackedId = TileId(0, tileZoomLevel, ((tileX % numTilesX) + numTilesX) % numTilesX, tileY);
138 const qreal xLeft = (4.0 * radius) * ((tileX) / (qreal)numTilesX - xNormalizedCenter) + (imageWidth / 2.0);
139 const qreal xRight = (4.0 * radius) * ((tileX + 1) / (qreal)numTilesX - xNormalizedCenter) + (imageWidth / 2.0);
140 const qreal yTop = (4.0 * radius) * ((tileY) / (qreal)numTilesY - yNormalizedCenter) + (imageHeight / 2.0);
141 const qreal yBottom = (4.0 * radius) * ((tileY + 1) / (qreal)numTilesY - yNormalizedCenter) + (imageHeight / 2.0);
144 const TileId stackedId = TileId(0, tileZoomLevel, ((tileX % numTilesX) + numTilesX) % numTilesX, tileY);
146 m_tileLoader->loadTile(stackedId); // load tile here for every frame, otherwise cleanupTilehash() clears all visible tiles
155 im = new QPixmap(QPixmap::fromImage(tile->resultImage()->scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)));
This file contains the headers for ViewportParams.
A painter that allows to draw geometric primitives on the map.
Definition GeoPainter.h:86
void drawImage(const GeoDataCoordinates ¢erPosition, const QImage &image)
Draws an image at the given position. The image is placed with its center located at the given center...
Definition GeoPainter.cpp:449
void drawPixmap(const GeoDataCoordinates ¢erPosition, const QPixmap &pixmap)
Draws a pixmap at the given position. The pixmap is placed with its center located at the given cente...
Definition GeoPainter.cpp:473
const StackedTile * loadTile(TileId const &stackedTileId)
Loads a tile and returns it.
Definition StackedTileLoader.cpp:102
A single tile that consists of a stack of Tile layers.
Definition StackedTile.h:51
QImage const * resultImage() const
Returns the QImage that describes the merged stack of Tiles.
Definition StackedTile.cpp:313
A public class that controls what is visible in the viewport of a Marble map.
Definition ViewportParams.h:41
Binds a QML item to a specific geodetic location in screen coordinates.
Definition AbstractDataPlugin.cpp:23
void clear()
bool insert(const Key &key, T *object, qsizetype cost)
bool remove(const Key &key)
Format
void fill(Qt::GlobalColor color)
Format format() const const
QImage scaled(const QSize &size, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const const
QSize size() const const
SmoothPixmapTransform
void restore()
void save()
void setRenderHint(RenderHint hint, bool on)
QPixmap fromImage(QImage &&image, Qt::ImageConversionFlags flags)
qreal bottom() const const
qreal left() const const
qreal right() const const
qreal top() const const
QPointF topLeft() const const
int height() const const
int width() const const
IgnoreAspectRatio
SmoothTransformation
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.