Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
b8c8ccb4
Commit
b8c8ccb4
authored
Dec 19, 2011
by
OTB Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
STYLE
parent
5df14754
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
26 deletions
+26
-26
Code/Common/otbImageRegionAdaptativeSplitter.h
Code/Common/otbImageRegionAdaptativeSplitter.h
+13
-13
Code/Common/otbImageRegionAdaptativeSplitter.txx
Code/Common/otbImageRegionAdaptativeSplitter.txx
+6
-6
Code/IO/otbGDALImageIO.cxx
Code/IO/otbGDALImageIO.cxx
+1
-1
Code/IO/otbJPEG2000ImageIO.cxx
Code/IO/otbJPEG2000ImageIO.cxx
+2
-2
Testing/Code/Common/otbImageRegionAdaptativeSplitter.cxx
Testing/Code/Common/otbImageRegionAdaptativeSplitter.cxx
+4
-4
No files found.
Code/Common/otbImageRegionAdaptativeSplitter.h
View file @
b8c8ccb4
...
...
@@ -32,13 +32,13 @@ namespace otb
/** \class ImageRegionSquareTileSplitter
* \brief Divide a region into several pieces.
*
*
* This region splitter tries to adapt to the tiling scheme of the
* input image using the TileHint parameter. It aims at
* synchronizing the streaming with the tiling scheme so as to avoid
* reading the same tile multiple times in the standard pixel-based
* processing scheme.
*
*
* If the requested number of splits is lower than the number of
* tiles in the image region, then the splitter will derive splits
* that combine several tiles in one split. If the requested number
...
...
@@ -97,24 +97,24 @@ public:
typedef
std
::
vector
<
RegionType
>
StreamVectorType
;
/** Set the TileHint parameter */
itkSetMacro
(
TileHint
,
SizeType
);
itkSetMacro
(
TileHint
,
SizeType
);
/** Get the TileHint parameter */
itkGetConstReferenceMacro
(
TileHint
,
SizeType
);
itkGetConstReferenceMacro
(
TileHint
,
SizeType
);
/** Set the ImageRegion parameter */
itkSetMacro
(
ImageRegion
,
RegionType
);
itkSetMacro
(
ImageRegion
,
RegionType
);
/** Get the ImageRegion parameter */
itkGetConstReferenceMacro
(
ImageRegion
,
RegionType
);
itkGetConstReferenceMacro
(
ImageRegion
,
RegionType
);
/** Set the requested number of splits parameter */
itkSetMacro
(
RequestedNumberOfSplits
,
unsigned
int
);
itkSetMacro
(
RequestedNumberOfSplits
,
unsigned
int
);
/** Get the requested number of splits parameter */
itkGetConstReferenceMacro
(
RequestedNumberOfSplits
,
unsigned
int
);
itkGetConstReferenceMacro
(
RequestedNumberOfSplits
,
unsigned
int
);
/**
/**
* Calling this method will set the image region and the requested
* number of splits, and call the EstimateSplitMap() method if
* necessary.
...
...
@@ -139,11 +139,11 @@ public:
}
protected:
ImageRegionAdaptativeSplitter
()
:
m_TileHint
(),
m_ImageRegion
(),
m_RequestedNumberOfSplits
(
0
),
ImageRegionAdaptativeSplitter
()
:
m_TileHint
(),
m_ImageRegion
(),
m_RequestedNumberOfSplits
(
0
),
m_StreamVector
(),
m_IsUpToDate
(
false
)
m_IsUpToDate
(
false
)
{}
virtual
~
ImageRegionAdaptativeSplitter
()
{}
...
...
Code/Common/otbImageRegionAdaptativeSplitter.txx
View file @
b8c8ccb4
...
...
@@ -90,11 +90,11 @@ ImageRegionAdaptativeSplitter<VImageDimension>
splitter = otb::ImageRegionSquareTileSplitter<2>::New();
// Retrieve nb splits
unsigned int nbSplits = splitter->GetNumberOfSplits(m_ImageRegion,m_RequestedNumberOfSplits);
unsigned int nbSplits = splitter->GetNumberOfSplits(m_ImageRegion,
m_RequestedNumberOfSplits);
for(unsigned int i = 0; i<nbSplits;++i)
for(unsigned int i = 0; i<nbSplits;
++i)
{
m_StreamVector.push_back(splitter->GetSplit(i,m_RequestedNumberOfSplits,m_ImageRegion));
m_StreamVector.push_back(splitter->GetSplit(i,
m_RequestedNumberOfSplits,
m_ImageRegion));
}
m_IsUpToDate = true;
return;
...
...
@@ -102,7 +102,7 @@ ImageRegionAdaptativeSplitter<VImageDimension>
// Now we can handle the case where we have a tile hint and a
// non-trivial requested number of splits
SizeType tilesPerDim,splitsPerDim;
SizeType tilesPerDim,
splitsPerDim;
tilesPerDim[0] = (m_ImageRegion.GetSize()[0] + m_TileHint[0] -1) / m_TileHint[0];
tilesPerDim[1] = (m_ImageRegion.GetSize()[1] + m_TileHint[1] -1) / m_TileHint[1];
...
...
@@ -163,9 +163,9 @@ ImageRegionAdaptativeSplitter<VImageDimension>
m_StreamVector.push_back(newSplit);
}
}
}
}
// In this case, we must divide each tile
// In this case, we must divide each tile
else
{
SizeType divideTiles;
...
...
Code/IO/otbGDALImageIO.cxx
View file @
b8c8ccb4
...
...
@@ -807,7 +807,7 @@ void GDALImageIO::InternalReadImageInformation()
int
blockSizeX
=
0
;
int
blockSizeY
=
0
;
dataset
->
GetRasterBand
(
1
)
->
GetBlockSize
(
&
blockSizeX
,
&
blockSizeY
);
dataset
->
GetRasterBand
(
1
)
->
GetBlockSize
(
&
blockSizeX
,
&
blockSizeY
);
if
(
blockSizeX
>
0
&&
blockSizeY
>
0
)
{
...
...
Code/IO/otbJPEG2000ImageIO.cxx
View file @
b8c8ccb4
...
...
@@ -1253,8 +1253,8 @@ void JPEG2000ImageIO::ReadImageInformation()
}
// Encapsulate tile hints for streaming
unsigned
int
tileHintX
=
m_InternalReaders
.
front
()
->
m_TileWidth
/
static_cast
<
unsigned
int
>
(
vcl_pow
(
2.0
,(
int
)
m_ResolutionFactor
));
unsigned
int
tileHintY
=
m_InternalReaders
.
front
()
->
m_TileHeight
/
static_cast
<
unsigned
int
>
(
vcl_pow
(
2.0
,(
int
)
m_ResolutionFactor
));
unsigned
int
tileHintX
=
m_InternalReaders
.
front
()
->
m_TileWidth
/
static_cast
<
unsigned
int
>
(
vcl_pow
(
2.0
,
(
int
)
m_ResolutionFactor
));
unsigned
int
tileHintY
=
m_InternalReaders
.
front
()
->
m_TileHeight
/
static_cast
<
unsigned
int
>
(
vcl_pow
(
2.0
,
(
int
)
m_ResolutionFactor
));
itk
::
EncapsulateMetaData
<
unsigned
int
>
(
dict
,
MetaDataKey
::
TileHintX
,
tileHintX
);
itk
::
EncapsulateMetaData
<
unsigned
int
>
(
dict
,
MetaDataKey
::
TileHintY
,
tileHintY
);
...
...
Testing/Code/Common/otbImageRegionAdaptativeSplitter.cxx
View file @
b8c8ccb4
...
...
@@ -35,7 +35,7 @@ int otbImageRegionAdaptativeSplitterNew(int argc, char * argv[])
int
otbImageRegionAdaptativeSplitter
(
int
argc
,
char
*
argv
[])
{
SizeType
regionSize
,
tileHint
;
SizeType
regionSize
,
tileHint
;
IndexType
regionIndex
;
RegionType
region
;
unsigned
int
requestedNbSplits
;
...
...
@@ -58,14 +58,14 @@ int otbImageRegionAdaptativeSplitter(int argc, char * argv[])
splitter
->
SetTileHint
(
tileHint
);
unsigned
int
nbSplits
=
splitter
->
GetNumberOfSplits
(
region
,
requestedNbSplits
);
unsigned
int
nbSplits
=
splitter
->
GetNumberOfSplits
(
region
,
requestedNbSplits
);
outfile
<<
splitter
<<
std
::
endl
;
outfile
<<
"Split map: "
<<
std
::
endl
;
for
(
unsigned
int
i
=
0
;
i
<
nbSplits
;
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
nbSplits
;
++
i
)
{
outfile
<<
"Split "
<<
i
<<
": "
<<
splitter
->
GetSplit
(
i
,
requestedNbSplits
,
region
);
outfile
<<
"Split "
<<
i
<<
": "
<<
splitter
->
GetSplit
(
i
,
requestedNbSplits
,
region
);
}
outfile
.
close
();
...
...
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