MCPcopy Create free account
hub / github.com/Kitware/VTK / SetPixelData

Method SetPixelData

Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx:1974–2013  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1972
1973//------------------------------------------------------------------------------
1974int vtkOpenGLRenderWindow::SetPixelData(
1975 int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right)
1976{
1977 int y_low, y_hi;
1978 int x_low, x_hi;
1979
1980 if (y1 < y2)
1981 {
1982
1983 y_low = y1;
1984 y_hi = y2;
1985 }
1986 else
1987 {
1988 y_low = y2;
1989 y_hi = y1;
1990 }
1991
1992 if (x1 < x2)
1993 {
1994 x_low = x1;
1995 x_hi = x2;
1996 }
1997 else
1998 {
1999 x_low = x2;
2000 x_hi = x1;
2001 }
2002
2003 int width = abs(x_hi - x_low) + 1;
2004 int height = abs(y_hi - y_low) + 1;
2005 int size = 3 * width * height;
2006
2007 if (data->GetMaxId() + 1 != size)
2008 {
2009 vtkErrorMacro("Buffer is of wrong size.");
2010 return VTK_ERROR;
2011 }
2012 return this->SetPixelData(x1, y1, x2, y2, data->GetPointer(0), front, right);
2013}
2014
2015//------------------------------------------------------------------------------
2016// draw (and stretch as needed) the data to the current viewport

Callers

nothing calls this directly

Calls 9

DrawPixelsMethod · 0.95
ActivateDrawBufferMethod · 0.80
absFunction · 0.50
GetPointerMethod · 0.45
MakeCurrentMethod · 0.45
GetStateMethod · 0.45
BindMethod · 0.45

Tested by

no test coverage detected