File indexing completed on 2024-04-21 03:49:59
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2004-2007 Torsten Rahn <tackat@kde.org> 0004 // SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org> 0005 // 0006 0007 // 0008 // The TextureColorizer maps the Elevationvalues to Legend Colors. 0009 // 0010 0011 #ifndef MARBLE_TEXTURECOLORIZER_H 0012 #define MARBLE_TEXTURECOLORIZER_H 0013 0014 #include "MarbleGlobal.h" 0015 #include "GeoDataDocument.h" 0016 0017 #include <QString> 0018 #include <QImage> 0019 #include <QColor> 0020 0021 namespace Marble 0022 { 0023 0024 class GeoPainter; 0025 class ViewportParams; 0026 0027 class TextureColorizer 0028 { 0029 public: 0030 TextureColorizer( const QString &seafile, 0031 const QString &landfile ); 0032 0033 virtual ~TextureColorizer(){} 0034 0035 void addSeaDocument( const GeoDataDocument *seaDocument ); 0036 0037 void addLandDocument( const GeoDataDocument *landDocument ); 0038 0039 void setShowRelief( bool show ); 0040 0041 static void drawIndividualDocument( GeoPainter *painter, const GeoDataDocument *document ); 0042 0043 void drawTextureMap( GeoPainter *painter ); 0044 0045 void colorize( QImage *origimg, const ViewportParams *viewport, MapQuality mapQuality ); 0046 0047 void setPixel( const QRgb *coastData, QRgb *writeData, int bump, uchar grey ); 0048 0049 private: 0050 QString m_seafile; 0051 QString m_landfile; 0052 QList<const GeoDataDocument*> m_seaDocuments; 0053 QList<const GeoDataDocument*> m_landDocuments; 0054 QImage m_coastImage; 0055 uint texturepalette[16][512]; 0056 bool m_showRelief; 0057 QRgb m_landColor; 0058 QRgb m_seaColor; 0059 }; 0060 0061 } 0062 0063 #endif