Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jordi Inglada
otb
Commits
53aad511
Commit
53aad511
authored
9 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
WRG: fix type conversion, fix what this test pretends to test
parent
45a52eb9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/Core/Common/test/otbRGBAPixelConverter.cxx
+13
-12
13 additions, 12 deletions
Modules/Core/Common/test/otbRGBAPixelConverter.cxx
with
13 additions
and
12 deletions
Modules/Core/Common/test/otbRGBAPixelConverter.cxx
+
13
−
12
View file @
53aad511
...
...
@@ -52,12 +52,13 @@ int otbRGBAPixelConverter(int itkNotUsed(argc), char * itkNotUsed(argv) [])
typedef
unsigned
int
PixelType0
;
typedef
double
PixelType1
;
typedef
itk
::
RGBAPixel
<
unsigned
int
>
PixelType2
;
typedef
itk
::
RGBPixel
<
double
>
PixelType3
;
typedef
itk
::
RGBAPixel
<
double
>
PixelType3
;
typedef
itk
::
RGBPixel
<
double
>
PixelType4
;
typedef
otb
::
RGBAPixelConverter
<
PixelType0
,
PixelType0
>
ConverterType0
;
typedef
otb
::
RGBAPixelConverter
<
PixelType1
,
PixelType0
>
ConverterType1
;
typedef
otb
::
RGBAPixelConverter
<
PixelType0
,
PixelType
2
>
ConverterType2
;
typedef
otb
::
RGBAPixelConverter
<
PixelType0
,
PixelType
3
>
ConverterType3
;
typedef
otb
::
RGBAPixelConverter
<
PixelType0
,
PixelType
3
>
ConverterType2
;
typedef
otb
::
RGBAPixelConverter
<
PixelType0
,
PixelType
4
>
ConverterType3
;
// Instantiating object
ConverterType0
::
Pointer
converter0
=
ConverterType0
::
New
();
...
...
@@ -74,19 +75,19 @@ int otbRGBAPixelConverter(int itkNotUsed(argc), char * itkNotUsed(argv) [])
std
::
cout
<<
"outputPixel0: "
<<
outputPixel0
<<
std
::
endl
;
if
(
outputPixel0
!=
112
)
{
itkGenericExceptionMacro
(
<<
"RGBA<unsigned int> 2 unsigned int Fail
l
ed"
);
itkGenericExceptionMacro
(
<<
"RGBA<unsigned int> 2 unsigned int Failed"
);
}
PixelType
2
pixel1
;
pixel1
[
0
]
=
125
;
pixel1
[
1
]
=
105
;
pixel1
[
2
]
=
145
;
pixel1
[
3
]
=
0.75
;
PixelType
3
pixel1
;
pixel1
[
0
]
=
125
.0
;
pixel1
[
1
]
=
105
.0
;
pixel1
[
2
]
=
145
.0
;
pixel1
[
3
]
=
191.0
;
ConverterType1
::
OutputPixelType
outputPixel1
=
converter1
->
Convert
(
pixel1
);
std
::
cout
<<
"outputPixel1: "
<<
outputPixel1
<<
std
::
endl
;
if
(
outputPixel1
!=
112
)
{
itkGenericExceptionMacro
(
<<
"RGBA<double> 2 unsigned int Fail
l
ed"
);
itkGenericExceptionMacro
(
<<
"RGBA<double> 2 unsigned int Failed"
);
}
PixelType2
pixel2
;
...
...
@@ -98,7 +99,7 @@ int otbRGBAPixelConverter(int itkNotUsed(argc), char * itkNotUsed(argv) [])
std
::
cout
<<
"outputPixel2: "
<<
outputPixel2
<<
std
::
endl
;
if
(
outputPixel2
[
0
]
!=
125
||
outputPixel2
[
1
]
!=
105
||
outputPixel2
[
2
]
!=
145
||
outputPixel2
[
3
]
!=
0
)
{
itkGenericExceptionMacro
(
<<
"RGBA<unsigned int> 2 RGBA<double> Fail
l
ed"
);
itkGenericExceptionMacro
(
<<
"RGBA<unsigned int> 2 RGBA<double> Failed"
);
}
PixelType2
pixel3
;
...
...
@@ -110,7 +111,7 @@ int otbRGBAPixelConverter(int itkNotUsed(argc), char * itkNotUsed(argv) [])
std
::
cout
<<
"outputPixel3: "
<<
outputPixel3
<<
std
::
endl
;
if
(
outputPixel3
[
0
]
!=
125
||
outputPixel3
[
1
]
!=
105
||
outputPixel3
[
2
]
!=
145
)
{
itkGenericExceptionMacro
(
<<
"RGBA<unsigned int> 2 RGB<double> Fail
l
ed"
);
itkGenericExceptionMacro
(
<<
"RGBA<unsigned int> 2 RGB<double> Failed"
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment