'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SoOffscreenRenderer(3IV) .SH NAME SoOffscreenRenderer \(em renders to an off-screen buffer for printing or generating textures .SH INHERITS FROM SoOffscreenRenderer .SH SYNOPSIS .ps -1 \*(Cr#include .sp .in 0.5i \*(Crenum \*(CbComponents\*(Cr { .in 1i .ta 26m .in 1.5i+26n .ti 1i .ta 26m .ds Pt \*(CbSoOffscreenRenderer::LUMINANCE\f1 .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 1i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} .br .in 1.5i+26n .ti 1i .ta 26m .ds Pt \*(CbSoOffscreenRenderer::LUMINANCE_TRANSPARENCY\f1 .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 1i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} .br .in 1.5i+26n .ti 1i .ta 26m .ds Pt \*(CbSoOffscreenRenderer::RGB\f1 .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 1i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} .br .in 1.5i+26n .ti 1i .ta 26m .ds Pt \*(CbSoOffscreenRenderer::RGB_TRANSPARENCY\f1 .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 1i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} .br .in 0.5i \*(Cr} .sp .in 1i \f1Methods from class SoOffscreenRenderer: .in 0.5i .sp .ta 26m .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Cr .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoOffscreenRenderer\*(Cr(const SbViewportRegion &viewportRegion) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Cr .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoOffscreenRenderer\*(Cr(SoGLRenderAction *ra) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Cr .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cb~SoOffscreenRenderer\*(Cr() .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crstatic float .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetScreenPixelsPerInch\*(Cr() .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crstatic SbVec2s .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetMaximumResolution\*(Cr() .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetComponents\*(Cr(Components components) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrComponents .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetComponents\*(Cr() const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetViewportRegion\*(Cr(const SbViewportRegion ®ion) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crconst SbViewportRegion & .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetViewportRegion\*(Cr() const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetBackgroundColor\*(Cr(const SbColor &c) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crconst SbColor & .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetBackgroundColor\*(Cr() const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetGLRenderAction\*(Cr(const SoGLRenderAction *ra) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSoGLRenderAction * .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetGLRenderAction\*(Cr() const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbrender\*(Cr(SoNode *scene) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbrender\*(Cr(SoPath *scene) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crunsigned char * .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetBuffer\*(Cr() const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbwriteToRGB\*(Cr(FILE *fp) const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbwriteToPostScript\*(Cr(FILE *fp) const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbwriteToPostScript\*(Cr(FILE *fp, const SbVec2f &printSize) const .sp .SH 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. .SH METHODS .ta 26m .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Cr .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoOffscreenRenderer\*(Cr(const SbViewportRegion &viewportRegion) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Cr .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoOffscreenRenderer\*(Cr(SoGLRenderAction *ra) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Cr .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cb~SoOffscreenRenderer\*(Cr() .br .in 1i \f1Constructors 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. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crstatic float .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetScreenPixelsPerInch\*(Cr() .br .in 1i \f1Returns the number of pixels per inch (in the horizontal direction) of the current X device screen. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crstatic SbVec2s .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetMaximumResolution\*(Cr() .br .in 1i \f1Get the maximum supported resolution of the viewport. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetComponents\*(Cr(Components components) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrComponents .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetComponents\*(Cr() const .br .in 1i \f1Sets or returns the components to be rendered. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetViewportRegion\*(Cr(const SbViewportRegion ®ion) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crconst SbViewportRegion & .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetViewportRegion\*(Cr() const .br .in 1i \f1Sets or returns the viewport region used for rendering. This will NOT be applied to the viewport region of any render action passed in. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetBackgroundColor\*(Cr(const SbColor &c) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crconst SbColor & .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetBackgroundColor\*(Cr() const .br .in 1i \f1Sets or returns the background color for rendering. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetGLRenderAction\*(Cr(const SoGLRenderAction *ra) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSoGLRenderAction * .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetGLRenderAction\*(Cr() const .br .in 1i \f1Set and get the render action to use for rendering. This will return any render action passed in by the caller. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbrender\*(Cr(SoNode *scene) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbrender\*(Cr(SoPath *scene) .br .in 1i \f1Renders the given scene, specified as a node or a path, into an off-screen buffer. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crunsigned char * .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetBuffer\*(Cr() const .br .in 1i \f1Returns 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. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbwriteToRGB\*(Cr(FILE *fp) const .br .in 1i \f1Writes the buffer as a .rgb file to the given file pointer. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbwriteToPostScript\*(Cr(FILE *fp) const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbwriteToPostScript\*(Cr(FILE *fp, const SbVec2f &printSize) const .br .in 1i \f1Writes 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. .sp .in 0.5i