21
21
QgsHillshadeFilter::QgsHillshadeFilter ( const QString &inputFile, const QString &outputFile, const QString &outputFormat, double lightAzimuth,
22
22
double lightAngle )
23
23
: QgsDerivativeFilter( inputFile, outputFile, outputFormat )
24
+ <<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
24
25
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
26
+ =======
27
+ >>>>>>> Fix some cast warnings, pre-calc values for speed
25
28
, mLightAzimuth( static_cast <float >( lightAzimuth ) )
26
29
, mLightAngle( static_cast <float >( lightAngle ) )
27
30
, mCosZenithRad( std::cos( static_cast <float >( lightAngle * M_PI ) / 180.0f ) )
28
31
, mSinZenithRad( std::sin( static_cast <float >( lightAngle * M_PI ) / 180.0f ) )
29
32
, mAzimuthRad( static_cast <float >( lightAzimuth * M_PI ) / 180.0f )
33
+ <<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
30
34
=======
31
35
, mLightAzimuth( lightAzimuth )
32
36
, mLightAngle( lightAngle )
@@ -40,6 +44,8 @@ QgsHillshadeFilter::QgsHillshadeFilter( const QString &inputFile, const QString
40
44
, mSinZenithRad( std::sin( mLightAngle * M_PI / 180 .0f ) )
41
45
, mAzimuthRad( mLightAzimuth * M_PI / 180 .0f )
42
46
>>>>>>> [opencl] Small optimization in hillshade
47
+ =======
48
+ >>>>>>> Fix some cast warnings, pre-calc values for speed
43
49
{
44
50
}
45
51
@@ -60,17 +66,24 @@ float QgsHillshadeFilter::processNineCellWindow( float *x11, float *x21, float *
60
66
float aspect_rad = 0 ;
61
67
if ( derX == 0 && derY == 0 ) // aspect undefined, take a neutral value. Better solutions?
62
68
{
69
+ <<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
63
70
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
64
71
aspect_rad = mAzimuthRad / 2 .0f ;
65
72
=======
66
73
aspect_rad = mAzimuthRad / 2.0 ;
67
74
>>>>>>> [opencl] Fix small OpenCL alg issues
75
+ =======
76
+ aspect_rad = mAzimuthRad / 2 .0f ;
77
+ >>>>>>> Fix some cast warnings, pre-calc values for speed
68
78
}
69
79
else
70
80
{
71
81
aspect_rad = M_PI + std::atan2 ( derX, derY );
72
82
}
83
+ <<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
73
84
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
85
+ =======
86
+ >>>>>>> Fix some cast warnings, pre-calc values for speed
74
87
return std::max ( 0 .0f , 255 .0f * ( ( mCosZenithRad * std::cos ( slope_rad ) ) +
75
88
( mSinZenithRad * std::sin ( slope_rad ) *
76
89
std::cos ( mAzimuthRad - aspect_rad ) ) ) );
@@ -87,6 +100,7 @@ void QgsHillshadeFilter::setLightAngle( float angle )
87
100
mLightAngle = angle;
88
101
mCosZenithRad = std::cos ( angle * static_cast <float >( M_PI ) / 180 .0f );
89
102
mSinZenithRad = std::sin ( angle * static_cast <float >( M_PI ) / 180 .0f );
103
+ <<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
90
104
}
91
105
92
106
<<<<<<< a73bbbad21629d81b9b1d4217a096a930473eb5c
@@ -107,6 +121,8 @@ void QgsHillshadeFilter::addExtraRasterParams( std::vector<float> ¶ms )
107
121
return std::max( 0.0 , 255.0 * ( ( mCosZenithRad * std::cos ( slope_rad ) ) +
108
122
( mSinZenithRad * std::sin ( slope_rad ) *
109
123
std::cos( mAzimuthRad - aspect_rad ) ) ) );
124
+ =======
125
+ >>>>>>> Fix some cast warnings, pre-calc values for speed
110
126
}
111
127
112
128
#ifdef HAVE_OPENCL
0 commit comments