Skip to content

Commit 44adfe5

Browse files
committed
[opencl] Final rebase before merge
1 parent e79f6d1 commit 44adfe5

File tree

11 files changed

+12
-385
lines changed

11 files changed

+12
-385
lines changed

CMakeLists.txt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,16 @@ MESSAGE(STATUS "QGIS version: ${COMPLETE_VERSION} ${RELEASE_NAME} (${QGIS_VERSIO
3333
OPTION(USE_OPENCL "Use OpenCL" ON)
3434
IF (USE_OPENCL)
3535
FIND_PACKAGE(OpenCL)
36-
<<<<<<< c42a748afc413e235254d2a94dc8af75d2109822
37-
if(${OpenCL_FOUND})
38-
<<<<<<< a1a09d75e627b0f085c5a1177db5d58374ca6f44
39-
=======
4036
IF(${OpenCL_FOUND})
41-
>>>>>>> [opencl] Uppercase CMake
4237
SET(HAVE_OPENCL TRUE)
4338
ELSE(${OpenCL_FOUND})
4439
MESSAGE(STATUS "Couldn't find OpenCL: support DISABLED")
45-
<<<<<<< c42a748afc413e235254d2a94dc8af75d2109822
46-
=======
4740
SET (USE_OPENCL TRUE CACHE BOOL "Use OpenCL")
4841
IF(USE_OPENCL)
4942
SET(HAVE_OPENCL TRUE)
5043
ENDIF(USE_OPENCL)
51-
<<<<<<< a420474ec4f22e581be5ba5c5ca47eae5d7e0447
52-
>>>>>>> OpenCL POC 1
53-
=======
54-
else(${OpenCL_FOUND})
55-
MESSAGE(FATAL_ERROR "Couldn't find OpenCL")
56-
>>>>>>> [opencl] Error message when OpenCL could not be found
57-
endif(${OpenCL_FOUND})
58-
endif(USE_OPENCL)
59-
=======
6044
ENDIF(${OpenCL_FOUND})
6145
ENDIF(USE_OPENCL)
62-
>>>>>>> [opencl] Uppercase CMake
6346

6447
# Configure CCache if available
6548
IF(NOT MSVC)

python/analysis/auto_generated/raster/qgsaspectfilter.sip.in

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ nodata value if not present or outside of the border. Must be implemented by sub
3030
%End
3131

3232

33-
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
34-
<<<<<<< d6e747ca57807318c0b3f6be8266f0b43c0f7747
35-
=======
36-
37-
38-
>>>>>>> More updates for opencl
39-
=======
40-
>>>>>>> [opencl] Fix small OpenCL alg issues
4133
};
4234

