------------------------------------------------------------------------------
| 2329 | |
| 2330 | //------------------------------------------------------------------------------ |
| 2331 | unsigned char* vtkOpenGLRenderWindow::GetRGBACharPixelData( |
| 2332 | int x1, int y1, int x2, int y2, int front, int right) |
| 2333 | { |
| 2334 | int y_low, y_hi; |
| 2335 | int x_low, x_hi; |
| 2336 | int width, height; |
| 2337 | |
| 2338 | if (y1 < y2) |
| 2339 | { |
| 2340 | y_low = y1; |
| 2341 | y_hi = y2; |
| 2342 | } |
| 2343 | else |
| 2344 | { |
| 2345 | y_low = y2; |
| 2346 | y_hi = y1; |
| 2347 | } |
| 2348 | |
| 2349 | if (x1 < x2) |
| 2350 | { |
| 2351 | x_low = x1; |
| 2352 | x_hi = x2; |
| 2353 | } |
| 2354 | else |
| 2355 | { |
| 2356 | x_low = x2; |
| 2357 | x_hi = x1; |
| 2358 | } |
| 2359 | |
| 2360 | width = abs(x_hi - x_low) + 1; |
| 2361 | height = abs(y_hi - y_low) + 1; |
| 2362 | |
| 2363 | unsigned char* ucdata = new unsigned char[(width * height) * 4]; |
| 2364 | vtkRecti rect(x_low, y_low, width, height); |
| 2365 | this->ReadPixels(rect, front, GL_RGBA, GL_UNSIGNED_BYTE, ucdata, right); |
| 2366 | return ucdata; |
| 2367 | } |
| 2368 | |
| 2369 | //------------------------------------------------------------------------------ |
| 2370 | int vtkOpenGLRenderWindow::GetRGBACharPixelData( |