Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
26dea959
Commit
26dea959
authored
Mar 17, 2010
by
Emmanuel Christophe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: move hill shading modulation functor in class
parent
3121db56
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
25 deletions
+31
-25
Code/BasicFilters/otbHillShadingFunctor.h
Code/BasicFilters/otbHillShadingFunctor.h
+30
-2
Examples/BasicFilters/HillShadingExample.cxx
Examples/BasicFilters/HillShadingExample.cxx
+1
-23
No files found.
Code/BasicFilters/otbHillShadingFunctor.h
View file @
26dea959
...
...
@@ -24,6 +24,33 @@ namespace otb
{
namespace
Functor
{
/** \class HillShadeModulationFunctor
* \brief Modulate an image with hill shading
*
* Take an image (RGB) as input and the result of the hillshading
* (another image with the value between 0 and 1) and modulate
* the first image by the value of the hill shading.
*
* \ingroup Functor
* \example BasicFilters/HillShadingExample.cxx
*/
template
<
class
TInput1
,
class
TInput2
=
TInput1
,
class
TOutput
=
TInput1
>
class
HillShadeModulationFunctor
{
public:
HillShadeModulationFunctor
()
{}
~
HillShadeModulationFunctor
()
{}
inline
TOutput
operator
()(
const
TInput1
&
A
,
const
TInput2
&
B
)
const
{
TOutput
out
;
out
.
SetRed
(
A
.
GetRed
()
*
B
);
out
.
SetGreen
(
A
.
GetGreen
()
*
B
);
out
.
SetBlue
(
A
.
GetBlue
()
*
B
);
return
out
;
}
};
/** \class HillShadingFunctor
* \brief Unary neighborhood functor to compute the lambertian of a surface
*
...
...
@@ -32,14 +59,15 @@ namespace Functor
* representation of relief. The output is a value between 0 and 1.
*
* \ingroup Functor
* \example BasicFilters/HillShadingExample.cxx
*/
template
<
class
TNeighIter
,
class
TInputImage
,
class
TOutput
>
class
HillShadingFunctor
{
public:
typedef
HillShadingFunctor
Self
;
typedef
TNeighIter
IteratorType
;
typedef
HillShadingFunctor
Self
;
typedef
TNeighIter
IteratorType
;
typedef
typename
IteratorType
::
PixelType
PixelType
;
HillShadingFunctor
()
:
m_AzimuthLight
(
30.0
/
180.0
*
CONST_PI
),
m_ElevationLight
(
45.0
/
180.0
*
CONST_PI
),
...
...
Examples/BasicFilters/HillShadingExample.cxx
View file @
26dea959
...
...
@@ -61,28 +61,6 @@
#include "itkBinaryFunctorImageFilter.h"
#include "otbWorldFile.h"
namespace
otb
{
namespace
Functor
{
template
<
class
TInput1
,
class
TInput2
=
TInput1
,
class
TOutput
=
TInput1
>
class
MultRGB
{
public:
MultRGB
()
{}
~
MultRGB
()
{}
inline
TOutput
operator
()(
const
TInput1
&
A
,
const
TInput2
&
B
)
const
{
TOutput
out
;
out
.
SetRed
(
A
.
GetRed
()
*
B
);
out
.
SetGreen
(
A
.
GetGreen
()
*
B
);
out
.
SetBlue
(
A
.
GetBlue
()
*
B
);
return
out
;
}
};
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
@@ -195,7 +173,7 @@ int main(int argc, char * argv[])
typedef
itk
::
BinaryFunctorImageFilter
<
RGBImageType
,
ImageType
,
RGBImageType
,
otb
::
Functor
::
MultRGB
<
RGBPixelType
,
PixelType
,
RGBPixelType
>
>
MultiplyFilterType
;
otb
::
Functor
::
HillShadeModulationFunctor
<
RGBPixelType
,
PixelType
,
RGBPixelType
>
>
MultiplyFilterType
;
MultiplyFilterType
::
Pointer
multiply
=
MultiplyFilterType
::
New
();
multiply
->
SetInput1
(
colormapper
->
GetOutput
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment