pfTexLoad(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages
NAMEpfTexLoad - Create, modify, and apply a texture load. Several sources can
be loaded into a GL texture (pfTexture).
FUNCTION SPECIFICATION
#include <Performer/pr/pfTexLoad.h>
pfTexLoad::pfTexLoad();
static pfType * pfTexLoad::getClassType();
void pfTexLoad::setSrcOrg(int s, int t, int r);
void pfTexLoad::getSrcOrg(int *s, int *t, int *r);
void pfTexLoad::setDstOrg(int s, int t, int r);
void pfTexLoad::getDstOrg(int *s, int *t, int *r);
void pfTexLoad::setSrc(void *src);
void * pfTexLoad::getSrc(void);
void pfTexLoad::setSrcLevel(int lvl);
int pfTexLoad::getSrcLevel(void);
void pfTexLoad::setDst(void *tex);
void * pfTexLoad::getDst(void);
void pfTexLoad::setDstLevel(int lvl);
int pfTexLoad::getDstLevel(void);
void pfTexLoad::setSize(int w, int h, int d);
void pfTexLoad::getSize(int *w, int *h, int *d);
void pfTexLoad::setFrame(int frameCount);
int pfTexLoad::getFrame(void);
int pfTexLoad::getPrevLoadedTexels(void);
int pfTexLoad::getDirty(void);
int pfTexLoad::setDirty(int dirtmask);
int pfTexLoad::getStatus(void);
Page 1
pfTexLoad(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages
void pfTexLoad::setAttr(int attr, void *val);
void * pfTexLoad::getAttr(int attr);
void pfTexLoad::setMode(int mode, int val);
int pfTexLoad::getMode(int mode);
void pfTexLoad::setVal(int which, float val);
float pfTexLoad::getVal(int which);
int pfTexLoad::apply();
int pfTexLoad::apply(int texels);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfTexLoad is derived from the parent class
pfObject, so each of these member functions of class pfObject are also
directly usable with objects of class pfTexLoad. This is also true for
ancestor classes of class pfObject.
void* pfObject::operator new(size_t);
void* pfObject::operator new(size_t, void *arena);
void* pfObject::operator new(size_t, pfFluxMemory *fmem);
void pfObject::setUserData(void *data);
void pfObject::setUserData(int slot, void *data);
void* pfObject::getUserData(pfObject *obj);
void* pfObject::getUserData(pfObject *obj, int slot);
int pfObject::getNumUserData();
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfTexLoad can also be used with these
functions designed for objects of class pfMemory.
void* pfMemory::getData(const void *ptr);
pfType * pfMemory::getType();
int pfMemory::isOfType(pfType *type);
int pfMemory::isExactType(pfType *type);
const char * pfMemory::getTypeName();
int pfMemory::copy(pfMemory *src);
int pfMemory::compare(const pfMemory *mem);
void pfMemory::print(uint which, uint verbose, char *prefix,
FILE *file);
int pfMemory::getArena(void *ptr);
void* pfMemory::getArena();
int pfMemory::ref();
int pfMemory::unref();
int pfMemory::unrefDelete();
Page 2
pfTexLoad(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages
int pfMemory::unrefGetRef();
int pfMemory::getRef();
int pfMemory::checkDelete();
int pfMemory::isFluxed();
void * pfMemory::getArena();
int pfMemory::getSize();
DESCRIPTIONpfTexLoad is used to control the mapping from texture images external to
the GL to texture images currently loaded into the GL. Each pfTexLoad
defines a load of a certain size from the origin of one of several
sources to a origin in a destination pfTexture which corresponds to a GL
texture. The functionality of this structure is to provide robust
support for glTexImage2D and glTexSubImage2DEXT.
new(arena) allocates a pfTexLoad from the specified memory arena, or from
the process heap if arena is NULL. new allocates a pfTexLoad from the
default memory arena (see pfGetSharedArena). Like other pfObjects,
pfTexLoads cannot be created statically, automatically on the stack or in
arrays and should be deleted with pfDelete rather than the delete
operator.
pfTexLoad::getClassType returns the pfType* for the class pfTexLoad. The
pfType* returned by pfTexLoad::getClassType is the same as the pfType*
returned by invoking the virtual function getType on any instance of
class pfTexLoad. When decisions are made based on the type of an object,
it is usually better to us the member function isOfType to test if an
object is of a type derived from a Performer type rather than to test for
strict equality of the pfType's.
The pfTexLoad::setMode and pfTexLoad::getMode routines set and get the
modes of operation for a pfTexLoad. Current modes include:
PFTLOAD_SOURCE
PFTLOAD_DEST
PFTLOAD_SYNC
PFTLOAD_SYNC_SOURCE
PFTLOAD_AUTOREF
PFTLOAD_SOURCE defines the nature of the source of imagery for the
texture download. The only currently supported value is:
PFTLOAD_SOURCE_IMAGETILE
but in future releases the following sources will be supported:
PFTLOAD_SOURCE_IMAGEARRAY
PFTLOAD_SOURCE_IMAGETILE
PFTLOAD_SOURCE_TEXTURE
PFTLOAD_SOURCE_VIDEO
PFTLOAD_SOURCE_FRAMEBUFFER
Page 3
pfTexLoad(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages
PFTLOAD_DEST currently only supports the PFTLOAD_DEST_TEXTURE as a
destination type.
PFTLOAD_SYNC defines when the pfTexLoad needs to take place. Currently
the only supported value for this mode is PFTLOAD_SYNC_IMMEDIATE -
meaning the download should take place immediately.
PFTLOAD_SYNC_SOURCE defines whether the load should require confirmation
of valid data from the source before loading. Possible values are PF_ON
and PF_OFF where a value of PF_ON means the load will only take place
after valid data is available from the load source. A value of PF_OFF
will cause the pfTexLoad to complete its download with whatever data is
available from the source regardless of its validity.
PFTLOAD_AUTOREF defines whether pfTexLoads should use pfUnref when they
get applied in pfDispList's. This mode allows users to keep track via a
reference count when the texture load actually took place. This in turn
facilitates reuse of pfTexLoad structures.
pfTexLoad::setAttr and pfTexLoad::getAttr set and get attributes of a
pfTexLoad.
PFTLOAD_SOURCE and PFTLOAD_DEST allow the user to specify the source and
destination for a pfTexLoad. These attributes are equivalent to making
respective calls to pfTLoadSrc and pfTLoadDst.
pfTexLoad::setVal allows the user to specify all of the values associated
with a pfTexLoad. This is redundant api allowing for the generic setting
of values that otherwise have individual explicit sets/gets associated
with them. Current value tokens:
PFTLOAD_SOURCE_LEVEL
PFTLOAD_SOURCE_S
PFTLOAD_SOURCE_T
PFTLOAD_SOURCE_T
PFTLOAD_SOURCE_R
PFTLOAD_DEST_LEVEL
PFTLOAD_DEST_S
PFTLOAD_DEST_T
PFTLOAD_DEST_R
PFTLOAD_WIDTH
PFTLOAD_HEIGHT
PFTLOAD_DEPTH
pfTexLoad::setSrc sets the source data for the pfTexLoad. Currently the
only supported source type for pfTexLoads is PFTLOAD_SOURCE_IMAGETILE and
therefore _src must point to a pfImageTile. pfTexLoad::getSrc returns
the pointer (if any) to the source data for the pfTexLoad.
pfTexLoad::setDst sets the destination texture for the pfTexLoad.
pfTexLoad::getDst returns a pointer to the pfTexture destination.
Page 4
pfTexLoad(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages
pfTexLoad::setDstLevel sets a specific mipmap level in the destination
pfTexture for this texture load. pfTexLoad::getDstLevel returns the
currently specified target mipmap level for the pfTexLoad.
pfTexLoad::setSrcLevel sets a specific level from which to get data from
the source object. This value will not be used until pfTexture's are
supported as source's for pfTexLoads. pfTexLoad::getSrcLevel will return
the current source level from which to retrieve load data if the source
type is PFTLOAD_SOURCE_TEXTURE.
pfTexLoad::setSize sets the size of the pfTexLoad. w*h*d texels will be
downloaded when the pfTexLoad is applied. pfTexLoad::getSize returns the
currently configured size of the pfTexLoad.
pfTexLoad::setSrcOrg sets the origin inside a larger image from which to
retrieve the imagery that should be downloaded. pfTexLoad::getSrcOrg
returns the origin of the download data within the possibly larger source
imagery.
pfTexLoad::setDstOrg sets the origin inside the destination pfTexture
where the pfTexLoad should place its rectangular download region.
The above routines could be used to easily configure a download of a
256x256x1 sub-region of a 2048x1024x1 source image into a specific tile
within a 512x512x1 texture. In the above example if a user wished to
download the top right-hand corner of the source imagery into the middle
of the destination 512x512x1 texture, pfTLoadSrc would be called with a
pfImageTile representing the 2048x1024x1 source data, pfTLoadDst would be
called with the appropriate 512x512x1 pfTexture, pfTLoadSize would be
called with parameters 256,256,1. pfTLoadSrcOrg would be called with a
value of 1792,768,0 and pfTLoadDstOrg would be called with a value of
128,128,0.
pfTexLoad::apply causes the preconfigured texture download to take place.
If there is a current pfDispList active then the pfTexLoad will place
itself into the pfDispList and the pfTexLoad apply which will perform the
download will happen when the pfDispList is drawn. Otherwise the texture
download will happen immediately.
pfTexLoad::apply(int nTexels) acts just like the normal apply except that
nTexels is used to describe a subset of texels to download in the current
apply. Note that the actual apply can only download on row boundaries
and so the actual downloaded number of texels may differ slightly from
that dictated by the user. Partial applies always start at the bottom,
lower left-hand corner of the image and count to the right and then up
where each row must be loaded before the next is started. For example in
the case of a 4x4 texture, a partial download of 4 texels will cause the
bottom row of the texture to be downloaded and not the bottom left 2x2
region. A subsequent call causing another partial download of 4 texels
would download the 2nd row, and so on.
Page 5
pfTexLoad(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages
SEE ALSO
pfTexture, pfImageTile, glTexImage2D, glTexSubImage2DEXT
Page 6