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

Method GetRGBAPixelData

Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx:2144–2180  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2142
2143//------------------------------------------------------------------------------
2144float* vtkOpenGLRenderWindow::GetRGBAPixelData(int x1, int y1, int x2, int y2, int front, int right)
2145{
2146
2147 int y_low, y_hi;
2148 int x_low, x_hi;
2149 int width, height;
2150
2151 if (y1 < y2)
2152 {
2153 y_low = y1;
2154 y_hi = y2;
2155 }
2156 else
2157 {
2158 y_low = y2;
2159 y_hi = y1;
2160 }
2161
2162 if (x1 < x2)
2163 {
2164 x_low = x1;
2165 x_hi = x2;
2166 }
2167 else
2168 {
2169 x_low = x2;
2170 x_hi = x1;
2171 }
2172
2173 width = abs(x_hi - x_low) + 1;
2174 height = abs(y_hi - y_low) + 1;
2175
2176 float* fdata = new float[(width * height * 4)];
2177 vtkRecti rect(x_low, y_low, width, height);
2178 this->ReadPixels(rect, front, GL_RGBA, GL_FLOAT, fdata, right);
2179 return fdata;
2180}
2181
2182//------------------------------------------------------------------------------
2183int vtkOpenGLRenderWindow::GetRGBAPixelData(

Callers

nothing calls this directly

Calls 5

ReadPixelsMethod · 0.95
absFunction · 0.50
SetNumberOfComponentsMethod · 0.45
SetNumberOfValuesMethod · 0.45
GetPointerMethod · 0.45

Tested by

no test coverage detected