Definition at line 54 of file mainVdiff.cpp. References Impala::Visualization::ImagesWindow::AddImage(), Impala::Core::Array::ArraySystem::CheckMemoryUsageSinceMark(), Impala::Core::Stream::RgbDataSrc::DataPtr(), Impala::Core::Stream::RgbDataSrc::FrameHeight(), Impala::Core::Stream::RgbDataSrc::FrameWidth(), Impala::Visualization::AppControlSrc::GetSrc(), Impala::Visualization::AppControlSrc::GetSrc2(), Impala::Core::Array::ArraySystem::Instance(), Impala::Core::Array::ArraySystem::MarkMemoryUsage(), mDiffBuf, mDiffWnd, Impala::Core::Array::Pattern::PatBinaryPixOp(), Impala::Visualization::ImagesWindow::RemoveImages(), and Impala::Application::DemoCamera2d::verbose. Referenced by HandleNewFrame(). 00055 { 00056 if ((!GetSrc()->DataPtr() || !GetSrc2()->DataPtr()) || 00057 (GetSrc()->FrameWidth() != GetSrc2()->FrameWidth()) || 00058 (GetSrc()->FrameHeight() != GetSrc2()->FrameHeight())) 00059 { 00060 return; 00061 } 00062 00063 bool verbose = false; 00064 ArraySystem& aSys = ArraySystem::Instance(); 00065 aSys.MarkMemoryUsage(verbose); 00066 00067 Array2dVec3UInt8* wrap1 = ArrayCreate<Array2dVec3UInt8> 00068 (GetSrc()->FrameWidth(), GetSrc()->FrameHeight(), 0, 0, 00069 GetSrc()->DataPtr(), true); 00070 Array2dVec3UInt8* wrap2 = ArrayCreate<Array2dVec3UInt8> 00071 (GetSrc2()->FrameWidth(), GetSrc2()->FrameHeight(), 0, 0, 00072 GetSrc2()->DataPtr(), true); 00073 00074 double eps = 0.00001; 00075 Trait::BpoTestEqual 00076 <Array2dScalarReal64, Array2dVec3UInt8, Array2dVec3UInt8> bpo(eps); 00077 Array2dScalarReal64* res = 0; 00078 Pattern::PatBinaryPixOp(res, wrap1, wrap2, bpo); 00079 00080 mDiffBuf = ""; 00081 std::ostringstream diffStream; 00082 if (bpo.mNrDiff > 0) 00083 { 00084 diffStream << ", found " << bpo.mNrDiff << " differences, in " 00085 << bpo.mNr << " pixels, sum diffs : " << bpo.mSumDiff 00086 << " avg diff : " << bpo.mSumDiff / bpo.mNrDiff 00087 << " avg src1 : " << bpo.mSumSrc1 / bpo.mNr 00088 << " avg src2 : " << bpo.mSumSrc2 / bpo.mNr << std::ends; 00089 } 00090 else 00091 { 00092 diffStream << ", frames are equal" << std::ends; 00093 } 00094 mDiffBuf = diffStream.str(); 00095 00096 mDiffWnd->RemoveImages(); 00097 mDiffWnd->AddImage(res, "Stretch", "", false); 00098 00099 delete wrap1; 00100 delete wrap2; 00101 delete res; 00102 aSys.CheckMemoryUsageSinceMark(verbose); 00103 if (verbose) 00104 std::cout << std::endl; 00105 }
Here is the call graph for this function:
|