[Marble-commits] KDE/kdeedu/marble/src/lib
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Wed Jan 19 18:11:42 CET 2011
SVN commit 1215791 by beschow:
forward-port r1211243: have the texture mappers colorize the the textures
This modification allows the texture mappers to paint the tiles directly on a QPaintDevice if no TextureColorizer is present.
In a later commit, the TileScalingTextureMapper will paint pixmaps onto the paint device directly.
* pass the TextureColorizer as a parameter to mapTexture()
M +2 -1 AbstractScanlineTextureMapper.h
M +6 -1 EquirectScanlineTextureMapper.cpp
M +1 -1 EquirectScanlineTextureMapper.h
M +6 -1 MercatorScanlineTextureMapper.cpp
M +1 -1 MercatorScanlineTextureMapper.h
M +6 -1 SphericalScanlineTextureMapper.cpp
M +1 -1 SphericalScanlineTextureMapper.h
M +1 -5 TextureLayer.cpp
M +6 -1 TileScalingTextureMapper.cpp
M +1 -1 TileScalingTextureMapper.h
--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.h #1215790:1215791
@@ -28,6 +28,7 @@
class StackedTile;
class StackedTileLoader;
+class TextureColorizer;
class ViewParams;
class AbstractScanlineTextureMapper : public QObject
@@ -39,7 +40,7 @@
QObject * const parent = 0 );
~AbstractScanlineTextureMapper();
- virtual void mapTexture( ViewParams *viewParams ) = 0;
+ virtual void mapTexture( ViewParams *viewParams, TextureColorizer *texColorizer ) = 0;
bool interlaced() const;
void setInterlaced( const bool enabled );
--- trunk/KDE/kdeedu/marble/src/lib/EquirectScanlineTextureMapper.cpp #1215790:1215791
@@ -22,6 +22,7 @@
#include "MarbleDirs.h"
#include "MarbleDebug.h"
#include "StackedTileLoader.h"
+#include "TextureColorizer.h"
#include "ViewParams.h"
#include "ViewportParams.h"
#include "AbstractProjection.h"
@@ -37,7 +38,7 @@
}
-void EquirectScanlineTextureMapper::mapTexture( ViewParams *viewParams )
+void EquirectScanlineTextureMapper::mapTexture( ViewParams *viewParams, TextureColorizer *texColorizer )
{
QImage *canvasImage = viewParams->canvasImage();
const int imageHeight = canvasImage->height();
@@ -191,7 +192,11 @@
m_oldYPaintedTop = yPaintedTop;
m_tileLoader->cleanupTilehash();
+
+ if ( texColorizer ) {
+ texColorizer->colorize( viewParams );
}
+}
#include "EquirectScanlineTextureMapper.moc"
--- trunk/KDE/kdeedu/marble/src/lib/EquirectScanlineTextureMapper.h #1215790:1215791
@@ -25,7 +25,7 @@
public:
explicit EquirectScanlineTextureMapper( StackedTileLoader *tileLoader, QObject *parent = 0 );
- void mapTexture( ViewParams *viewParams );
+ void mapTexture( ViewParams *viewParams, TextureColorizer *texColorizer );
private:
float m_oldCenterLon;
--- trunk/KDE/kdeedu/marble/src/lib/MercatorScanlineTextureMapper.cpp #1215790:1215791
@@ -23,6 +23,7 @@
#include "MarbleDirs.h"
#include "MarbleDebug.h"
#include "StackedTileLoader.h"
+#include "TextureColorizer.h"
#include "ViewParams.h"
#include "ViewportParams.h"
#include "AbstractProjection.h"
@@ -39,7 +40,7 @@
}
-void MercatorScanlineTextureMapper::mapTexture( ViewParams *viewParams )
+void MercatorScanlineTextureMapper::mapTexture( ViewParams *viewParams, TextureColorizer *texColorizer )
{
QImage *canvasImage = viewParams->canvasImage();
const int imageHeight = canvasImage->height();
@@ -196,7 +197,11 @@
m_oldYPaintedTop = yPaintedTop;
m_tileLoader->cleanupTilehash();
+
+ if ( texColorizer ) {
+ texColorizer->colorize( viewParams );
}
+}
#include "MercatorScanlineTextureMapper.moc"
--- trunk/KDE/kdeedu/marble/src/lib/MercatorScanlineTextureMapper.h #1215790:1215791
@@ -25,7 +25,7 @@
public:
explicit MercatorScanlineTextureMapper( StackedTileLoader *tileLoader, QObject *parent = 0 );
- void mapTexture( ViewParams *viewParams );
+ void mapTexture( ViewParams *viewParams, TextureColorizer *texColorizer );
private:
float m_oldCenterLon;
--- trunk/KDE/kdeedu/marble/src/lib/SphericalScanlineTextureMapper.cpp #1215790:1215791
@@ -20,6 +20,7 @@
#include "MarbleDirs.h"
#include "Quaternion.h"
#include "StackedTileLoader.h"
+#include "TextureColorizer.h"
#include "ViewParams.h"
#include "ViewportParams.h"
#include "MathHelper.h"
@@ -34,7 +35,7 @@
m_interlaced = false;
}
-void SphericalScanlineTextureMapper::mapTexture( ViewParams *viewParams )
+void SphericalScanlineTextureMapper::mapTexture( ViewParams *viewParams, TextureColorizer *texColorizer )
{
QImage *canvasImage = viewParams->canvasImage();
const int imageHeight = canvasImage->height();
@@ -223,7 +224,11 @@
}
m_tileLoader->cleanupTilehash();
+
+ if ( texColorizer ) {
+ texColorizer->colorize( viewParams );
}
+}
bool SphericalScanlineTextureMapper::needsFilter( const QRgb& rgb, int& oldR, int& oldB, int &oldG )
--- trunk/KDE/kdeedu/marble/src/lib/SphericalScanlineTextureMapper.h #1215790:1215791
@@ -37,7 +37,7 @@
public:
explicit SphericalScanlineTextureMapper( StackedTileLoader *tileLoader, QObject *parent = 0 );
- void mapTexture( ViewParams *viewParams );
+ void mapTexture( ViewParams *viewParams, TextureColorizer *texColorizer );
protected:
inline bool needsFilter( const QRgb& rgb, int& oldR, int& oldB, int &oldG );
--- trunk/KDE/kdeedu/marble/src/lib/TextureLayer.cpp #1215790:1215791
@@ -154,12 +154,8 @@
if ( d->m_justModified ) {
// Create the height map image a.k.a viewParams->d->m_canvasImage.
- d->m_texmapper->mapTexture( viewParams );
+ d->m_texmapper->mapTexture( viewParams, d->m_texcolorizer );
- if ( d->m_texcolorizer ) {
- d->m_texcolorizer->colorize( viewParams );
- }
-
d->m_justModified = false;
}
--- trunk/KDE/kdeedu/marble/src/lib/TileScalingTextureMapper.cpp #1215790:1215791
@@ -23,6 +23,7 @@
// Marble
#include "StackedTileLoader.h"
#include "ViewParams.h"
+#include "TextureColorizer.h"
#include "TileLoaderHelper.h"
#include "StackedTile.h"
#include "MathHelper.h"
@@ -37,7 +38,7 @@
}
-void TileScalingTextureMapper::mapTexture( ViewParams *viewParams )
+void TileScalingTextureMapper::mapTexture( ViewParams *viewParams, TextureColorizer *texColorizer )
{
if ( viewParams->radius() <= 0 )
return;
@@ -129,7 +130,11 @@
m_oldYPaintedTop = yPaintedTop;
m_tileLoader->cleanupTilehash();
+
+ if ( texColorizer ) {
+ texColorizer->colorize( viewParams );
}
+}
#include "TileScalingTextureMapper.moc"
--- trunk/KDE/kdeedu/marble/src/lib/TileScalingTextureMapper.h #1215790:1215791
@@ -24,7 +24,7 @@
public:
explicit TileScalingTextureMapper( StackedTileLoader *tileLoader, QObject *parent = 0 );
- void mapTexture( ViewParams *viewParams );
+ void mapTexture( ViewParams *viewParams, TextureColorizer *texColorizer );
private:
int m_oldYPaintedTop;
More information about the Marble-commits
mailing list