/
qgsmultibandcolorrenderer.h
68 lines (54 loc) · 2.92 KB
/
qgsmultibandcolorrenderer.h
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
/***************************************************************************
qgsmultibandcolorrenderer.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 QGSMULTIBANDCOLORRENDERER_H
#define QGSMULTIBANDCOLORRENDERER_H
#include "qgsrasterrenderer.h"
class QgsContrastEnhancement;
class QDomElement;
/**Renderer for multiband images with the color components*/
class QgsMultiBandColorRenderer: public QgsRasterRenderer
{
public:
QgsMultiBandColorRenderer( QgsRasterDataProvider* provider, int redBand, int greenBand, int blueBand,
QgsContrastEnhancement* redEnhancement = 0, QgsContrastEnhancement* greenEnhancement = 0,
QgsContrastEnhancement* blueEnhancement = 0 );
~QgsMultiBandColorRenderer();
static QgsRasterRenderer* create( const QDomElement& elem );
void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );
int redBand() const { return mRedBand; }
void setRedBand( int band ) { mRedBand = band; }
int greenBand() const { return mGreenBand; }
void setGreenBand( int band ) { mGreenBand = band; }
int blueBand() const { return mBlueBand; }
void setBlueBand( int band ) { mBlueBand = band; }
const QgsContrastEnhancement* redContrastEnhancement() const { return mRedContrastEnhancement; }
/**Takes ownership*/
void setRedContrastEnhancement( QgsContrastEnhancement* ce );
const QgsContrastEnhancement* greenContrastEnhancement() const { return mGreenContrastEnhancement; }
/**Takes ownership*/
void setGreenContrastEnhancement( QgsContrastEnhancement* ce );
const QgsContrastEnhancement* blueContrastEnhancement() const { return mBlueContrastEnhancement; }
/**Takes ownership*/
void setBlueContrastEnhancement( QgsContrastEnhancement* ce );
private:
int mRedBand;
int mGreenBand;
int mBlueBand;
QgsContrastEnhancement* mRedContrastEnhancement;
QgsContrastEnhancement* mGreenContrastEnhancement;
QgsContrastEnhancement* mBlueContrastEnhancement;
};
#endif // QGSMULTIBANDCOLORRENDERER_H