/usr/include/qgis/qgshillshaderenderer.h is in libqgis-dev 2.18.17+dfsg-1.
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | /***************************************************************************
qgshillshaderenderer.cpp
---------------------------------
begin : May 2016
copyright : (C) 2016 by Nathan Woodrow
email : woodrow dot nathan at gmail dot com
***************************************************************************/
/***************************************************************************
* *
* 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 QGSHILLSHADERENDERER_H
#define QGSHILLSHADERENDERER_H
#include "qgsrasterrenderer.h"
class QgsRasterBlock;
class QgsRectangle;
class QgsRasterInterface;
/**
* \ingroup core
* @brief A renderer for generating live hillshade models.
* @note added in QGIS 2.16
*/
class CORE_EXPORT QgsHillshadeRenderer : public QgsRasterRenderer
{
public:
/**
* @brief A renderer for generating live hillshade models.
* @param input The input raster interface
* @param band The band in the raster to use
* @param lightAzimuth The azimuth of the light source
* @param lightAltitude The altitude of the light source
*/
QgsHillshadeRenderer( QgsRasterInterface* input, int band, double lightAzimuth, double lightAltitude );
QgsHillshadeRenderer * clone() const override;
/**
* @brief Factory method to create a new renderer
* @param elem A DOM element to create the renderer from.
* @param input The raster input interface.
* @return A new QgsHillshadeRenderer.
*/
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input );
void writeXML( QDomDocument& doc, QDomElement& parentElem ) const override;
QgsRasterBlock *block( int bandNo, QgsRectangle const & extent, int width, int height ) override;
QgsRasterBlock *block2( int bandNo, QgsRectangle const & extent, int width, int height, QgsRasterBlockFeedback* feedback = nullptr ) override;
QList<int> usesBands() const override;
/** Returns the band used by the renderer
*/
int band() const { return mBand; }
/** Sets the band used by the renderer.
* @see band
*/
void setBand( int bandNo );
/**
* Returns the direction of the light over the raster between 0-360.
* @see setAzimuth()
*/
double azimuth() const { return mLightAzimuth; }
/** Returns the angle of the light source over the raster.
* @see setAltitude()
*/
double altitude() const { return mLightAngle; }
/** Returns the Z scaling factor.
* @see setZFactor()
*/
double zFactor() const { return mZFactor; }
/** Returns true if the renderer is using multi-directional hillshading.
* @see setMultiDirectional()
*/
bool multiDirectional() const { return mMultiDirectional; }
/**
* @brief Set the azimuth of the light source.
* @param azimuth The azimuth of the light source, between 0 and 360.0
* @see azimuth()
*/
void setAzimuth( double azimuth ) { mLightAzimuth = azimuth; }
/**
* @brief Set the altitude of the light source
* @param altitude the altitude
* @see altitude()
*/
void setAltitude( double altitude ) { mLightAngle = altitude; }
/**
* @brief Set the Z scaling factor of the result image.
* @param zfactor The z factor
* @see zFactor()
*/
void setZFactor( double zfactor ) { mZFactor = zfactor; }
/** Sets whether to render using a multi-directional hillshade algorithm.
* @param isMultiDirectional set to true to use multi directional rendering
* @see multiDirectional()
*/
void setMultiDirectional( bool isMultiDirectional ) { mMultiDirectional = isMultiDirectional; }
private:
int mBand;
double mZFactor;
double mLightAngle;
double mLightAzimuth;
bool mMultiDirectional;
/** Calculates the first order derivative in x-direction according to Horn (1981)*/
double calcFirstDerX( double x11, double x21, double x31, double x12, double x22, double x32, double x13, double x23, double x33 , double cellsize );
/** Calculates the first order derivative in y-direction according to Horn (1981)*/
double calcFirstDerY( double x11, double x21, double x31, double x12, double x22, double x32, double x13, double x23, double x33 , double cellsize );
};
#endif // QGSHILLSHADERENDERER_H
|