(0010244)
|
Luis Ibanez
|
2008-01-23 14:56
|
|
The issue of type was solved.
However, this didn't solved the original need of the user, since they
were actually needing to access a subregion of the image, not the entire
image:
email from Thomas Feuvrier: (9/19/07)
In fact, to do the streaming reading in the otb::ImageFileReader, we
must calcule the size in Byte of a specific region, not for all
dimension image.
So we can't use directly the ImageIOBase::GetImageSizeInBytes() method
because it call ImageIOBase::GetImageSizeInComponents() wich call
this->GetImageSizeInPixels().
And the ImageIOBase::GetComponentSize() method is protected, not public.
So we can't write the line :
std::streamoff nbBytes;
nbBytes = static_cast<std::streamoff>(region.GetNumberOfPixels())
* this->m_ImageIO->GetNumberOfComponents() * this->GetComponentSize()
To solve me problem, I find this solution :
nbBytes = this->m_ImageIO->GetImageSizeInBytes() /
this->m_ImageIO->GetImageSizeInPixels() *
static_cast<std::streamoff>(region.GetNumberOfPixels()); |
|