Home || Architecture || Video Search || Visual Search || Scripts || Applications || 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 90 of file ImageArchiveFile.h.

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

Referenced by ReadImage().

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

Here is the call graph for this function:


Generated on Fri Mar 19 10:59:29 2010 for ImpalaSrc by  doxygen 1.5.1