4335
/************************************************************************

python/analysis/auto_generated/raster/qgsninecellfilter.sip.in

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,6 @@ Starts the calculation, reads from mInputFile and stores the result in mOutputFi
3636
:param feedback: feedback object that receives update and that is checked for cancelation.
3737

3838
:return: 0 in case of success
39-
<<<<<<< 14f8c4361dc1f4103bed735a5cf46b38dcfa4a03
40-
<<<<<<< 528302cc8952497513b44423dfca6fcf4857760c
41-
<<<<<<< d6e747ca57807318c0b3f6be8266f0b43c0f7747
42-
TODO: return an enum
43-
=======
44-
TODO: return an enum
45-
>>>>>>> More updates for opencl
46-
=======
47-
TODO: return an enum
48-
>>>>>>> Bindings for 9cell filter
49-
=======
50-
>>>>>>> Fix documentation for ninecell filters
5139
%End
5240

5341
double cellSizeX() const;
@@ -73,16 +61,16 @@ Must be implemented by subclasses.
7361

7462
First index of the input cell is the row, second index is the column
7563

76-
@param x11 surrounding cell top left
77-
@param x21 surrounding cell central left
78-
@param x31 surrounding cell bottom left
79-
@param x12 surrounding cell top central
80-
@param x22 the central cell for which the value will be calculated
81-
@param x32 surrounding cell bottom central
82-
@param x13 surrounding cell top right
83-
@param x23 surrounding cell central right
84-
@param x33 surrounding cell bottom right
85-
@return the calculated cell value for the central cell x22
64+
:param x11: surrounding cell top left
65+
:param x21: surrounding cell central left
66+
:param x31: surrounding cell bottom left
67+
:param x12: surrounding cell top central
68+
:param x22: the central cell for which the value will be calculated
69+
:param x32: surrounding cell bottom central
70+
:param x13: surrounding cell top right
71+
:param x23: surrounding cell central right
72+
:param x33: surrounding cell bottom right
73+
@return the calculated cell value for the central cell x22
8674
%End
8775

8876
protected:

python/analysis/auto_generated/raster/qgsslopefilter.sip.in

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,7 @@ Calculates output value from nine input values. The input values and the output
2929
nodata value if not present or outside of the border. Must be implemented by subclasses*
3030
%End
3131

32-
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
33-
<<<<<<< d6e747ca57807318c0b3f6be8266f0b43c0f7747
3432

35-
=======
36-
>>>>>>> More updates for opencl
37-
=======
38-
39-
>>>>>>> [opencl] Fix small OpenCL alg issues
4033
};
4134

4235
/************************************************************************

src/analysis/raster/qgshillshadefilter.cpp

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,11 @@
2121
QgsHillshadeFilter::QgsHillshadeFilter( const QString &inputFile, const QString &outputFile, const QString &outputFormat, double lightAzimuth,
2222
double lightAngle )
2323
: QgsDerivativeFilter( inputFile, outputFile, outputFormat )
24-
<<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
25-
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
26-
=======
27-
>>>>>>> Fix some cast warnings, pre-calc values for speed
2824
, mLightAzimuth( static_cast<float>( lightAzimuth ) )
2925
, mLightAngle( static_cast<float>( lightAngle ) )
3026
, mCosZenithRad( std::cos( static_cast<float>( lightAngle * M_PI ) / 180.0f ) )
3127
, mSinZenithRad( std::sin( static_cast<float>( lightAngle * M_PI ) / 180.0f ) )
3228
, mAzimuthRad( static_cast<float>( lightAzimuth * M_PI ) / 180.0f )
33-
<<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
34-
=======
35-
, mLightAzimuth( lightAzimuth )
36-
, mLightAngle( lightAngle )
37-
<<<<<<< 8f40129d09776c7fe96b88604405a908595f9ede
38-
, mCosZenithRad( std::cos( mLightAngle * M_PI / 180.0 ) )
39-
, mSinZenithRad( std::sin( mLightAngle * M_PI / 180.0 ) )
40-
, mAzimuthRad( mLightAzimuth * M_PI / 180.0 )
41-
>>>>>>> [opencl] Fix small OpenCL alg issues
42-
=======
43-
, mCosZenithRad( std::cos( mLightAngle * M_PI / 180.0f ) )
44-
, mSinZenithRad( std::sin( mLightAngle * M_PI / 180.0f ) )
45-
, mAzimuthRad( mLightAzimuth * M_PI / 180.0f )
46-
>>>>>>> [opencl] Small optimization in hillshade
47-
=======
48-
>>>>>>> Fix some cast warnings, pre-calc values for speed
4929
{
5030
}
5131

@@ -66,24 +46,12 @@ float QgsHillshadeFilter::processNineCellWindow( float *x11, float *x21, float *
6646
float aspect_rad = 0;
6747
if ( derX == 0 && derY == 0 ) //aspect undefined, take a neutral value. Better solutions?
6848
{
69-
<<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
70-
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
7149
aspect_rad = mAzimuthRad / 2.0f;
72-
=======
73-
aspect_rad = mAzimuthRad / 2.0;
74-
>>>>>>> [opencl] Fix small OpenCL alg issues
75-
=======
76-
aspect_rad = mAzimuthRad / 2.0f;
77-
>>>>>>> Fix some cast warnings, pre-calc values for speed
7850
}
7951
else
8052
{
8153
aspect_rad = M_PI + std::atan2( derX, derY );
8254
}
83-
<<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
84-
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
85-
=======
86-
>>>>>>> Fix some cast warnings, pre-calc values for speed
8755
return std::max( 0.0f, 255.0f * ( ( mCosZenithRad * std::cos( slope_rad ) ) +
8856
( mSinZenithRad * std::sin( slope_rad ) *
8957
std::cos( mAzimuthRad - aspect_rad ) ) ) );
@@ -100,34 +68,10 @@ void QgsHillshadeFilter::setLightAngle( float angle )
10068
mLightAngle = angle;
10169
mCosZenithRad = std::cos( angle * static_cast<float>( M_PI ) / 180.0f );
10270
mSinZenithRad = std::sin( angle * static_cast<float>( M_PI ) / 180.0f );
103-
<<<<<<< 78a45b7db48bbf028fbb9ff9fa9690d2a596d7ef
104-
}
105-
106-
<<<<<<< a73bbbad21629d81b9b1d4217a096a930473eb5c
107-
#ifdef HAVE_OPENCL
108-
109-
void QgsHillshadeFilter::addExtraRasterParams( std::vector<float> &params )
110-
{
111-
112-
params.push_back( mCosZenithRad ); // cos_zenith_rad 5
113-
params.push_back( mSinZenithRad ); // sin_zenith_rad 6
114-
params.push_back( mAzimuthRad ); // azimuth_rad 7
115-
116-
}
117-
118-
#endif
119-
=======
120-
=======
121-
return std::max( 0.0, 255.0 * ( ( mCosZenithRad * std::cos( slope_rad ) ) +
122-
( mSinZenithRad * std::sin( slope_rad ) *
123-
std::cos( mAzimuthRad - aspect_rad ) ) ) );
124-
=======
125-
>>>>>>> Fix some cast warnings, pre-calc values for speed
12671
}
12772

12873
#ifdef HAVE_OPENCL
12974

130-
>>>>>>> [opencl] Fix small OpenCL alg issues
13175
void QgsHillshadeFilter::addExtraRasterParams( std::vector<float> &params )
13276
{
13377

@@ -136,9 +80,5 @@ void QgsHillshadeFilter::addExtraRasterParams( std::vector<float> &params )
13680
params.push_back( mAzimuthRad ); // azimuth_rad 7
13781

13882
}
139-
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
140-
>>>>>>> [opencl] Use fast formula for hillshade
141-
=======
14283

14384
#endif
144-
>>>>>>> [opencl] Fix small OpenCL alg issues

src/analysis/raster/qgshillshadefilter.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44,48 +44,21 @@ class ANALYSIS_EXPORT QgsHillshadeFilter: public QgsDerivativeFilter
4444
void setLightAngle( float angle );
4545

4646
private:
47-
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
48-
<<<<<<< a73bbbad21629d81b9b1d4217a096a930473eb5c
4947

5048
#ifdef HAVE_OPENCL
5149

52-
=======
53-
>>>>>>> [opencl] Use fast formula for hillshade
54-
=======
55-
56-
#ifdef HAVE_OPENCL
57-
58-
>>>>>>> [opencl] Fix small OpenCL alg issues
5950
const QString openClProgramBaseName() const override
6051
{
6152
return QStringLiteral( "hillshade" );
6253
}
63-
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
64-
<<<<<<< a73bbbad21629d81b9b1d4217a096a930473eb5c
6554
#endif
6655

67-
=======
68-
>>>>>>> [opencl] Use fast formula for hillshade
69-
=======
70-
#endif
71-
72-
>>>>>>> [opencl] Fix small OpenCL alg issues
7356
float mLightAzimuth;
7457
float mLightAngle;
7558
// Precalculate for speed:
7659
float mCosZenithRad;
7760
float mSinZenithRad;
7861
float mAzimuthRad;
79-
<<<<<<< 573283f0dcf022e84bd615e84fd2656043a9722b
80-
81-
82-
#ifdef HAVE_OPENCL
83-
private:
84-
85-
void addExtraRasterParams( std::vector<float> &params ) override;
86-
#endif
87-
=======
88-
>>>>>>> [opencl] Fix small OpenCL alg issues
8962

9063

9164
#ifdef HAVE_OPENCL

0 commit comments

Comments
 (0)