Skip to content

Commit 07db3f8

Browse files
committed
Fix some cast warnings, pre-calc values for speed
1 parent 78a45b7 commit 07db3f8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/analysis/raster/qgshillshadefilter.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@
2121
QgsHillshadeFilter::QgsHillshadeFilter( const QString &inputFile, const QString &outputFile, const QString &outputFormat, double lightAzimuth,
2222
double lightAngle )
2323
: QgsDerivativeFilter( inputFile, outputFile, outputFormat )
24+
<<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
2425
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
26+
=======
27+
>>>>>>> Fix some cast warnings, pre-calc values for speed
2528
, mLightAzimuth( static_cast<float>( lightAzimuth ) )
2629
, mLightAngle( static_cast<float>( lightAngle ) )
2730
, mCosZenithRad( std::cos( static_cast<float>( lightAngle * M_PI ) / 180.0f ) )
2831
, mSinZenithRad( std::sin( static_cast<float>( lightAngle * M_PI ) / 180.0f ) )
2932
, mAzimuthRad( static_cast<float>( lightAzimuth * M_PI ) / 180.0f )
33+
<<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
3034
=======
3135
, mLightAzimuth( lightAzimuth )
3236
, mLightAngle( lightAngle )
@@ -40,6 +44,8 @@ QgsHillshadeFilter::QgsHillshadeFilter( const QString &inputFile, const QString
4044
, mSinZenithRad( std::sin( mLightAngle * M_PI / 180.0f ) )
4145
, mAzimuthRad( mLightAzimuth * M_PI / 180.0f )
4246
>>>>>>> [opencl] Small optimization in hillshade
47+
=======
48+
>>>>>>> Fix some cast warnings, pre-calc values for speed
4349
{
4450
}
4551

@@ -60,17 +66,24 @@ float QgsHillshadeFilter::processNineCellWindow( float *x11, float *x21, float *
6066
float aspect_rad = 0;
6167
if ( derX == 0 && derY == 0 ) //aspect undefined, take a neutral value. Better solutions?
6268
{
69+
<<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
6370
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
6471
aspect_rad = mAzimuthRad / 2.0f;
6572
=======
6673
aspect_rad = mAzimuthRad / 2.0;
6774
>>>>>>> [opencl] Fix small OpenCL alg issues
75+
=======
76+
aspect_rad = mAzimuthRad / 2.0f;
77+
>>>>>>> Fix some cast warnings, pre-calc values for speed
6878
}
6979
else
7080
{
7181
aspect_rad = M_PI + std::atan2( derX, derY );
7282
}
83+
<<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
7384
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
85+
=======
86+
>>>>>>> Fix some cast warnings, pre-calc values for speed
7487
return std::max( 0.0f, 255.0f * ( ( mCosZenithRad * std::cos( slope_rad ) ) +
7588
( mSinZenithRad * std::sin( slope_rad ) *
7689
std::cos( mAzimuthRad - aspect_rad ) ) ) );
@@ -87,6 +100,7 @@ void QgsHillshadeFilter::setLightAngle( float angle )
87100
mLightAngle = angle;
88101
mCosZenithRad = std::cos( angle * static_cast<float>( M_PI ) / 180.0f );
89102
mSinZenithRad = std::sin( angle * static_cast<float>( M_PI ) / 180.0f );
103+
<<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
90104
}
91105

92106
<<<<<<< a73bbbad21629d81b9b1d4217a096a930473eb5c
@@ -107,6 +121,8 @@ void QgsHillshadeFilter::addExtraRasterParams( std::vector<float> &params )
107121
return std::max( 0.0, 255.0 * ( ( mCosZenithRad * std::cos( slope_rad ) ) +
108122
( mSinZenithRad * std::sin( slope_rad ) *
109123
std::cos( mAzimuthRad - aspect_rad ) ) ) );
124+
=======
125+
>>>>>>> Fix some cast warnings, pre-calc values for speed
110126
}
111127

112128
#ifdef HAVE_OPENCL

0 commit comments

Comments
 (0)