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

UInt8* Impala::Core::Stream::DummyFrameProvider::GetDataPtr ( int  width,
int  height 
) [inline, private]

Definition at line 53 of file DummyFrameProvider.h.

References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Add(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get2(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get3(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::mData, mDummyFrames, Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::SetValue(), and Impala::Core::Table::Table::Size().

Referenced by DataPtr().

00054     {
00055         for (int idx = 0 ; idx < mDummyFrames.Size(); idx++)
00056         {
00057             if (mDummyFrames.Get1(idx) == width &&
00058                 mDummyFrames.Get2(idx) == height)
00059             {
00060                 Array::Array2dVec3UInt8* image = mDummyFrames.Get3(idx);
00061                 return image->mData;
00062             }
00063         }
00064 
00065         Array::Array2dVec3UInt8* image = 
00066             new Array::Array2dVec3UInt8(width, height, 0, 0);
00067         const Array::Element::Vec3Int32 black(0, 0, 0);
00068         for (int x = 0; x < width; x++)
00069             for (int y = 0; y < height; y++)
00070                 image->SetValue(black, x, y);
00071         int halfTheWidth = (width + 1) / 2;
00072 
00073         // make the dummy frame visually distinct from real black frames
00074         // draw a cross
00075         const Array::Element::Vec3Int32 contrastColor(255, 255, 0);
00076         double y1 = 0;
00077         double y2 = 0.5;
00078         double yDelta = (height - 1.0) / (width - 1.0);
00079         for (int x = 0; x < halfTheWidth; x++)
00080         {
00081             image->SetValue(contrastColor, x, (int) y1);
00082             image->SetValue(contrastColor, x, (int) y2);
00083 
00084             image->SetValue(contrastColor, x, height - 1 - (int) y1);
00085             image->SetValue(contrastColor, x, height - 1 - (int) y2);
00086 
00087             image->SetValue(contrastColor, width - 1 - x, (int) y1);
00088             image->SetValue(contrastColor, width - 1 - x, (int) y2);
00089 
00090             image->SetValue(contrastColor, width - 1 - x, height - 1 - (int) y1);
00091             image->SetValue(contrastColor, width - 1 - x, height - 1 - (int) y2);
00092 
00093             y1 += yDelta;
00094             y2 += yDelta;
00095         }
00096         mDummyFrames.Add(width, height, image);
00097         return image->mData;
00098     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:20:25 2011 for ImpalaSrc by  doxygen 1.5.1