SoOffscreenRenderer(constSbViewportRegion&viewportRegion)SoOffscreenRenderer(SoGLRenderAction*ra)~SoOffscreenRenderer()
Constructors and destructor. If a render action is passed to the contructor, that action will be used
in all subsequent offscreen renderings. Otherwise, an internal instance of an SoGLRenderAction will be
maintained with a viewport region set to the on passed in by the constructor.
staticfloatgetScreenPixelsPerInch()
Returns the number of pixels per inch (in the horizontal direction) of the current X device screen.
staticSbVec2sgetMaximumResolution()
Get the maximum supported resolution of the viewport.
voidsetComponents(Componentscomponents)ComponentsgetComponents()const
Sets or returns the components to be rendered.
voidsetViewportRegion(constSbViewportRegion®ion)constSbViewportRegion&getViewportRegion()const
Sets or returns the viewport region used for rendering. This will NOT be applied to the viewport
region of any render action passed in.
voidsetBackgroundColor(constSbColor&c)constSbColor&getBackgroundColor()const
Sets or returns the background color for rendering.
voidsetGLRenderAction(constSoGLRenderAction*ra)SoGLRenderAction*getGLRenderAction()const
Set and get the render action to use for rendering. This will return any render action passed in by
the caller.
SbBoolrender(SoNode*scene)SbBoolrender(SoPath*scene)
Renders the given scene, specified as a node or a path, into an off-screen buffer.
unsignedchar*getBuffer()const
Returns the buffer containing the rendered image. The buffer is an array of unsigned characters. Each
pixel is stored sequentially by scanline, starting with the lower left corner. The data stored for
each pixel is determined by the Components set before rendering. Pixels are stored in RGBA order and
are packed without any padding between pixels or scanlines. The buffer is allocated by the offscreen
renderer class and the space is deleted when the instance is destructed.
SbBoolwriteToRGB(FILE*fp)const
Writes the buffer as a .rgb file to the given file pointer.
SbBoolwriteToPostScript(FILE*fp)constSbBoolwriteToPostScript(FILE*fp,constSbVec2f&printSize)const
Writes the buffer as encapsulated PostScript. If a print size is not given, the size of the image in
the buffer is adjusted so it is the same as the apparent size of the viewport region on the current
device.
SoOffscreenRenderer(3IV)()