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

void Impala::Application::Client::ExampleReadRaw ( Util::Channel *  chanP  ) 

Definition at line 40 of file mainDataClient.cpp.

References Impala::Util::Channel::Buffer(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CH(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CW(), Impala::Core::Array::GaussDerivative(), Impala::CmdOptions::GetArg(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetNrArg(), Impala::Core::Array::GetRgbPixels(), gNrIter, ILOG_DEBUG, ILOG_VAR, Impala::Util::ReadIOBufferFromChannel(), Impala::Core::Array::ReadRaw(), Impala::Core::Array::RGB2Intensity(), Impala::Util::Channel::SendRequest(), Impala::Core::Array::Set(), and Impala::Application::DemoCamera2d::sigma.

Referenced by mainClient().

00041 {
00042     ILOG_VAR(Impala.Application.Client.ExampleReadRaw);
00043     CmdOptions& options = CmdOptions::GetInstance();
00044 
00045     Util::Channel& chan = *chanP;
00046     char* buf = chan.Buffer();
00047     int len;
00048 
00049     // ask server to read a raw image
00050     ILOG_DEBUG("requesting readraw");
00051     String fileName = "trui.raw";
00052     if (options.GetNrArg() > 2)
00053         fileName = options.GetArg(2);
00054     Array2dVec3UInt8* src = 0;
00055     Util::IOBuffer* ioBuf = ReadIOBufferFromChannel(chanP, fileName, "");
00056     ReadRaw(src, ioBuf);
00057     delete ioBuf;
00058     Array2dVec3Real64* srcV3R64 = 0;
00059     Set(srcV3R64, src);
00060 
00061     // do some processing
00062     Array2dScalarReal64* srcSR64 = 0;
00063     RGB2Intensity(srcSR64, srcV3R64);
00064 
00065     // ask server to open a ImageDataDst
00066     ILOG_DEBUG("requesting opendst");
00067     int width = src->CW();
00068     int height = src->CH();
00069     sprintf(buf, "opendst %d %d\0", width, height);
00070     len = chan.SendRequest(strlen(buf)+1);
00071 
00072     // prepare display data and ask server to show it
00073     ILOG_DEBUG("requesting show");
00074     sprintf(buf, "show\0");
00075     GetRgbPixels(srcSR64, (UInt8*)(buf + 5), "Stretch");
00076     len = chan.SendRequest(width*height*3 + 5);
00077 
00078     // do some more processing and ask server to show result
00079     for (int j=1 ; j<gNrIter ; j++)
00080     {
00081         for (int i=1 ; i<10 ; i++)
00082         {
00083             double sigma = 0.5 * i;
00084             Array2dScalarReal64* res = 0;
00085             GaussDerivative(res, srcSR64, sigma, 0, 0, 3.0);
00086             ILOG_DEBUG("requesting show " << i);
00087             sprintf(buf, "show\0");
00088             GetRgbPixels(res, (UInt8*)(buf + 5), "Stretch");
00089             len = chan.SendRequest(width*height*3 + 5);
00090         }
00091     }
00092 }

Here is the call graph for this function:


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