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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
David Youssefi
otb
Commits
e4249148
Commit
e4249148
authored
13 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Handling case where TileHint is empty or VImageDimension!=2
parent
ffef95cb
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
Code/Common/otbImageRegionAdaptativeSplitter.txx
+42
-4
42 additions, 4 deletions
Code/Common/otbImageRegionAdaptativeSplitter.txx
with
42 additions
and
4 deletions
Code/Common/otbImageRegionAdaptativeSplitter.txx
+
42
−
4
View file @
e4249148
...
...
@@ -22,6 +22,9 @@
#include "otbMath.h"
#include "otbMacro.h"
// Defaut when no tile hint available
#include "otbImageRegionSquareTileSplitter.h"
namespace otb
{
...
...
@@ -64,9 +67,10 @@ ImageRegionAdaptativeSplitter<VImageDimension>
return m_StreamVector.at(i);
}
template <unsigned int VImageDimension>
// Here we only handle VDimension = 2
template <>
void
ImageRegionAdaptativeSplitter<
VImageDimension
>
ImageRegionAdaptativeSplitter<
2
>
::EstimateSplitMap()
{
// Clear previous split map
...
...
@@ -80,12 +84,25 @@ ImageRegionAdaptativeSplitter<VImageDimension>
return;
}
// Handle the empty hint case
else
if(m_TileHint[0] == 0 || m_TileHint[1] == 0)
if(m_TileHint[0] == 0 || m_TileHint[1] == 0)
{
// TODO: Fallback in standard case
// In this case we fallback to the classical tile splitter
typename otb::ImageRegionSquareTileSplitter<2>::Pointer
splitter = otb::ImageRegionSquareTileSplitter<2>::New();
// Retrieve nb splits
unsigned int nbSplits = splitter->GetNumberOfSplits(m_ImageRegion,m_RequestedNumberOfSplits);
for(unsigned int i = 0; i<nbSplits;++i)
{
m_StreamVector.push_back(splitter->GetSplit(i,m_RequestedNumberOfSplits,m_ImageRegion));
}
m_IsUpToDate = true;
return;
}
// Now we can handle the case where we have a tile hint and a
// non-trivial requested number of splits
SizeType tilesPerDim,splitsPerDim;
tilesPerDim[0] = (m_ImageRegion.GetSize()[0] + m_TileHint[0] -1) / m_TileHint[0];
...
...
@@ -200,8 +217,29 @@ ImageRegionAdaptativeSplitter<VImageDimension>
}
// Finally toggle the up-to-date flag
m_IsUpToDate = true;
return;
}
// When VImageDimension is not 2, we fall back to classical tile splitter
template <unsigned int VImageDimension>
void
ImageRegionAdaptativeSplitter<VImageDimension>
::EstimateSplitMap()
{
// In this case we fallback to the classical tile splitter
typename otb::ImageRegionSquareTileSplitter<VImageDimension>::Pointer
splitter = otb::ImageRegionSquareTileSplitter<VImageDimension>::New();
// Retrieve nb splits
unsigned int nbSplits = splitter->GetNumberOfSplits(m_ImageRegion,m_RequestedNumberOfSplits);
for(unsigned int i = 0; i<nbSplits;++i)
{
m_StreamVector->push_back(splitter->GetSplit(i,m_RequestedNumberOfSplits,m_ImageRegion));
}
m_IsUpToDate = true;
return;
}
/**
*
*/
...
...
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