Commit 0d1911c0 authored by Julien Michel's avatar Julien Michel

BUG: Track down upstream pipeline for each image in ImageList (fix #1516)

parent a2119c37
......@@ -121,7 +121,7 @@ public:
static const double MegabyteToByte;
/** Evaluate the print (in bytes) of a single data object */
MemoryPrintType EvaluateDataObjectPrint(DataObjectType * data) const;
MemoryPrintType EvaluateDataObjectPrint(DataObjectType * data);
protected:
/** Constructor */
......
......@@ -183,11 +183,16 @@ PipelineMemoryPrintCalculator
{ \
ImageList<Image<type, 2> > * imageList = dynamic_cast<otb::ImageList<otb::Image<type, 2> > *>(data); \
MemoryPrintType print(0); \
for(ImageList<Image<type, 2> >::ConstIterator it = imageList->Begin(); \
for(ImageList<Image<type, 2> >::Iterator it = imageList->Begin(); \
it != imageList->End(); ++it) \
{ \
print += it.Get()->GetRequestedRegion().GetNumberOfPixels() \
* it.Get()->GetNumberOfComponentsPerPixel() * sizeof(type); \
if(it.Get()->GetSource()) \
{ \
it.Get()->PropagateRequestedRegion(); \
print += this->EvaluateProcessObjectPrintRecursive(it.Get()->GetSource());\
} \
else \
print += this->EvaluateDataObjectPrint(it.Get()); \
} \
return print; \
} \
......@@ -198,8 +203,10 @@ PipelineMemoryPrintCalculator
for(ImageList<VectorImage<type, 2> >::ConstIterator it = imageList->Begin(); \
it != imageList->End(); ++it) \
{ \
print += it.Get()->GetRequestedRegion().GetNumberOfPixels() \
* it.Get()->GetNumberOfComponentsPerPixel() * sizeof(type); \
if(it.Get()->GetSource()) \
print += this->EvaluateProcessObjectPrintRecursive(it.Get()->GetSource());\
else \
print += this->EvaluateDataObjectPrint(it.Get()); \
} \
return print; \
} \
......
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