Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

UInt8* Impala::Core::Array::ImageArchiveFile::GetImageData ( int  idx,
size_t &  blockSize 
) [inline, virtual]

Reimplemented from Impala::Core::Array::ImageArchive.

Definition at line 88 of file ImageArchiveFile.h.

References ILOG_ERROR, mFileOffset, mIOBuffer, Impala::Util::IOBuffer::Read(), Impala::Util::IOBuffer::SetPosition(), and Valid().

Referenced by ReadImage().

00089     {
00090         if (!Valid())
00091         {
00092             ILOG_ERROR("Cannot GetImageData: archive not valid");
00093             return 0;
00094         }
00095         if (idx >= mFileOffset.size())
00096         {
00097             ILOG_ERROR("Index out of bounds: " << idx << " vs. " <<
00098                        mFileOffset.size());
00099             return 0;
00100         }
00101 
00102         mIOBuffer->SetPosition(mFileOffset[idx]);
00103         char buf[200];
00104         int width;
00105         int height;
00106         mIOBuffer->Read(buf, 20);
00107         sscanf(buf, "%d %d ", &width, &height);
00108         blockSize = width*height;
00109         UInt8* data = new UInt8[blockSize];
00110         size_t nrRead = mIOBuffer->Read(data, blockSize);
00111         if (nrRead != blockSize)
00112             ILOG_ERROR("GetImageData: read " << nrRead
00113                         << " bytes instead of " << blockSize);
00114         return data;
00115     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:17:19 2011 for ImpalaSrc by  doxygen 1.5.1