Commit b8c8ccb4 authored by OTB Bot's avatar OTB Bot

STYLE

parent 5df14754
......@@ -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() {}
......
......@@ -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;
......
......@@ -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)
{
......
......@@ -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);
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment