rpc(3pf) OpenGL Performer 3.2.2 libpfdb Reference Pages rpc(3pf)NAME
pfdLoadFile_rpc, pfdConverterMode_rpc, pfdGetConverterMode_rpc,
pfdConverterVal_rpc, pfdGetConverterVal_rpc, pfdConverterAttr_rpc,
pfdGetConverterAttr_rpc - Utilities for loading ArchVision's rpc files in
Performer applications.
FUNCTION SPECIFICATION
#include <Performer/pfdb/pfrpc.h>
pfNode* pfdLoadFile_rpc(const char *fileName);
void pfdConverterMode_rpc(int mode, int value);
int pfdGetConverterMode_rpc(int mode);
void pfdConverterVal_rpc(int which, float value);
float pfdGetConverterVal_rpc(int which);
void pfdConverterAttr_rpc(int which, void *attr);
void* pfdGetConverterAttr_rpc(int which);
DESCRIPTION
pfdLoadFile_rpc loads in images from an ArchVision's rpc file. If no
path to the file is given, the directories in the active Performer file
search path (see pfFilePath) are scanned for the given filename. The
images represent views of an object from a set of directions around the
object. If user provides an existing pfIBRnode the images are loaded into
a pfIBRtextue of the node. Otherwise, the function creates a new
pfIBRnode with a single pfGeoSet and a pfIBRtexture containing the
images. In the case of the new content with meshes, the pfGeoSet contains
the mesh, which becomes the proxy in the pfIBRnode. pfdLoadFile_rpc may
only be called after pfConfig.
pfdConverterMode_rpc, pfdGetConverterMode_rpc, pfdConverterVal_rpc,
pfdGetConverterVal_rpc pfdConverterAttr_rpc, and pfdGetConverterAttr_rpc
allow the user to access and alter the modes, values, and attributes of
the rpc loader.
The rpc converter modes are:
PFRPC_USE_USER_IBRNODE
By default the loader creates a pfIBRnode with a single
pfGeoSet and a pfIBRtexture that contains the loaded images. If
this mode is set to PF_ON and the user supplies a pfIBRnode
using pfdConverterAttr_rpc the images are loaded into the
pfIBRtexture of that node.
The rpc converter values are:
Page 1
rpc(3pf) OpenGL Performer 3.2.2 libpfdb Reference Pages rpc(3pf)
PFRPC_SKIP_TEXTURES
ArchVision's rpc files often contain hundreds of images. A
pfIBRtexture containing so many images would be too large. This
parameter allows the user to skip every n images. The default
is set to 2. If you want to use all images in the file set it
to 0.
PFRPC_CROP_LEFT
Crops the loaded images by the specified number of pixels on
the left.
PFRPC_CROP_RIGHT
Crops the loaded images by the specified number of pixels on
the right. Please note that the resulting image width should
be a power of 2.
PFRPC_CROP_TOP
Crops the loaded images by the specified number of pixels on
the top.
PFRPC_CROP_BOTTOM
Crops the loaded images by the specified number of pixels on
the bottom. Please note that the resulting image height should
be a power of 2.
PFRPC_SCALE_WIDTH
Scales the billboard width in case of pfIBRnode without proxy.
PFRPC_SCALE_HEIGHT
Scales the billboard height in case of pfIBRnode without proxy.
PFRPC_NEAREST
Sets flag PFIBR_NEAREST on the pfIBRnode created by the loader.
PFRPC_USE_NEAREST_RING
In case of content with proxy and having more than one ring of
views this flag will force mode, in which views are selected
from the nearest ring, not blended between two nearest rings.
PFRPC_COMBINED_TEXTURE_SIZE
If this value is set textures are combined into a square
texture of the given size (should be a power of 2). By default,
if the texture size is not a power of two textures are combined
into a texture of size 2048x2048. If the texture size is power
of two textures are not combined into a bigger texture unless
the value PFRPC_COMBINED_TEXTURE_SIZE is explicitly specified.
You can also set it to 0 to disable combining.
The rpc converter attributes are:
Page 2
rpc(3pf) OpenGL Performer 3.2.2 libpfdb Reference Pages rpc(3pf)
PFRPC_USER_IBRNODE
Allows the user to specify a pfIBRnode. The images from the rpc
file are loaded into the pfIBRtexture of the node.
PFRPC_RING_FILE
Allows the user to specify path to ring files that define the
rings of views in case of content with proxy. There is one file
for each component of the input rpc file, indexed by extension
.0, .1, .2, etc. Each line of the ring file contains the angle
of the ring from the horizon and the number of views in that
ring. If no ring file is specified, by default each component
has only one ring of 16 views at horizontal angle 0.
The value of PFRPC_SKIP_TEXTURES, PFRPC_SCALE_WIDTH, PFRPC_FLIP_TEXTURES,
PFRPC_NEAREST, PFRPC_USE_NEAREST_RING, PFRPC_COMBINED_TEXTURE_SIZE, and
PFRPC_RING_FILE can be also set using an environment variable of the same
name (PFRPC_SKIP_TEXTURES etc.). Thus it is possible to affect the
loading of the files without necessity of changing your application.
Two sample rpc files can be found in directory
/usr/share/Performer/data/rpc. You can download other files from
Archvision's web page at www.archvision.com.
NOTES
The loader is using a relatively slow third-party routine for
decompressing images. For fast load time you may want to convert your rpc
files into pfb files using pfconv.
The libpfdb source code, object code and documentation are provided as
unsupported software. Routines are subject to change in future releases.
SEE ALSOpfdLoadFile(3pf), pfIBRnode(3pf), pfIBRtexture(3pf), rpc(5pf)
Page 3