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

int Impala::Application::Video::DemoVideo (  ) 

Definition at line 65 of file mainVideo.cpp.

References Impala::Core::Stream::RgbDataDst::Close(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CPB(), Impala::Core::Stream::RgbDataSrc::DataPtr(), FpsReset(), Impala::Core::Stream::RgbDataSrc::FrameHeight(), Impala::Core::Stream::RgbDataSrc::FrameWidth(), gDoLoop, gDoRandom, gDst, gFramesDone, gGopSize, gNrFrames, Impala::Core::Stream::RgbDataSrc::GotoFrame(), gRotateLeft, gRotateRight, gSrc, gStatusBuf, gStepSize, gTimer, gVerbose, Impala::Core::Stream::RgbDataSrc::LastFrame(), Impala::Core::Geometry::NEAREST, Impala::Core::Stream::RgbDataDst::NextFrame(), Impala::Core::Stream::RgbDataSrc::NextFrame(), Impala::Core::Stream::RgbDataSrc::Reset(), Impala::Core::Array::Rotate(), Impala::Timer::Start(), Impala::Core::Stream::RgbDataSrc::TheEnd(), UpdateStatusBuf(), and Impala::Core::Stream::RgbDataDst::WindowManage().

Referenced by mainVideo().

00066 {
00067     int done = 0;
00068     Array2dVec3UInt8* rotIm = 0;
00069     gTimer.Start();
00070     while (!done)
00071     {
00072         if (gDoRandom)
00073         {
00074             int maxFrame = (gSrc->LastFrame()/gGopSize)*gGopSize;
00075             int rFrame = rand()*maxFrame/RAND_MAX;
00076             gSrc->GotoFrame(rFrame);
00077         }
00078         else
00079         {
00080             gSrc->NextFrame(gStepSize);
00081         }
00082 
00083         if (! gSrc->DataPtr())
00084         {
00085             std::cout << "skipping empty frame" << std::endl;
00086             continue;
00087         }
00088         if (gRotateLeft || gRotateRight)
00089         {
00090             int degrees = (gRotateLeft) ? 90 : -90;
00091             Array2dVec3UInt8* wrap = new Array2dVec3UInt8(gSrc->FrameWidth(),
00092                                                           gSrc->FrameHeight(),
00093                                                           0, 0, gSrc->DataPtr(),
00094                                                           true);
00095             Rotate(rotIm, wrap, degrees, Core::Geometry::NEAREST, true, 0);
00096             gDst->NextFrame(rotIm->CPB());
00097             delete wrap;
00098         }
00099         else
00100         {
00101             gDst->NextFrame(gSrc->DataPtr());
00102         }
00103         gFramesDone++;
00104         if ((gVerbose > 0) && (gFramesDone % gVerbose == 0))
00105         {
00106             UpdateStatusBuf();
00107             std::cout << gStatusBuf << std::endl;
00108         }
00109 
00110         UpdateStatusBuf();
00111         done = gDst->WindowManage(done, gStatusBuf);
00112         if (gSrc->TheEnd())
00113         {
00114             if (gDoLoop)
00115             {
00116                 gSrc->Reset();
00117                 FpsReset();
00118             }
00119             else
00120             {
00121                 done = 1;
00122                 gDst->Close();
00123             }
00124         }
00125         if ((gNrFrames != -1) && (gFramesDone > gNrFrames))
00126         {
00127             done = 1;
00128             gDst->Close();
00129         }
00130     }
00131     if (rotIm)
00132         delete rotIm;
00133     return 0;
00134 }

Here is the call graph for this function:


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