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
Antoine Belvire
otb
Commits
41cc2830
Commit
41cc2830
authored
16 years ago
by
Guillaume Borrut
Browse files
Options
Downloads
Patches
Plain Diff
ENH. Adding the different RAD formats :
OCT, PHA, I2, I4, R4, CI2, CR4, COCT, C3B, C5B, C7B, CI4, CR8
parent
e161da3e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/IO/otbRADImageIO.cxx
+104
-11
104 additions, 11 deletions
Code/IO/otbRADImageIO.cxx
with
104 additions
and
11 deletions
Code/IO/otbRADImageIO.cxx
+
104
−
11
View file @
41cc2830
...
...
@@ -340,14 +340,14 @@ bool RADImageIO::InternalReadHeaderInformation(const std::string & file_name, st
{
m_PixelType
=
SCALAR
;
SetComponentType
(
UCHAR
);
m_NbOctetPixel
=
1
;
//ok
m_NbOctetPixel
=
1
;
}
if
(
lStrCodePix
==
"PHA"
)
{
m_PixelType
=
SCALAR
;
// 0 .. 360 degree
SetComponentType
(
USHORT
);
m_NbOctetPixel
=
1
;
//cmt tu codes 360 avec 8 bits stp ?
SetComponentType
(
CHAR
);
m_NbOctetPixel
=
1
;
}
if
(
lStrCodePix
==
"I2"
)
{
...
...
@@ -358,7 +358,7 @@ bool RADImageIO::InternalReadHeaderInformation(const std::string & file_name, st
if
(
lStrCodePix
==
"I4"
)
{
m_PixelType
=
SCALAR
;
SetComponentType
(
LONG
);
SetComponentType
(
INT
);
m_NbOctetPixel
=
4
;
}
if
(
lStrCodePix
==
"R4"
)
...
...
@@ -382,7 +382,7 @@ bool RADImageIO::InternalReadHeaderInformation(const std::string & file_name, st
else
if
(
lStrCodePix
==
"COCT"
)
{
m_PixelType
=
COMPLEX
;
SetComponentType
(
FLOAT
);
SetComponentType
(
UCHAR
);
m_NbOctetPixel
=
2
;
}
else
if
(
lStrCodePix
==
"C3B"
)
...
...
@@ -406,7 +406,7 @@ bool RADImageIO::InternalReadHeaderInformation(const std::string & file_name, st
else
if
(
lStrCodePix
==
"CI4"
)
{
m_PixelType
=
COMPLEX
;
SetComponentType
(
LONG
);
SetComponentType
(
INT
);
m_NbOctetPixel
=
8
;
}
else
if
(
lStrCodePix
==
"CR8"
)
...
...
@@ -533,8 +533,8 @@ std::cout<< " Write !!!!!!!!! " <<std::endl;
std
::
cout
<<
" Write2 !!!!!!!!! "
<<
std
::
endl
;
//
Cas particuliers
:
on
control
e que si la
r
�
gion
� �c
ri
r
e
est de la m�
me dimension
que l'image enti�
re,
//
on commence l'
offset
�
0 (
lorsque que l'on est pas e
n "Streaming")
//
Special case
:
we
control
that if the
r
e
gion
to w
ri
t
e
has the sa
me dimension
that the entire pictu
re,
//
we start to the
offset
to
0 (
when ze4re not i
n "Streaming")
if
(
(
lNbLignes
==
m_Dimensions
[
1
])
&&
(
lNbColonnes
==
m_Dimensions
[
0
]))
{
otbMsgDevMacro
(
<<
"Force the IORegion offset to 0"
);
...
...
@@ -556,8 +556,8 @@ otbMsgDevMacro( <<" GetComponentSize : "<<this->GetComponentSize());
unsigned
long
cpt
=
0
;
// Update the step variable
step
=
m_NbOctetPixel
;
//(unsigned long)(this->GetComponentSize()); //step *
step
=
m_NbOctetPixel
;
const
char
*
p
=
static_cast
<
const
char
*>
(
buffer
);
std
::
cout
<<
" step : "
<<
step
<<
std
::
endl
;
...
...
@@ -656,6 +656,99 @@ std::cout<< " Avant open !!!!!!!!! " <<std::endl;
std
::
string
lString
;
//Write TYPE information
m_HeaderFile
<<
"TYPECODAGE "
;
// << std::endl;
std
::
string
lExtension
;
std
::
string
lStringPixelType
=
System
::
SetToUpper
(
this
->
GetPixelTypeAsString
(
m_PixelType
));
std
::
string
lStringComponentType
=
System
::
SetToUpper
(
this
->
GetComponentTypeAsString
(
this
->
GetComponentType
()));
std
::
cout
<<
"toto "
<<
lStringPixelType
<<
std
::
endl
;
std
::
cout
<<
"tutu "
<<
lStringComponentType
<<
std
::
endl
;
if
(
lStringPixelType
==
"SCALAR"
)
{
if
(
lStringComponentType
==
"UCHAR"
)
{
m_NbOctetPixel
=
1
;
m_TypeRAD
=
"OCT"
;
lExtension
=
".oct"
;
}
else
if
(
lStringComponentType
==
"CHAR"
)
{
m_NbOctetPixel
=
1
;
m_TypeRAD
=
"PHA"
;
lExtension
=
".pha"
;
}
else
if
(
lStringComponentType
==
"SHORT"
)
{
m_NbOctetPixel
=
2
;
m_TypeRAD
=
"I2"
;
lExtension
=
".i2"
;
}
else
if
(
lStringComponentType
==
"INT"
)
{
m_NbOctetPixel
=
4
;
m_TypeRAD
=
"I4"
;
}
else
if
(
lStringComponentType
==
"FLOAT"
)
{
m_NbOctetPixel
=
4
;
m_TypeRAD
=
"R4"
;
lExtension
=
".r4"
;
}
}
else
if
(
lStringPixelType
==
"COMPLEX"
)
{
if
(
lStringComponentType
==
"SHORT"
||
lStringComponentType
==
"INT"
)
{
std
::
cout
<<
"ICIIIII ?"
<<
std
::
endl
;
m_NbOctetPixel
=
4
;
m_TypeRAD
=
"CI2"
;
lExtension
=
".ci2"
;
}
else
if
(
lStringComponentType
==
"FLOAT"
)
{
m_NbOctetPixel
=
8
;
m_TypeRAD
=
"CR4"
;
lExtension
=
".cr4"
;
}
/* if( this->GetComponentType()=="FLOAT")
{
m_NbOctetPixel=2;
m_TypeRAD = "COCT"
}
if( this->GetComponentType()=="FLOAT")
{
m_NbOctetPixel=2;
m_TypeRAD = "C3B"
}
if( this->GetComponentType()==FLOAT)
{
m_NbOctetPixel=2;
m_TypeRAD = "C5B"
}
if( this->GetComponentType()==FLOAT)
{
m_NbOctetPixel=2;
m_TypeRAD = "C7B"
}
*/
else
if
(
lStringComponentType
==
"INT"
)
{
m_NbOctetPixel
=
8
;
m_TypeRAD
=
"CI4"
;
lExtension
=
".ci4"
;
}
else
if
(
lStringComponentType
==
"DOUBLE"
)
{
m_NbOctetPixel
=
16
;
m_TypeRAD
=
"CR8"
;
lExtension
=
".cr8"
;
}
}
m_HeaderFile
<<
m_TypeRAD
<<
std
::
endl
;
//Write "SENSCODAGE" informations
...
...
@@ -678,7 +771,7 @@ std::cout<< " Avant open !!!!!!!!! " <<std::endl;
//comment on sait HH/HV/VH/VV ??
lStream
<<
lRootName
<<
"_"
<<
i
+
1
<<
".ci2"
;
lStream
<<
lRootName
<<
"_"
<<
i
+
1
<<
lExtension
;
m_ChannelsFileName
.
push_back
(
lStream
.
str
());
}
...
...
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