/usr/include/qgis/qgsrasterrenderer.h is in libqgis-dev 2.8.6+dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | /***************************************************************************
qgsrasterrenderer.h
-------------------
begin : December 2011
copyright : (C) 2011 by Marco Hugentobler
email : marco at sourcepole dot ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSRASTERRENDERER_H
#define QGSRASTERRENDERER_H
#include <QPair>
#include "qgsrasterdataprovider.h"
#include "qgsrasterinterface.h"
class QDomElement;
class QPainter;
class QgsRasterTransparency;
/** \ingroup core
* Raster renderer pipe that applies colors to a raster.
*/
class CORE_EXPORT QgsRasterRenderer : public QgsRasterInterface
{
public:
// Origin of min / max values
enum MinMaxOrigin
{
MinMaxUnknown = 0,
MinMaxUser = 1, // entered by user
// method
MinMaxMinMax = 1 << 1,
MinMaxCumulativeCut = 1 << 2,
MinMaxStdDev = 1 << 3,
// Extent
MinMaxFullExtent = 1 << 4,
MinMaxSubExtent = 1 << 5,
// Precision
MinMaxEstimated = 1 << 6,
MinMaxExact = 1 << 7
};
static const QRgb NODATA_COLOR;
QgsRasterRenderer( QgsRasterInterface* input = 0, const QString& type = "" );
virtual ~QgsRasterRenderer();
QgsRasterInterface * clone() const override = 0;
virtual int bandCount() const override;
virtual QGis::DataType dataType( int bandNo ) const override;
virtual QString type() const { return mType; }
virtual bool setInput( QgsRasterInterface* input ) override;
virtual QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height ) override = 0;
bool usesTransparency() const;
void setOpacity( double opacity ) { mOpacity = opacity; }
double opacity() const { return mOpacity; }
void setRasterTransparency( QgsRasterTransparency* t );
const QgsRasterTransparency* rasterTransparency() const { return mRasterTransparency; }
void setAlphaBand( int band ) { mAlphaBand = band; }
int alphaBand() const { return mAlphaBand; }
/**Get symbology items if provided by renderer*/
virtual void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const { Q_UNUSED( symbolItems ); }
/**Sets base class members from xml. Usually called from create() methods of subclasses*/
void readXML( const QDomElement& rendererElem ) override;
/**Returns a list of band numbers used by the renderer*/
virtual QList<int> usesBands() const { return QList<int>(); }
static QString minMaxOriginName( int theOrigin );
static QString minMaxOriginLabel( int theOrigin );
static int minMaxOriginFromName( QString theName );
protected:
/**Write upper class info into rasterrenderer element (called by writeXML method of subclasses)*/
void _writeXML( QDomDocument& doc, QDomElement& rasterRendererElem ) const;
QString mType;
/**Global alpha value (0-1)*/
double mOpacity;
/**Raster transparency per color or value. Overwrites global alpha value*/
QgsRasterTransparency* mRasterTransparency;
/**Read alpha value from band. Is combined with value from raster transparency / global alpha value.
Default: -1 (not set)*/
int mAlphaBand;
};
#endif // QGSRASTERRENDERER_H
|