Brad Ennis (brenn++at++mcopn1.dseg.ti.com)
Mon, 3 Oct 94 10:39:58 PDT
#include <Performer/pf.h>
#include <stdlib.h>
#include "math.h"
#define MAX_NOISE 0.0
void drawSARChan( pfChannel* chan )
{
/* Declare local variables. */
void *arena;
static long channel_orgin_x, channel_orgin_y;
static long sizex, sizey;
static long pipe_origin_x, pipe_origin_y;
static short screen_bottom_left_x, screen_bottom_left_y;
static short screen_top_right_x, screen_top_right_y;
static float horiz, vert;
static float near, far;
static int first_pass = FALSE;
static unsigned long *inbuff,*outbuff, *zbuff;
/* Get pipe and channel information. */
pfGetPipeOrigin(pfGetChanPipe(chan), &pipe_origin_x, &pipe_origin_y);
pfGetChanOrigin(chan, &channel_orgin_x, &channel_orgin_y);
pfGetChanSize(chan, &sizex, &sizey);
pfGetChanFOV(chan, &horiz, &vert);
pfGetChanNearFar(chan, &near, &far);
/* Set screen positon. */
screen_bottom_left_x = pipe_origin_x + channel_orgin_x;
screen_bottom_left_y = pipe_origin_y + channel_orgin_y;
screen_top_right_x = screen_bottom_left_x + sizex - 1;
screen_top_right_y = screen_bottom_left_y + sizey - 1;
/* First pass logic, initialization. */
if (first_pass == FALSE)
{
first_pass = TRUE;
/* Get pointer to shared memory calloc arena created by pfInit()*/
arena = pfGetSharedArena();
/*
* Calloc structures now.
*/
inbuff = (unsigned long *)pfCalloc(sizex * sizey, sizeof(unsigned long),
arena);
outbuff= (unsigned long *)pfCalloc(sizex * sizey, sizeof(unsigned long),
arena);
zbuff = (unsigned long *)pfCalloc(sizex * sizey, sizeof(unsigned long),
arena);
if (inbuff == NULL || outbuff == NULL || zbuff == NULL)
{
fprintf(stderr," inbuff %ld outbuff %ld zbuff %ld\n",
inbuff, outbuff, zbuff);
exit(1);
}
}
/* Read the Z-buffer x,y image data into zbuff. */
zbuffer(TRUE);
zfunction(ZF_ALWAYS);
readsource(SRC_ZBUFFER);
lrectread(screen_bottom_left_x, screen_bottom_left_y,
screen_top_right_x, screen_top_right_y, zbuff);
Thanks,
Brad
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:34 PDT