Marble
7 #ifndef MARBLE_SCANLINETEXTUREMAPPERCONTEXT_H
8 #define MARBLE_SCANLINETEXTUREMAPPERCONTEXT_H
13 #include "GeoSceneTileDataset.h"
14 #include "MarbleMath.h"
15 #include "MathHelper.h"
21 class StackedTileLoader;
25 class ScanlineTextureMapperContext
28 ScanlineTextureMapperContext( StackedTileLoader *
const tileLoader,
int tileLevel );
30 void pixelValueF(
const qreal lon,
const qreal lat,
31 QRgb*
const scanLine );
32 void pixelValue(
const qreal lon,
const qreal lat,
33 QRgb*
const scanLine );
35 void pixelValueApproxF(
const qreal lon,
const qreal lat,
36 QRgb *scanLine,
const int n );
37 void pixelValueApprox(
const qreal lon,
const qreal lat,
38 QRgb *scanLine,
const int n );
40 static int interpolationStep(
const ViewportParams *viewport,
MapQuality mapQuality );
42 static QImage::Format optimalCanvasImageFormat(
const ViewportParams *viewport );
44 int globalWidth()
const;
45 int globalHeight()
const;
49 void nextTile(
int& posx,
int& posy );
52 void nextTile( qreal& posx, qreal& posy );
56 qreal rad2PixelX(
const qreal lon )
const;
57 qreal rad2PixelY(
const qreal lat )
const;
61 bool isOutOfTileRange(
const int itLon,
const int itLat,
62 const int itStepLon,
const int itStepLat,
65 bool isOutOfTileRangeF(
const qreal itLon,
const qreal itLat,
66 const qreal itStepLon,
const qreal itStepLat,
70 StackedTileLoader *
const m_tileLoader;
71 GeoSceneAbstractTileProjection::Type
const m_textureProjection;
73 QSize const m_tileSize;
75 int const m_tileLevel;
76 int const m_globalWidth;
77 int const m_globalHeight;
78 qreal
const m_normGlobalWidth;
79 qreal
const m_normGlobalHeight;
81 const StackedTile *m_tile;
93 qreal m_toTileCoordinatesLon;
94 qreal m_toTileCoordinatesLat;
103 inline int ScanlineTextureMapperContext::globalWidth()
const
105 return m_globalWidth;
108 inline int ScanlineTextureMapperContext::globalHeight()
const
110 return m_globalHeight;
113 inline qreal ScanlineTextureMapperContext::rad2PixelX(
const qreal lon )
const
115 return lon * m_normGlobalWidth;
118 inline qreal ScanlineTextureMapperContext::rad2PixelY(
const qreal lat )
const
120 switch ( m_textureProjection ) {
121 case GeoSceneAbstractTileProjection::Equirectangular:
122 return -lat * m_normGlobalHeight;
123 case GeoSceneAbstractTileProjection::Mercator:
124 if ( fabs( lat ) < 1.4835 ) {
133 return -
gdInv( lat ) * 0.5 * m_normGlobalHeight;
135 if ( lat >= +1.4835 )
137 return - 3.1309587 * 0.5 * m_normGlobalHeight;
138 if ( lat <= -1.4835 )
140 return 3.1309587 * 0.5 * m_normGlobalHeight;
qreal gdInv(qreal x)
This method is a fast Mac Laurin power series approximation of the.
MapQuality
This enum is used to choose the map quality shown in the view.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 04:09:07 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.