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

Array2dVec3UInt8* Impala::Application::Videolympics::RawImageDataset::GetImage ( int  nr  )  [inline]

Definition at line 52 of file RawImageDataset.h.

References ILOG_ERROR, ILOG_WARN, mFileOffset, mIOBuffer, NrImages(), Impala::Util::IOBuffer::Read(), Impala::Core::Array::ReadImageFromMemory(), and Impala::Util::IOBuffer::SetPosition().

Referenced by Impala::Application::Videolympics::VidolviWindow::GetNewImages().

00053     {
00054         if (nr < 0 || nr > NrImages())
00055         {
00056             ILOG_WARN("request for image nr " << nr << ", only " << NrImages() << " in dataset.");
00057             return 0;
00058         }
00059 
00060         char buf[200];
00061         int width;
00062         int height;
00063         mIOBuffer->SetPosition(mFileOffset[nr]);
00064         mIOBuffer->Read(buf, 20);
00065         sscanf(buf, "%d %d ", &width, &height);
00066         size_t blockSize = width*height;
00067         char* data = new char[blockSize];
00068         size_t nrRead = mIOBuffer->Read(data, blockSize);
00069         if (nrRead != blockSize)
00070         {
00071             ILOG_ERROR("GetImage: read " << nrRead
00072                       << " bytes instead of " << blockSize);
00073         }
00074 
00075         Array2dVec3UInt8* image = 0;
00076 
00077         ReadImageFromMemory(image, data, blockSize);
00078         delete data;
00079 
00080         return image;
00081     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:16:53 2011 for ImpalaSrc by  doxygen 1.5.1