*vgl_DataBufBegin - create an instance of a DataBuf object vgl_DataBufEnd - destroy an instance of a DataBuf object vgl_DataBufError - return DataBuf object error flag
vgl_DataBufDrawFun - fill DrawFun object vgl_DataBufGetData - get floating point frame buffer contents vgl_DataBufGetDataIndex - get integer frame buffer contents vgl_DataBufSetBuffers - set frame buffer configuration vgl_DataBufSetObject - set attribute objects vgl_DataBufSetRender - set standard graphics primitive sensitivity vgl_DataBufSetResolution - set memory frame buffer resolution vgl_DataBufLinePixels - return line pixels vgl_DataBufTriPixels - return triangle pixels
The current Data and DataIndex attributes are rendered as constant values over any standard (non "data") graphics primitive. The user may enable or disable the rendering sensitivity of DataBuf to standard primitives using vgl_DataBufSetRender.
The type and number of software frame buffers used by the DataBuf module is configurable using vgl_DataBufSetBuffers. The module has been designed to simultaneously render the current DataIndex attributes to one or more integer frame buffers and the current floating point Data attribute to one or more floating point frame buffers. The Data attribute may be Gouraud shaded over points, lines and polygons using the PolyPointData, PolyLineData and PolygonData drawing functions as well as the PolyPointArray, PolyLineArray and PolygonArray and PolyPointBuffer, PolyLineBuffer and PolygonBuffer drawing functions. The current DataIndex values are rendered over any data primitive if one or more integer data buffers are enabled. The functions vgl_DataBufGetData and vgl_DataBufGetDataIndex are provided to quickly query the contents of the integer and floating point frame buffers at any pixel.
Note that if the DataBuf drawing functions PolyPointBuffer, PolyLineBuffer and PolygonBuffer are used then the primitive data is stored in graphics memory in a hardware graphics interface such as OpenGLDev. In this case the drawing functions to the hardware interface which has been used to store the graphics primitives in graphics memory (for example, Vertex Buffer Objects in OpenGL) must be registered using the vgl_DataBufSetObject function.
Use the helper functions vgl_DataBufLinePixels and vgl_DataBufTriPixels to return the pixels along a line or within a triangle.
Note that transparency is implemented using a polygon stipple, also known as "screen door" transparency. This means that, for example, if a 50 percent transparent polygon is drawn, only every other pixel with the polygon will be affected.
*vgl_DataBufBegin - create an instance of a DataBuf object
vgl_DataBuf *vgl_DataBufBegin ()
None
Destroy an instance of a DataBuf object using
void vgl_DataBufEnd (vgl_DataBuf *databuf)
Return the current value of a DataBuf object error flag using
Vint vgl_DataBufError (vgl_DataBuf *databuf)
vgl_DataBufDrawFun - return pointers to drawing functions
void vgl_DataBufDrawFun (vgl_DataBuf *databuf, vgl_DrawFun *drawfun)
databuf Pointer to DataBuf object. drawfun Pointer to DrawFun object to be filled with drawing functions.
None
vgl_DataBufGetData,vgl_DataBufGetDataIndex - get data and dataindex values
void vgl_DataBufGetData (vgl_DataBuf *databuf, Vint ix, Vint iy, Vint *nrws, Vfloat *d) void vgl_DataBufGetDataIndex (vgl_DataBuf *databuf, Vint ix, Vint iy, Vint *indices)
databuf Pointer to DataBuf object. ix Horizontal device coordinate of data pixel iy Vertical device coordinate of data pixel
nrws Number of floating point values returned d Vector of data values indices Data indices
vgl_DataBufSetBuffers - set data frame buffer configuration
void vgl_DataBufSetBuffers (vgl_DataBuf *databuf, Vint indexflag, Vint dataflag)
databuf Pointer to DataBuf object. indexflag Specify number of integer data index frame buffers dataflag Specify number of floating point data frame buffers
None
vgl_DataBufSetObject - set attribute object
void vgl_DataBufSetObject (vgl_DataBuf *databuf, Vint objecttype, Vobject *object)
databuf Pointer to DataBuf object. objecttype The name of the object type to be set. =VGL_DRAWFUN DrawFun object object Pointer to the object to be set.
None
vgl_DataBufSetRender - set sensitivity to standard primitives.
void vgl_DataBufSetRender (vgl_DataBuf *databuf, Vint pointflag, Vint lineflag, Vint polyflag)
databuf Pointer to DataBuf object. pointflag Specify standard point primitives to be rendered. =VGL_OFF Turn off point primitives =VGL_ON Turn on point primitives lineflag Specify standard line primitives to be rendered. =VGL_OFF Turn off line primitives =VGL_ON Turn on line primitives polyflag Specify standard polygon primitives to be rendered. =VGL_OFF Turn off polygon primitives =VGL_ON Turn on polygon primitives
None
vgl_DataBufSetResolution - set pixels per centimeter resolution
void vgl_DataBufSetResolution (vgl_DataBuf *databuf, Vfloat xres, Vfloat yres)
databuf Pointer to DataBuf object. xres Pixels per centimeter in horizontal direction yres Pixels per centimeter in vertical direction
None
vgl_DataBufLinePixels - return line pixels
void vgl_DataBufLinePixels (vgl_DataBuf *databuf, Vint ixy1[2], Vint ixy2[2], Vint *npix, Vint pix[][2])
databuf Pointer to DataBuf object. ixy1 Pixel coordinate of first line endpoint ixy2 Pixel coordinate of second line endpoint
npix Number of pixels returned pix Pixel coordinates from first to second endpoint
vgl_DataBufTriPixels - return triangle pixels
void vgl_DataBufTriPixels (vgl_DataBuf *databuf, Vint ixy1[2], Vint ixy2[2], Vint ixy3[2], Vint *npix, Vint pix[][2])
databuf Pointer to DataBuf object. ixy1 Pixel coordinate of first tri corner ixy2 Pixel coordinate of second tri corner ixy3 Pixel coordinate of third tri corner
npix Number of pixels returned pix Pixel coordinates from left to right, bottom to top.
*vgl_RendBufBegin - create an instance of a RendBuf object vgl_RendBufEnd - destroy an instance of a RendBuf object vgl_RendBufError - return RendBuf object error flag
vgl_RendBufDrawFun - fill DrawFun object vgl_RendBufGetFBuffer - get internal frame buffer object vgl_RendBufGetZBuffer - get internal z-buffer object vgl_RendBufSetObject - set attribute objects vgl_RendBufSetResolution - set memory frame buffer resolution
Note that if the RendBuf drawing functions PolyPointBuffer, PolyLineBuffer and PolygonBuffer are used then the primitive data is stored in graphics memory in a hardware graphics interface such as OpenGLDev. In this case the drawing functions to the hardware interface which has been used to store the graphics primitives in graphics memory (for example, Vertex Buffer Objects in OpenGL) must be registered using the vgl_RendBufSetObject function.
Once rendering is complete use vgl_RendBufGetFBuffer and vgl_RendBufGetZBuffer to return the color buffer, FBuffer and/or z-buffer, ZBuffer objects created by the software renderer. Standard FBuffer and ZBuffer functions may be used to write the image to a file, draw it with a *Dev module, etc.
*vgl_RendBufBegin - create an instance of a RendBuf object
vgl_RendBuf *vgl_RendBufBegin ()
None
Destroy an instance of a RendBuf object using
void vgl_RendBufEnd (vgl_RendBuf *rendbuf)
Return the current value of a RendBuf object error flag using
Vint vgl_RendBufError (vgl_RendBuf *rendbuf)
vgl_RendBufDrawFun - return pointers to drawing functions
void vgl_RendBufDrawFun (vgl_RendBuf *rendbuf, vgl_DrawFun *drawfun)
rendbuf Pointer to RendBuf object. drawfun Pointer to DrawFun object to be filled with drawing functions.
None
vgl_RendBufGetFBuffer,vgl_RendBufGetZBuffer - get internal buffers
void vgl_RendBufGetFBuffer (vgl_RendBuf *rendbuf, vgl_FBuffer **fbuffer) void vgl_RendBufGetZBuffer (vgl_RendBuf *rendbuf, vgl_ZBuffer **zbuffer)
rendbuf Pointer to RendBuf object.
fbuffer Pointer to internal FBuffer object zbuffer Pointer to internal ZBuffer object
vgl_RendBufSetObject - set attribute object
void vgl_RendBufSetObject (vgl_RendBuf *databuf, Vint objecttype, Vobject *object)
rendbuf Pointer to RendBuf object. objecttype The name of the object type to be set. =VGL_DRAWFUN DrawFun object object Pointer to the object to be set.
None
vgl_RendBufSetResolution - set pixels per centimeter resolution
void vgl_RendBufSetResolution (vgl_RendBuf *rendbuf, Vfloat xres, Vfloat yres)
rendbuf Pointer to RendBuf object. xres Pixels per centimeter in horizontal direction yres Pixels per centimeter in vertical direction
None