man SoOffscreenRenderer () - renders to an off-screen buffer for printing or generating textures

NAME

SoOffscreenRenderer - renders to an off-screen buffer for printing or generating textures

INHERITS FROM

SoOffscreenRenderer

SYNOPSIS

#include <Inventor/SoOffscreenRenderer.h> enum Components { c } c }



c } c }



c } c }



c } c }



} Methods from class SoOffscreenRenderer: c } c } SoOffscreenRenderer(const SbViewportRegion &viewportRegion)

c } c } SoOffscreenRenderer(SoGLRenderAction *ra)

c } c } ~SoOffscreenRenderer()

c } c } getScreenPixelsPerInch()

c } c } getMaximumResolution()

c } c } setComponents(Components components)

c } c } getComponents() const

c } c } setViewportRegion(const SbViewportRegion &region)

c } c } getViewportRegion() const

c } c } setBackgroundColor(const SbColor &c)

c } c } getBackgroundColor() const

c } c } setGLRenderAction(const SoGLRenderAction *ra)

c } c } getGLRenderAction() const

c } c } render(SoNode *scene)

c } c } render(SoPath *scene)

c } c } getBuffer() const

c } c } writeToRGB(FILE *fp) const

c } c } writeToPostScript(FILE *fp) const

c } c } writeToPostScript(FILE *fp, const SbVec2f &printSize) const

DESCRIPTION

This class is used to render into an off-screen buffer to create a printable image or to generate a texture image. It uses X Pixmaps for rendering. Methods are provided to write the buffer to a file, either as an RGB image or an encapsulated PostScript description.

METHODS

c } c } SoOffscreenRenderer(const SbViewportRegion &viewportRegion)

c } c } SoOffscreenRenderer(SoGLRenderAction *ra)

c } c } ~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. c } c } getScreenPixelsPerInch()

Returns the number of pixels per inch (in the horizontal direction) of the current X device screen. c } c } getMaximumResolution()

Get the maximum supported resolution of the viewport. c } c } setComponents(Components components)

c } c } getComponents() const

Sets or returns the components to be rendered. c } c } setViewportRegion(const SbViewportRegion &region)

c } c } 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. c } c } setBackgroundColor(const SbColor &c)

c } c } getBackgroundColor() const

Sets or returns the background color for rendering. c } c } setGLRenderAction(const SoGLRenderAction *ra)

c } c } getGLRenderAction() const

Set and get the render action to use for rendering. This will return any render action passed in by the caller. c } c } render(SoNode *scene)

c } c } render(SoPath *scene)

Renders the given scene, specified as a node or a path, into an off-screen buffer. c } c } 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. c } c } writeToRGB(FILE *fp) const

Writes the buffer as a .rgb file to the given file pointer. c } c } writeToPostScript(FILE *fp) const

c } c } writeToPostScript(FILE *fp, const SbVec2f &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.