KrisLibrary
1.0.0
|
Allows for GL calls to draw to an image. More...
#include <GLRenderToImage.h>
Public Member Functions | |
bool | Setup (int w, int h) |
Call this first to see if render to image is supported. | |
void | Begin (const Camera::Viewport &vp) |
Call Begin before rendering. | |
void | Begin () |
Call Begin before rendering. | |
void | End () |
Call End after rendering. | |
void | GetRGBA (std::vector< unsigned int > &image) |
scan line order, top left to bottom right | |
void | GetRGBA (std::vector< unsigned char > &image) |
pixels in scan line order in RGBA format, top left to bottom right | |
void | GetRGBA (std::vector< std::vector< unsigned int > > &image) |
pixels in matrix order, top left to bottom right | |
void | GetRGBA (Image &image) |
converts to KrisLibrary Image in A8R8G8B8 format | |
void | GetRGB (std::vector< unsigned char > &image) |
pixels in scan line order in RGB format, top left to bottom right | |
void | GetRGB (Image &image) |
converts to KrisLibrary Image in R8G8B8 format | |
void | GetDepth (const Camera::Viewport &vp, std::vector< float > &image) |
scan line order, top left to bottom right | |
void | GetDepth (const Camera::Viewport &vp, std::vector< std::vector< float > > &image) |
pixels in matrix order, top left to bottom right | |
void | GetDepth (const Camera::Viewport &vp, Image &image) |
converts to KrisLibrary Image | |
void | GetZBuffer (std::vector< float > &image) |
this is the raw value in the z buffer | |
Public Attributes | |
int | width |
int | height |
unsigned int | color_tex |
unsigned int | fb |
unsigned int | depth_rb |
Allows for GL calls to draw to an image.
Usage: glrender = GLRenderToImage(); if(!glrender.Setup(640,480)) error...
... do more setup of the viewport ... Viewport vp; ... set up the viewport ... glrender.Begin(vp) ... do openGL calls ... glrender.End(); Image image; glrender.GetRGBA(image); ... now image has the rendered image data.