Commit c2b2c9f2 authored by Julien Malik's avatar Julien Malik

ENH: Use the next multiple instead of the previous, causing overtiling for small images

parent aa1c15ea
......@@ -33,8 +33,8 @@ ImageRegionSquareTileSplitter<VImageDimension>
unsigned int theoricalNbPixelPerTile = region.GetNumberOfPixels() / requestedNumber;
unsigned int theoricalTileDimension = static_cast<unsigned int> (vcl_sqrt(static_cast<double>(theoricalNbPixelPerTile)) );
// Take the previous multiple of m_TileSizeAlignment (eventually generate more splits than requested)
m_TileDimension = theoricalTileDimension / m_TileSizeAlignment * m_TileSizeAlignment;
// Take the next multiple of m_TileSizeAlignment (eventually generate more splits than requested)
m_TileDimension = (theoricalTileDimension + m_TileSizeAlignment - 1) / m_TileSizeAlignment * m_TileSizeAlignment;
// Minimal tile size is m_TileSizeAlignment * m_TileSizeAlignment
if (m_TileDimension < m_TileSizeAlignment)
......
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