XGL Test Suite User's Guide
  Search only this book
Download this book in PDF

Denizen Library Functions

4

This chapter describes the functions that are used by denizen programs. Some of these functions are verification functions that check for content accuracy in the frame buffer or memory raster. The remaining functions are utility functions needed by the test programs.

Relevant Denizen Data Types

typedef struct dmatrix {
    Xgl_data_type data_type;
    Xgl_trans_dimension dim;
    union {
        Xgl_matrix_i2d * i2d;
        Xgl_matrix_f2d * f2d;
        Xgl_matrix_f3d * f3d;
        Xgl_matrix_d2d * d2d;
        Xgl_matrix_d3d * d3d;
    } data;
} Dtp_mtx;

typedef enum {DTP_PT_LINE, DTP_PT_LINE_ALT, DTP_PT_EDGE,
DTP_PT_EDGE_ALT, DTP_PT_ARC, DTP_PT_ELARC, DTP_PT_MARKER,
DTP_PT_STEXT, DTP_PT_INTERIOR, DTP_PT_EXTERIOR} Dtp_pt_type;

typedef enum {DTP_LINE, DTP_EDGE} Dtp_loe;

typedef struct dtp_pt{
    Dtp_pt_type pt_type;
    float x,y,z;
} Dtp_pt;

union circ_2d_arc {
        Xgl_circle_f2d *c;
        Xgl_arc_f2d *a;
};

typedef struct {
        int     c_a;
        union circ_2d_arc p;
} wch2d_gdp;

union circ_3d_arc {
        Xgl_circle_f3d *c;
        Xgl_arc_f3d *a;
};

typedef struct {
        int     c_a;
        union circ_3d_arc p;
} wch3d_gdp;

Commonly Used Arguments

Xgl_sys_state sys_st /*System state */
int (* failure) ()   /*Pointer to function for handling special
    instances of failures. For example sometimes
    a test is known to fail at a certain (x, y)
    location and the failure is a permissible
    failure. This failure may be occurring

    because of poor test design or poor
    verification function. In such a case the
    test can provide a pointer to a function
    which checks to see if the failure is one of
    the special failure instances. Then it may
    handle the failure in whatever way is
    appropriate. This can be NULL, and is in fact
    NULL for most tests./
Xgl_ctx ctx          /*XGL context */

Denizen Library Functions

CGM Functions

int setpointlist (
            Xgl_pt_list         *pl,        /* Destination pointlist to store
                                                data provided by other
                                                parameters passed */
            Xgl_pt_f3d          *ptsf3d,    /* Point coordinates to store
                                                inside returned pointlist */
            Xgl_pt_type         pt_type,    /* Point type to store inside
                                                returned pointlist along with
                                                appropriate type for allocated
                                                points */
            Xgl_bbox            *bbox,      /* Bounding box to store inside
                                                pointlist */
            int                 n)          /* Number of points desired in
                                                pointlist */

pl->pt_type pt_type which can only come from the values:
                XGL_PT_I2D, XGL_PT_FLAG_I2D, XGL_PT_FLAG_F2D,
                XGL_PT_F3D, XGL_PT_FLAG_F3D, and XGL_PT_F2D

pl->bbox..bbox pts pointer to point type structure desired allocated for n number of points with the actual vertex data assigned from that contained within ptsf3d, and
As an example:
pl->pts.i2d[0] ... pl->pts.i2d[n-1]  ptsf3d[0].x,ptsf3d[0].y ...
ptsf3d[n-1].x,ptsf3d[n-1].y

This holds true when pts is a pointer to i2d, f2d, f3d, flag_i2d, flag_f2d and flag_f3d.
int circ2d_set_plist (
            Xgl_circle_list     *pl,        /* Destination pointlist to store
                                                data provided by other
                                                parameters passed */
            Xgl_pt_f2d          *ptsf2d,    /* pointer to list of center points
                                                for n circles */
            Xgl_bbox            *bbox,      /* bounding box to store inside
                                                pointlist and which contains all
                                                circles */
            int                 n,          /* number of circles in the list */
            float                *radius,    /* pointer to list of radius for n
                                                circles */

Return circle pointlist assembled with:
pl->num_circlesvalue n
pl->typevalue XGL_MULTICIRCLE_F2D
pl->bboxvalue bbox
pl->circles.f2df2d pointer to n Xgl_circle_f2d structures allocated dynamically within this function
pl->circles.f2d[0].center.xptsf2d[0].x
pl->circles.f2d[0].center.yptsf2d[0].y
.................
..
..
pl->circles.f2d[n-1].center.x...ptsf2d[n-1].x
pl->circles.f2d[n-1].center.yptsf2d[n-1].y
pl->circles.f2d[0].center.flagflag[0]
.................
..
..
pl->circles.f2d[n-1].center.flag..flag[n-1]
pl->circles.f2d[0].center.radius radius[0]
.................
..
..
pl->circles.f2d[n-1].center.radius radius[n-1]
/* pointer to list of flags indicating whether
edges are desired */
int circi2d_set_plist (
            Xgl_circle_list     *pl,        /* Destination pointlist to store
                                                data provided by other
                                                parameters passed */
            Xgl_pt_i2d          *ptsi2d,    /* pointer to list of center points
                                                for n circles */
            Xgl_bbox            *bbox,      /* bounding box to store inside
                                                pointlist and which contains all
                                                circles */
            int                 n,          /* number of circles in the list */
            float                *radius,    /* pointer to list of radius for n
                                                circles */
            int                 *flag)       /* pointer to list of flags
                                                indicating whether edges are
                                                desired */

Return circle pointlist assembled with:
pl->num_circlesvalue n
pl->typevalue XGL_MULTICIRCLE_I2D
pl->bboxvalue bbox
pl->circles.i2di2d pointer to n Xgl_circle_i2d structures allocated dynamically within this function
pl->circles.i2d[0].center.xptsi2d[0].x
pl->circles.i2d[0].center.yptsi2d[0].y
.................
..
..
pl->circles.i2d[n-1].center.x...ptsi2d[n-1].x
pl->circles.i2d[n-1].center.yptsi2d[n-1].y
pl->circles.i2d[0].center.flagflag[0]
.................
..
..
pl->circles.i2d[n-1].center.flagflag[n-1]
pl->circles.i2d[0].center.radiusradius[0]
.................
..
..
pl->circles.i2d[n-1].center.radius radius[n-1]
int arc2d_set_plist (
Xgl_arc_list..*pl,
/* Destination pointlist to store data provided by other parameters passed */
Xgl_pt_f2d...*ptsf2d,
/* pointer to list of center points for n arcs */
Xgl_bbox....*bbox,
/* bounding box to store inside pointlist and which contains all arcs */
int.......n,
/* number of arcs in the list */
float......*radius,
/* pointer to list of radius for n arcs */
int.......*flag,
/* pointer to list of flags indicating whether edges are desired */
float......*start,
/* pointer to list of angles in radians from the positive x-axis in the plane of the circle to the start point of the arc for n arcs*/
Returns arc pointlist assembled with:
pl->num_arcsvalue n
pl->typevalue XGL_MULTIARC_F2D
pl->bboxvalue bbox
pl->arcs.f2df2d pointer to n Xgl_arc_f2d structures allocated dynamically within this function
pl->arcs.f2d[0].center.xptsf2d[0].x
pl->arcs.f2d[0].center.yptsf2d[0].y
.................
..
..
pl->arcs.f2d[n-1].center.xptsf2d[n-1].x
pl->arcs.f2d[n-1].center.yptsf2d[n-1].y
pl->arcs.f2d[0].center.flagflag[0]
.................
..
..
pl->arcs.f2d[n-1].center.flag...flag[n-1]
pl->arcs.f2d[0].center.radius..radius[0]
.................
..
..
pl->arcs.f2d[n-1].center.radius radius[n-1]
pl->arcs.f2d[0].start_angle...start[0]
.................
..
..
pl->arcs.f2d[n-1].start_angle..start[n-1]
pl->arcs.f2d[0].stop_angle...stop_angle[0]
.................
..
..
pl->arcs.f2d[n-1].stop_angle..stop_angle[n-1]
int arc3d_set_plist (
Xgl_arc_list        *pl,            /* Destination pointlist to
                                        store data provided by
                                        other parameters passed */
Xgl_pt_f3d          *ptsf3d,        /* pointer to list of center
                                        points for n
Xgl_bbox            *bbox,          /* bounding box to store
                                        inside pointlist and which
                                        contains all arcs */
int                 n,              /* number of arcs in the list */
float                *radius,        /* pointer to list of radius for
                                        n arcs */
int                 *flag,           /* pointer to list of flags
                                        indicating whether
                                        edges are desired */
int                 *norm_flag,      /* pointer to list of flags

indicating whether 3
direction vectors provided have been normalized and are unit vectors */
int.......*unit_flag,
/* pointer to list of flags indicating whether the third direction vectors provided is normal to the plane in which the arc is rendered */
Xgl_pt_f3d...*dir,
/* pointer to a list of 3 vector components from which the first two in each group represents the plane in which the arc is going to be built in model coordinates while the last vector provides the normal to this plane when the unit_flag indicates TRUE.
float......*start,
/* pointer to list of angles in radians from the positive x-axis in the plane of the circle to the start point of the arc for n arcs */
float......*stop)
/* pointer to list of angles in radians from the positive x-axis in the plane of the circle to the end point of the arc for n arcs*/
Returns arc pointlist assembled with:
pl->num_arcsvalue n
pl->typevalue XGL_MULTIARC_F3D
pl->bboxvalue bbox
pl->arcs.f3df3d pointer to n Xgl_arc_f3d structures allocated dynamically within this function
pl->arcs.f3d[0].center.xptsf3d[0].x
pl->arcs.f3d[0].center.yptsf3d[0].y
.................
.................
.................
pl->arcs.f3d[n-1].center.x....ptsf3d[n-1].x
pl->arcs.f3d[n-1].center.yptsf3d[n-1].y
pl->arcs.f3d[0].center.flagflag[0]
.................
..
..
pl->arcs.f3d[n-1].center.flag...flag[n-1]
pl->arcs.f3d[0].dir_normalized norm_flag[0]
.................
..
..
pl->arcs.f3d[n-1].dir_normalized norm_flag[n-1]
pl->arcs.f3d[0].dir_normal...unit_flag[0]
.................
..
..
pl->arcs.f3d[n-1].dir_normal..unit_flag[n-1]
pl->arcs.f3d[0].center.radius..radius[0]
.................
..
..
pl->arcs.f3d[n-1].center.radius radius[n-1]
pl->arcs.f3d[0].dir[0]dir[0]
pl->arcs.f3d[0].dir[1]dir[1]
pl->arcs.f3d[0].dir[2]dir[2]
.................
..
..
pl->arcs.f3d[n-1].dir[0].....dir[n*3 - 3]
pl->arcs.f3d[n-1].dir[1]dir[n*3 - 2]
pl->arcs.f3d[n-1].dir[2]dir[n*3 - 1]
pl->arcs.f3d[0].start_anglestart[0]
.................
..
..
pl->arcs.f3d[n-1].start_angle..start[n-1]
pl->arcs.f3d[0].stop_angle...stop_angle[0]
.................
..
..
pl->arcs.f3d[n-1].stop_angle..stop_angle[n-1]
int circ3d_set_plist (
Xgl_circle_list     *pl,            /* Destination pointlist to
                                        store data provided by
                                        other parameters passed */
Xgl_pt_f2d          *ptsf3d,        /* pointer to list of center
                                        points for n circles */
Xgl_bbox            *bbox,          /* bounding box to store
                                        inside pointlist and which
                                        contains all circles */
int                 n,              /* number of circles in the list
                                        */
float                *radius,        /* pointer to list of radius for
                                        n circles */
int                 *flag,           /* pointer to list of flags
                                        indicating whether edges
                                        are desired */
int                 *norm_flag,      /* pointer to list of flags

indicating whether 3 direction vectors provided have been normalized and are unit vectors */
int.......*unit_flag,
/* pointer to list of flags indicating whether the third direction vectors provided is normal to the plane in which the arc is rendered */
Xgl_pt_f3d...*dir)
/* pointer to a list of three vector components from which the first two in each group represents the plane in which the arc is going to be built in model
coordinates while the last
vector provides the normal to this plane when the unit_flag indicates TRUE.
Return circle pointlist assembled with:
pl->num_circlesvalue n
pl->typevalue XGL_MULTICIRCLE_F3D
pl->bboxvalue bbox
pl->circles.f3df3d pointer to n Xgl_circle_f3d structures allocated dynamically within this function
pl->circles.f3d[0].center.xptsf3d[0].x
pl->circles.f3d[0].center.yptsf3d[0].y
.................
..
..
pl->circles.f3d[n-1].center.x...ptsf3d[n-1].x
pl->circles.f3d[n-1].center.yptsf3d[n-1].y
pl->circles.f3d[0].center.flagflag[0]
.................
..
..
pl->circles.f3d[n-1].center.flag..flag[n-1]
pl->circles.f3d[0].dir_normalized norm_flag[0]
..
..
.unit_flag[0].
..
..
..
pl->circles.f3d[n-1].dir_normal unit_flag[n-1]
pl->circles.f3d[0].center.radius radius[0]
.................
..
..
pl->circles.f3d[n-1].center.radius radius[n-1]
pl->circles.f3d[0].dir[0]dir[0]
pl->circles.f3d[0].dir[1]dir[1]
pl->circles.f3d[0].dir[2]dir[2]
..
..
..
pl->circles.f3d[n-1].dir[0]....dir[n*3 - 3]
pl->circles.f3d[n-1].dir[1]dir[n*3 - 2]
pl->circles.f3d[n-1].dir[2]dir[n*3 - 1]
Xgl_cmap* index16tbl (
Xgl_sys_state sys_state)
/* System state */
Returns an XGL colormap (colortable) with 16 colors encoded: (0) Black, (1) Red, (2) Green, (3) Blue, (4) Yellow, (5) Cyan, (6) Magenta, (7) Orange, (8) Brown, (9) Violet, (10) Olive, (11) Grey, (12) Mint Green, (13) Light Red, (14) Light Blue, and (15) White.
Xgl_cmap* colour_table (
Xgl_sys_state sys_state)
/* System state */
Returns an XGL colormap (colortable) with 8 colors encoded: (0) Black, (1) White, (2) Red, (3) Green, (4) Blue, (5) Yellow, (6) Cyan, and (7) Magenta.
int init_bounds (
Xgl_bounds_d3d *b,
/* pointer to a potential 3D window boundary, 3D viewport boundary or 3D bbox which is returned filled with the information provided by the remaining parameters */
double              xmin,           /* xmin boundary
                                        information for window
                                        boundary, viewport or
                                        bbox */
double              xmax,           /* xmax boundary
                                        information for window
                                        boundary, viewport or
                                        bbox */
double              ymin,           /* ymin boundary

information for window
boundary, viewport or bbox */
double.....ymax,
/* ymax boundary information for window boundary, viewport or bbox */
double.....zmin,
/* zmin boundary information for window boundary, viewport or bbox */
double.....zmax)
/* zmax boundary information for window boundary, viewport or bbox */
Returns a pointer to a 3D boundary structure, b, with the information for its members from the other parameters.
int init_2dbounds (
Xgl_bounds_d2d *b,
/* pointer to a potential 2D window boundary, 2D viewport boundary or 2D bbox which is returned filled with the information provided by the remaining parameters */
double.....xmin,
/* xmin boundary information for window boundary, viewport or bbox */
double.....xmax,
/* xmax boundary information for window boundary, viewport or bbox */
double.....ymin,
/* ymin boundary information for window boundary, viewport or bbox */
double.....ymax)
/* ymax boundary
information for window boundary, viewport or bbox */
Returns a pointer to a 2D boundary structure, b, with the information for its members from the other parameters.
init_bbox3d (
Xgl_bounds_f3d *box,
/* pointer to bbox returned with information fully provided by other parameters.
float......xmin,
/* xmin boundary information for bbox */
float......xmax,
/* xmax boundary information for bbox */
float......ymin,
/* ymin boundary information for bbox */
float......ymax,
/* ymax boundary information for bbox */
float......zmin,
/* zmin boundary information for bbox */
float......zmax)
/* zmax boundary information for bbox */
Returns an initialized bounding box of type f3d, bbox, with coordinate information provided by the other parameters.
int is_2d_circle (
Xgl_sys_state       sys_st,         /* System state */
Xgl_3d_ctx          ctx,            /* 3D Context */
Xgl_circle_list     *pl)            /* circle point list */

Returns 0 upon failure to substantiate the circumference of a 2D circle and 1 upon success.
int is_3d_circle (
            Xgl_sys_state       sys_st,         /* System State */
            Xgl_3d_ctx          ctx,            /* 3D Context */
            Xgl_circle_list     *pl)            /* pointer to a circle list to
                                                    verify appears correctly in
                                                    the XGL/X window */

Returns 0 upon failure to substantiate the circumference of a 3D circle and 1 upon success.
int is_2d_arc (
Xgl_sys_state       sys_st,         /* System State */
Xgl_ctx             ctx,            /* 2D Context */
Xgl_arc_list        *pl)            /* pointer to arc list to verify

on screen */
Returns 0 upon failure to substantiate the circumference of a 2D arc and 1 upon success.
int is_3d_arc (
Xgl_sys_state sys_st,
/* System State */
Xgl_ctx.....ctx,
/* 3D Context */
Xgl_arc_list..*pl)
/* pointer to arc list to verify on screen */
Returns 0 upon failure to substantiate the circumference of a 2D arc and 1 upon success.
int is_shaded_quadmesh (
Xgl_sys_state       sys_st,         /* System State */
Xgl_object          ctx,            /* 2D or 3D Context */
int                 nbnds,          /* # of polygons, although
                                        assumes only 1 */
Xgl_pt_list         *plist,         /* array of edge lists */
Xgl_color_type      type,           /* color type either RGB or
                                        INDEX */
Xgl_color           color)          /* interior color, not used,

because all point type
where shading is anticipated contain color information */
XGL breaks quadmeshes into tristrips before lighting, shading, and color interpolation. As a result, is_shaded_quadmesh() breaks quadmeshes into tristrips composed along the diagonal from the upper-left corner to the lower-right corner and passes these two tristrips to is_shaded_polygon for verification. Returns 1 upon successful substantiation of quadmesh on the screen and 0 upon failure.
int wide_line (
            Xgl_sys_state       sys_st,         /* System State */
            Xgl_obj             ctx,            /* 2D or 3D Context */
            int                 x1,             /* 1st x endpoint in screen
                                                    space */
            int                 y1,             /* 1st y endpoint in screen
                                                    space */
            int                 x2,             /* 2nd x endpoint in screen
                                                    space */
            int                 y2,             /* 2nd y endpoint in screen
                                                    space */
            int                 ew,             /* Expected width */
            Xgl_color_type      color_type,     /* color type RGB or
                                                    INDEX */
            Xgl_color           *color)         /* expected color in RGB or
                                                    INDEX format */

Returns 1 for substantiation of a line width of ew and 0 upon failure.
int is_ltype (
Xgl_sys_state       sys_st,         /* System State */
Xgl_object          ctx,            /* 2D or 3D Context */
int                 x1,             /* 1st x endpoint in screen
                                        space */
int                 y1,             /* 1st y endpoint in screen
                                        space */
int                 x2,             /* 2nd x endpoint in screen
                                        space */
int                 y2,             /* 2nd y endpoint in screen

space */
Xgl_color....*col,
/* Expected dash or dot color either RGB or index */
int.......line_type,
/* line types which can be among:
PATDASHED,
PATDOTTED,
PATDASHEDDOTTED,
PATDASHDOTDOT,
PATLONGDASH,
PATCGMDOT,
PATCGMDASH,
PATDASHDOT,
PATCENTER or
PATPHANTOM */

int.......pixl,
/* pixel length for dash or dot */
int.......gapl,
/* pixel length for gap */
int.......tdd,
/* total dash &/or dot pixel length */
Xgl_color....*gapcol)
/* color in RGB or index for gap pixels */
Returns 1 on success of verifying patterned line type on screen and 0 otherwise. Only capable of verification for either horizontal or vertical patterned lines and only implemented for index.

Circle Functions

int dtp_iscirc (
Xgl_sys_statesys_st,
Xgl_ctxctx,
            Xgl_circle_list     * circle_listp,  /* Circle list to be tested */
            int                 (* failure) ())

Checks to see if data described by circle_listp are indeed drawn as circles. This function just checks to see that pixels of expected color are found around the circumference of the circle and the center is of the expected color. Only some points along the circumference are checked. Works only when circle_listp->type is XGL_MULTICIRCLE_F2D, XGL_MULTICIRCLE_F3D, or
XGL_MULTICIRCLE_AF3D. Returns 1 if all the circles are found to be correct by the above definition. Returns 0 if any of the circles is incorrect. If pixel readback functions called by this function return -1, then this value is returned to the caller.
int dtp_isarc (
Xgl_sys_statesys_st,
Xgl_ctxctx,
Xgl_arc_list        * arc_listp,    /* Arc list to be tested */
int                 (* failure)())

Checks to see if data described by arc_listp are indeed drawn as arcs. This function just checks to see that pixels of expected color are found around the circumference of the arc. It does not distinguish between open and closed arcs. Works only when arc_listp->type is XGL_MULTIARC_F2D, XGL_MULTIARC_F3D, or XGL_MULTIARC_AF3D. Returns 1 if all the arcs are found to be correct by the above definition. Returns 0 if any of the arcs is incorrect. If pixel readback functions called by this function return -1, then this value is returned to the caller.
int dtp_isellipse (
Xgl_sys_state       sys_st,         /* System State */
Xgl_ctx             ctx,            /* 3D Context */
Xgl_ell_list        *ellip_listp,   /* Elliptical arc list to be
                                        verified on screen */
int                 (* failure) ()  /* Pointer to function for

handling special instances of failures */
Checks to see if data described by ellip_listp are indeed drawn as elliptical arcs. This function just checks to see that pixels of expected color are found around the circumference of the elliptical arc. It does not distinguish between open and closed elliptical arcs. Can handle elliptical arcs not parallel to the xy plane and back-faced elliptical arcs but only for point types XGL_MULTIELLARC_F3D and XGL_MULTIELLARC_AF3D. Returns 0 if any of the arcs is incorrect. If pixel readback functions called by this function return -1, then this value is returned to the caller.

Color Selector Functions

int is_ln_selection (
            Xgl_sys_state       sys_state;      /* IN: System state */
            Xgl_3d_ctx          ctx;            /* IN: Current context */
            Xgl_bbox            *bb;            /* IN: bounding box */
            Xgl_pt_list         *pl;            /* IN: pointlist */
            int                 op;             /* IN: primitive: not used */
            int                 npl)            /* IN: number of pointlists in
                                                pointlist array */

is_ln_selection can only handle pointlists with point type XGL_PT_F3D or XGL_PT_COLOR_F3D
Returns 1 upon success of finding the correct line color rendered at the pointlist locations given the XGL_CTX_LINE_COLOR_SELECTOR and the XGL_CTX_LINE_COLOR held by the ctx and the vertex color information inside the pointlists.
Returns 0 upon failure.
int is_marker_selection (
Xgl_sys_state       sys_state;      /* IN: System state */
Xgl_3d_ctx          ctx;            /* IN: Current context */
Xgl_pt_list         *pl;            /* IN: pointlist */
int                 op;             /* IN: primitive: not used */
int                 npl;            /* IN: number of pointlists in
                                    pointlist array */
Xgl_marker          m)              /* marker type:

dot,plus,asterisk, circle,cross,square, bowtie_ne, bowtie_nw */
Returns 1 upon success of finding the correct marker color rendered at the pointlist locations given the XGL_CTX_MARKER_COLOR_SELECTOR, XGL_CTX_MARKER_COLOR and XGL_CTX_MARKER_SCALE_FACTOR held by the ctx and the vertex color information inside the pointlists.
Returns 0 upon failure.
int is_msp_selector_lighting (
            Xgl_sys_state       sys_state;      /* IN: System state */
            Xgl_3d_ctx          ctx;            /* IN: Current context */
            Xgl_facet_list      *fl;             /* IN: facet list */
            Xgl_pt_list         pl;             /* IN: point list */
            int                 npl;            /* IN: number of pointlists in
                                                pointlist array */
            Xgl_facet_flags      flag;            /* IN: facet flag data
                                                information */
            int                 primname)       /* IN: primname may only be
                                                 MSP */

Returns 1 upon success of finding the correct colors at the pointlist locations for xgl_multi_simple_polygon given the
XGL_CTX_SURF_FRONT_COLOR_SELECTOR,
XGL_CTX_SURF_FRONT_COLOR,
XGL_3D_CTX_SURF_FRONT_ILLUMINATION,
XGL_3D_CTX_SURF_FRONT_AMBIENT,
XGL_3D_CTX_SURF_FRONT_DIFFUSE,
XGL_3D_CTX_SURF_FRONT_DIFFUSE,
XGL_3D_CTX_SURF_FRONT_SPECULAR_COLOR,
XGL_3D_CTX_SURF_FRONT_SPECULAR_POWER,
XGL_3D_CTX_SURF_FRONT_LIGHT_COMPONENT,
XGL_3D_CTX_LIGHT_NUM, XGL_3D_CTX_LIGHTS, XGL_3D_CTX_LIGHTS
and XGL_3D_CTX_LIGHTS held by the ctx, applicable normals and colors from
either or both the facet list and the point list, and the applicable default normal
when needed calculated as recommended by the rules prescribed by
XGL_3D_CTX_SURF_GEOM_NORMAL.

Returns 0 upon failure.
Cannot handle facet flags which indicated the provided facet normal is inconsistent with the implicit facet normal, and TRUE value for
XGL_3D_CTX_SURF_FACE_DISTINGUISH.

int is_qm_selector_lighting (
Xgl_sys_state       sys_state;      /* IN: System state */
Xgl_3d_ctx          ctx;            /* IN: Current context */
Xgl_facet_list      *fl;             /* IN: facet list */
Xgl_pt_list         pl;             /* IN: point list */

            int                 primname;       /* IN: primname may only be
                                                QUADMESH */
            int                 row;            /* IN: number of rows in quad
                                                */
            int                 col)            /* IN: number of columns in
                                                 quad */

Returns 1 upon success of finding the correct colors at the pointlist locations for xgl_quadrilateral_mesh given the
XGL_CTX_SURF_FRONT_COLOR_SELECTOR,
XGL_CTX_SURF_FRONT_COLOR,
XGL_3D_CTX_SURF_FRONT_ILLUMINATION,
XGL_3D_CTX_SURF_FRONT_AMBIENT,
XGL_3D_CTX_SURF_FRONT_DIFFUSE,
XGL_3D_CTX_SURF_FRONT_DIFFUSE,
XGL_3D_CTX_SURF_FRONT_SPECULAR_COLOR,
XGL_3D_CTX_SURF_FRONT_SPECULAR_POWER,
XGL_3D_CTX_SURF_FRONT_LIGHT_COMPONENT,
XGL_3D_CTX_LIGHT_NUM, XGL_3D_CTX_LIGHTS, XGL_3D_CTX_LIGHTS
and XGL_3D_CTX_LIGHTS held by the ctx, applicable normals and colors from
either or both the facet list, and the point list and the applicable default normal
when needed calculated as recommended by the rules prescribed by
XGL_3D_CTX_SURF_GEOM_NORMAL.

Cannot handle TRUE value for XGL_3D_CTX_SURF_FACE_DISTINGUISH.
Returns 0 upon failure.
int is_selector_lighting (
            Xgl_sys_state       sys_state;      /* IN: System state */
            Xgl_3d_ctx          ctx;            /* IN: Current context */
            Xgl_facet_list      *fl;             /* IN: facet list */
            Xgl_pt_list         pl;             /* IN: point list */
            int                 primname)       /* IN: primitive name may be
                                                 either TRISTRIP or TRISTAR
                                                 */

Returns 1 upon success of finding the correct colors at the pointlist locations for xgl_triangle_list and xgl_triangle_strip given the
XGL_CTX_SURF_FRONT_COLOR_SELECTOR,
XGL_CTX_SURF_FRONT_COLOR,

XGL_3D_CTX_SURF_FRONT_ILLUMINATION,
XGL_3D_CTX_SURF_FRONT_AMBIENT,
XGL_3D_CTX_SURF_FRONT_DIFFUSE,
XGL_3D_CTX_SURF_FRONT_DIFFUSE,
XGL_3D_CTX_SURF_FRONT_SPECULAR_COLOR,
XGL_3D_CTX_SURF_FRONT_SPECULAR_POWER,
XGL_3D_CTX_SURF_FRONT_LIGHT_COMPONENT,
XGL_3D_CTX_LIGHT_NUM, XGL_3D_CTX_LIGHTS, XGL_3D_CTX_LIGHTS
and XGL_3D_CTX_LIGHTS held by the ctx, applicable normals and colors from
either or both the facet list and the point list, and the applicable default normal
when needed, calculated as recommended by the rules prescribed by
XGL_3D_CTX_SURF_GEOM_NORMAL.

Cannot handle TRUE value for XGL_3D_CTX_SURF_FACE_DISTINGUISH.
Returns 0 upon failure.

Depth_Cueing Functions

apply_indexed_depth_cueing (
            Xgl_3d_ctx              ctx,    /* IN: Current context */
            Xgl_pt_f3d              *pt,    /* IN: Vertex */
            Xgl_color               *col,   /* IN: Color for that vertex */
            Xgl_color               *nc)    /* OUT: New color, adjusted for
                                                depth cueing */

Attenuates the color (*col), based on the z value of *pt. The z value is assumed to be in VDC space. This function is used when the XGL_DEV_COLOR_TYPE is XGL_COLOR_INDEX. Works only when XGL_3D_CTX_DEPTH_CUE_MODE is
XGL_DEPTH_CUE_LINEAR.

apply_rgbed_depth_cueing (
Xgl_3d_ctx              ctx,    /* IN: Current context */
Xgl_pt_f3d              *pt,    /* IN: Vertex */
Xgl_color               *col,   /* IN: Color for that vertex */
Xgl_color               *nc)    /* OUT: New color, adjusted for

depth cueing */
Attenuates the color (*col), based on the z value of *pt. The z value is assumed to be in VDC space. This function is used when the XGL_DEV_COLOR_TYPE is XGL_COLOR_RGB. Works only when XGL_3D_CTX_DEPTH_CUE_MODE is XGL_DEPTH_CUE_LINEAR.

Gen Functions

check_pixel (
Xgl_sys_statesys_st,
Xgl_objectctx,
Xgl_color*col,
Xgl_color_typecolor_type,
intx,
inty,
intd,
intshould_exist)
Checks to see if at least one pixel of the specified color either exists (should_exist=1) or does not exist (should_exist=0) within the area of dimension d * d centered at x, y of the device attached to the context ctx. This function now just calls the newer, more flexible, easier to understand function dpix_chkreg(). check_pixel() has been left in for backward compatibility.
void tbegintest (
char                *name,          /* test name */
char                *desc)          /* test description */

Initializes the testing environment by setting the test name and test description, which are printed out in the test suite log when the test program ends. Also sets the default values of certain testing parameters that can be set externally.
void tendtest() Prints the message indicating if the test failed or passed.
void tfprintf (
char                *fmt,           /* message fmt */
...)                                /* variable data */

Behaves just like printf, except that the failure count is incremented. This failure count is used to abort the test if the number of failures for the test has gone above a certain limit. This limit can be set by setting the environment variable MAXFAIL. If the variable is not set, the value of 5 is used.
void tvprintf (
int.......verbosity,
char                *fmt,           /* message format string */
...)                                /* variable data */

Except for the argument verbosity, the function behaves just like printf. The verbosity is used to filter out messages that are too detailed (detail is defined in terms of current verbosity level). The function compares the value passed as the verbosity argument, with the current verbosity set as an environment variable. If the current verbosity is not set as an environment variable, a default value is used. The message is printed only if the verbosity argument is greater than or equal to (>=) the current verbosity.
void tabort (
            char                *format,        /* message format */
            int                 va_alist)       /* variable data */

Behaves like printf except that it also aborts the test.
void tcmbegintest (
            char                *name,          /* test name */
            char                *desc)          /* test description */

Behaves like tbegintest() except that this function is used for tests that use comparison methodology (CM). The other function is used in tests that use the sampling methodology (SM).
int dpix_chkreg (
Xgl_sys_statesys_st,
Xgl_ctxctx,
Xgl_color           *color,         /* color to be tested for */
int                 x,              /* location in device
int                 y,                  coordinates of the "center"

of the region of interest */
int                 w,              /* dimensions of the region of
int                 h,                  interest */
int                 op)             /* operation to be used for

comparison of the color argument with the colors of pixels in the region of interest */
Checks the region of interest as specified. Context ctx must be attached to a device. The region of interest is "centered" at device coordinates (x,y). The dimensions of the region of interest are width == w and height == h, in device coordinates. If op == DPIX_SOME, check if SOME pixel in the region of interest has color color. If op == DPIX_NONE, check that of all the pixels in the region of interest NONE has color color. If op == DPIX_EVERY, check that EVERY pixel in the region of interest has color color.
int dpix_getreg (
Xgl_sys_statesys_st,
Xgl_rasras,
Xgl_ctxctx,
int                 ox,             /* Location of "center" of
int                 oy,                 region of interest */
int                 w,              /* Dimension of region of
int                 h,                  interest */
void                *region,        /* Are in which pixel values
                                        read back will be stored */
Xgl_color_type      ctype)

Gets pixel colors from the region of interest. The first time the function is called, it creates the space for the region. In subsequent calls the function will create more space only if needed. If the space needed is less than that which has been already allocated in a previous call, that space will be resumed.
void dtp_setup_cmap4 (
Xgl_sys_statesys_st,
Xgl_ctxctx,
Xgl_cmap*cmap)
/* Pointer to colormap object created */
Creates a colormap with four entries, black, white, green and red, and returns a pointer to the colormap object created.
int dtp_pl2f2d (
Xgl_pt_list         *inpl,      /* pointer to input point lists */
Xgl_usgn32          num_pt_lists,
Xgl_pt_list         **outpl)    /* Output point lists */

Converts point lists with arbitrary 2D XGL data types into point lists of 2D float type (XGL_PT_F2D). This is useful for some tests where the geometry for the primitives has been specified using a point type other than XGL_PT_F2D, since most (not all) of the verification functions in libdenizen accept F2D and F3D point types. The function creates the space needed for the output point lists.
int dtp_pl2f3d (
Xgl_pt_list*inpl,
Xgl_usgn32num_pt_lists,
Xgl_pt_list**outpl)
Same as dtp_plf2d() except that this function is for 3D point types.
dtp_pt2f3d (
Xgl_pt*inpt,
Xgl_pt_typeinpt_type,
Xgl_pt_f3d*outpt)
Similar to dtp_pl2f3d() except that this is for a single point rather than a point list.
double dtp_rand (
floatmin,
floatmax)
Returns a random float in the closed interval [min, max].
int dtp_ismarker (
Xgl_sys_statesys_st,
Xgl_ctxctx,
Xgl_pt_list*pl,
/* Point list with marker data */
int.......(* failure) ())
A simple test for correctness of markers. Checks the x, y locations (assumed to be in device coordinate space) in the point list for presence of a "point" of the right color. Thus, this function works only for markers shaped like asterisk, plus, dot, and so on, but not for circle markers, for example. The point type has to be XGL_PT_F2D or XGL_PT_F3D.
int dtp_isstext2d (
Xgl_sys_statesys_st,
Xgl_ctxctx,
char*str,
Xgl_pt_f2d*pos,
int(* failure)())
Text checking functions are very unsophisticated. These assume that the text is centered horizontally and vertically and just tests a small region centered at the position of text, checking for some pixels. Use a single character like "X" as the text to be drawn until these are made more sophisticated. Practical experience shows that is not as serious a flaw as it may seem. This function is only used in test programs that are testing transformations or clipping of text, rather than if text is being drawn exactly correctly. Tests for checking the correctness of text without transformations or clipping use their own internal functions for verifications.
int dtp_isstext3d (
Xgl_sys_statesys_st,
Xgl_ctxctx,
char*str,
Xgl_pt_f3d*pos,
Xgl_pt_f3ddir[],
int(* failure)())
Same as dtp_isstext2d() except that this is for 3D text.
int Getpixarray (
Xgl_sys_statesys_st,
Xgl_win_rasraster,
Xgl_objectctx2or3d,
intx,
inty,
intw,
inth,
void*data,
Xgl_color_typetype)
Obsolete function left in for backward compatibility. Some older tests still use this function. Now this function just calls the newer dpix_getreg().
void set_rgb_color (
Xgl_color*color,
floatred,
floatgreen,
floatblue)
Sets the value of *color to the r, g, b values specified in the arguments.
void set_rgb_surf_color (
Xgl_objctx,
floatred,
floatgreen,
floatblue)
Sets the context attribute XGL_CTX_SURF_FRONT_COLOR to a color with the r, g, b values provided.
void set_rgb_line_color (
Xgl_objctx,
floatred,
floatgreen,
floatblue)
Sets the context attribute XGL_CTX_LINE_COLOR to a color with the r, g, b values provided.
void set_rgb_back_color (
Xgl_objctx,
floatred,
floatgreen,
floatblue)
Sets the context attribute XGL_CTX_BACKGROUND_COLOR to a color with the r, g, b values provided.
void extreme_rgb_values (
Xgl_objctx,
float*red,
float*green,
float*blue)
Sets the background color to white, creates a new frame, reads back the color of the pixel at (x, y), and resets the background color.
void check_image (
char                *imagename,     /* name of the image file (not
                                        full path) */
Display             *display,       /* X display */
Window              window,         /* X window */
int                 x,               /* origin x in device
                                        coordinates */
int                 y,              /* origin y in device
                                        coordinates */
int                 w,              /* width in device
                                        coordinates */
int                 h,              /* height in device
                                        coordinates */
char                *text)          /* image description */

Determine the paths for reference and current images with respect to the default display connection, then call check_image_core to do image checking. Skip this operation if the environment variable NOCHECKPIX is set. Find a reference image in REFIMAGE. If it exists, compare against it and take appropriate action. If it doesn't exist, find a known incorrect image in
CURIMAGE for comparison. If no image is found for comparison or all images compare with differences, save a copy in the current image directory. Print out messages reporting images matched or require manual inspection.
Image format is stored as:
<1 byte: flag image type, pseudocolor or truecolor> <2 bytes: number of bytes of ascii text to follow> <n bytes: ascii text>
<2 bytes: width of image> <2 bytes: height of image> <2 bytes: number of colormap data entries> <n bytes: colormap data of the form
(pixel[1 byte],red[1 byte],green[1 byte],blue[1 byte]) quadruples >
<4 bytes: number of bytes of image data> <n bytes: image data of the form (number[1 byte],pixel[1 byte]) pairs >

Lighting Functions

vector_normalize (
Xgl_pt_f3d...*v)
Normalize the vector v in place.
apply_indexed_lighting (
            Xgl_3d_ctx          ctx,        /* IN: Current context */
            Xgl_pt_f3d          *Op,        /* IN: Polygon vertex */
            Xgl_pt_f3d          *normal,    /* IN: Normal for that vertex */
            Xgl_color           *Od_hat,    /* IN: Color for that vertex */
            Xgl_color           *color)     /* OUT: Color adjusted for
                                                lighting */

Calculate the lit color of a vertex based on the current light status, and the original color of the object. Use the index color model.
apply_rgb_lighting (
Xgl_3d_ctx          ctx,        /* IN: Current context */
Xgl_pt_f3d          *Op,        /* IN: Polygon vertex */
Xgl_pt_f3d          *normal,    /* IN: Normal for that vertex */

Xgl_color           *Od,        /* IN: Color for that vertex */
Xgl_color           *color)     /* OUT: Color adjusted for
                                    lighting */

Calculate the lit color of a vertex based on the current light status, and the original color of the object. Use the RGB color model.

Line Functions

int dtp_isline (
Xgl_sys_statesys_st,
Xgl_ctxctx,
Xgl_usgn32num_pt_lists,
int                     loe,        /* Edge or line ? */
Xgl_pt_list             * pl,       /* Geometry data */
int                     (* failure) ())

Multipolyline information is given in device coordinates as XGL_PT_F2D or XGL_PT_F3D. loe == DTP_LINE means that the data is for a line. loe == DTP_EDGE means the data is for an edge. This is needed because at the lowest level the point checking routine will need to get the expected color from some context attribute. This could be XGL_CTX_LINE_COLOR or XGL_CTX_EDGE_COLOR, depending on whether it is being passed a point on a line or an edge. The same applies to other attributes. If the pl is NULL or num_pt_lists is 0, -1 is returned. If the line or edge is verified to be correct then a 1 is returned, otherwise a 0 is returned. This function tests a few points along the line. The first failure causes verification conditions to become less stringent for that particular point of failure, depending on the line or edge style. For example, if it fails at a point and the style is patterned, it may look in a larger region before finally returning a 0.
int is_line (
Xgl_sys_statesys_st,
Xgl_objctx,
intx1,
inty1,
int                 x2,             /* Endpoints of the line */
int                 y2,
Xgl_color           *color,         /* Line color expected */

Xgl_color_type color_type,
int                 delta,          /* Not every point on the line
                                        is checked. Delta controls
                                        the separation between the
                                        points checked */
int                 strict_check)   /* However if this is 1, every

point on the line is checked */
Checks points along a solid line to see if an expected color is found at each point. The separation between the points can be controlled from coarse (large delta and strict_check == 0) to very fine (strict_check == 1).
is_shaded_line (
Xgl_sys_statesys_st,
Xgl_objctx,
intx1,
inty1,
intx2,
inty2,
Xgl_color*c1,
Xgl_color*c2,
Xgl_color_typecolor_type)
Verifies a shaded line, checking all points along the line. c1 and c2 are the endpoint colors that are interpolated linearly, in the manner of XGL. The geometry (endpoints) data must be in device coordinates.
is_wide_line (
Xgl_sys_state..sys_st,
Xgl_obj               ctx,          /* IN: current context */
int                   x1,           /* IN: 1st endpoint */
int                   y1,
int                   x2,/* IN: 2nd endpoint */
int                   y2,
int                   ew,           /* IN: expected width */
Xgl_color_type        color_type)   /* IN: RGB or Index */

Tests for wide lines. At all points except for the endpoints and polyline joins: a vertical line running across an x-major line encounters width pixels. Similarly, a horizontal line running across a y-major line finds the same number. The function's task is to pick an appropriate number of interior points, and check either horizontally or vertically for any given line.
void pattern_line (
Xgl_sys_statesys_st,
Xgl_2d_ctxctx2d,
Xgl_win_rasras,
intx1,
intx2,
inty1,
/* line should be between
int.......y2,
(x1, y1) and (x2, y2) which should be in device
coordinates */
Xgl_color linecolor,
intorientation)
/* orientation can be horizontal (0) or vertical (1) */
Draws a patterned line and then tests it for correctness. The line can only be a horizontal or vertical line.
void solid_line (
Xgl_sys_statesys_st,
Xgl_2d_ctxctx2d,
Xgl_win_rasras,
intx1,
intx2,
inty1,
inty2,
Xgl_color linecolor)
Draws a solid line and then tests it using is_line().
void toggle_line_type (
Xgl_sys_statesys_st,
Xgl_2d_ctxctx2d,
Xgl_win_rasras,
intx1,
intx2,
intpattern,
intdirection)
A wrapper for solid_line() or pattern_line(). Calls these functions several times with slightly different colors and varying geometry.

Marker Functions

int is_multimarker (
Xgl_sys_statesys_st,
Xgl_ctxctx,
Xgl_pt_list             *pl,        /* Geometry data */
Xgl_marker              marker,
float                    size,       /* Marker scale size */
Xgl_color               *color)     /* Expected color */

Verifies that the list of markers in the pl is indeed correct. Uses the XGL_MARKER_DESCRIPTION attribute to get the line description of the markers.

Nurbs Functions

int is_nubs (
Xgl_sys_state...sys_st,
Xgl_object              ctx,          /* IN: context */
Xgl_nu_bspline_curve *curve,          /* IN: ptr to a nubs curve */
float                    u,            /* IN: parameter value for
                                          the curve */
Xgl_color               *color,       /* IN: curve color */
Xgl_pt_f3d              *pt,          /* OUT: curve point's
                                          coordinates */
int                     (* failure) ()) /* Pointer to function for

handling special instances of failures. For example sometimes a test is known to fail at a certain (x, y) location and the failure is a permissible failure. This failure may be occurring because of poor test design or poor
verification function. In such a case, the test can provide a pointer to a function which checks to see if the failure is one of the special failure
instances. Then it may handle the failure in whatever way is
appropriate. This can be NULL, and is in fact NULL for most tests. */
The argument pt is the pointer to a Xgl_pt_f3d point which, upon return, will contain the coordinates of the point on the curve corresponding to the parameter u. Only one point on the curve, corresponding to u, is checked.

Polygon Functions

int dtp_ispg (
Xgl_sys_statesys_st,
Xgl_ctxctx,
Xgl_facet_typefacet_type,
Xgl_facet* facet,
Xgl_usgn32num_pt_lists,
Xgl_pt_list* pl,
int(* failure) ())
A simple polygon-checking function. This one does not do scan conversion (unlike is_polygon()). Instead it checks points along all the boundaries to see if the expected colors are present. The data must be in device coordinates. The arguments are similar to the xgl_polygon(). Generally, this verification function is used in tests involving transformations or clipping.
int dtp_isrect (
Xgl_ctxctx,
Xgl_rect_list* rect_list,
int(* failure) ())
Verifies rectangles. This is a wrapper to dtp_ispg() so the caveats mentioned for that function apply here as well.
int dtp_isqm (
Xgl_sys_statesys_st,
Xgl_ctxctx,
Xgl_usgn32rows,
Xg;_usgn32cols,
Xgl_facet_list* facets,
Xgl_pt_list* qmpl,
int(* failure) ())
Verifies quadmeshes. This is a wrapper to dtp_ispg(), so the caveats mentioned for that function apply here as well.
int dtp_ists (
Xgl_sys_statesys_st,
Xgl_ctxctx,
Xgl_facet_list* facets,
Xgl_pt_list* tspl,
int(* failure) ())
Verifies tristrips. This is a wrapper to dtp_ispg(), so the caveats mentioned for that function apply here as well.
is_polygon (
Xgl_sys_statesys_st,
Xgl_objectctx,
intnbnds,
/* IN: number of boundaries */
Xgl_pt_list.....pts[ ],
/* IN: array of edge lists */
Xgl_color_type...type,
/* IN: color model for interior */
Xgl_color...... *color)/* IN: interior color */
Scan converts the polygon described by the arguments. Checks each point along the scan line but not each scan line. Verifies roughly 10% of the scan lines. This function verifies flat shaded polygons.
is_shaded_polygon (
Xgl_sys_statesys_st,
Xgl_objectctx,
intnbnds, /* IN: number of boundaries */
            Xgl_pt_list             pts[ ], /* IN: array of edge lists */
            Xgl_color_type          type)   /* IN: color model for interior */

Similar to is_polygon() except that the polygon can be shaded. Interpolates along y and across each scan line.
is_hollow_polygon (
Xgl_sys_statesys_st,
Xgl_objectctx,
Xgl_pt_list*pl,
Xgl_pt_f3d*interior,
Xgl_color_typetype,
Xgl_color*col,
intstrict_check)
Verifies that a flat-shaded polygon is drawn with a hollow interior. is_line() is called for each edge, and a sample interior point is also examined. The semantics of strict_check are the same as for is_line().
is_hollow_shaded_polygon (
Xgl_sys_statesys_st,
Xgl_objectctx3d,
Xgl_pt_list*pl,
Xgl_pt_f3d*interior,
Xgl_color_typetype)
Similar to is_hollow_polygon() except that it can be shaded.
is_polygon_edge (
Xgl_sys_statesys_st,
Xgl_objectctx,
Xgl_pt_list* pl,
Xgl_color_typetype,
Xgl_color* col)
Checks to see if a polygon has the correct edge. This is a wrapper to is_hollow_polygon() with NULL for interior argument.
is_polygon_set_lskip (
int.........skip)
is_polygon() skips the number of pixels at the start of each scan line when verifying.
is_polygon_set_rskip (
int.........skip)
is_polygon() skips the number of pixels at the end of each scan line when verifying.

Transform Functions

int dtp_eqmtx (
Dtp_mtx                 *A,     /* matrix to be compared */
Dtp_mtx                 *B)     /* matrix to be compared */

Compares two matrixes to see if they are equal. Input matrices must have the same data type and dimension. Returns 1 if they are equal and 0 otherwise.
int dtp_eqtrans (
            Xgl_trans               A,      /* Transform to be compared */
            Xgl_trans               B)      /* Transform to be compared */

Compares two transforms to see if they are equal. Input transforms must be of the same data type and dimension. Returns 1 if they are equal and 0 otherwise.
int dtp_idmtx (
Xgl_trans......trans) /* input transform */
Checks to see if the matrix is an identity matrix. Returns 1 if A is identity matrix and 0 otherwise.
int dtp_idtrans (
Xgl_trans......trans) /* input transform */
Checks to see if the transform is an identity transform. Returns 1 if trans is identity and 0 otherwise.
dtp_matrix_multiply (
Dtp_mtx                 *M,     /* matrix in which the result of
                                    multiplying L and R (L * R)
                                    will be stored */
Dtp_mtx                 *L,     /* left matrix in the
                                    multiplication */
Dtp_mtx                 *R)     /* right matrix in the

multiplication */
Multiplies matrix pointed to by L with matrix pointed to by R and returns the result in matrix pointed to by M. Space for result matrix (M) must have been allocated by the caller. L, R, and M must be of the same dimension and have the same data type.
dtp_transform_multiply (
            Xgl_trans               D,      /* destination transform in which
                                                the result of multiplication
                                                (L* R) will be stored */
            Xgl_trans               L,      /* left transform in the
                                                multiplication */
            Xgl_trans               R)      /* right transform in the
                                                multiplication */

Multiplies transform L with transform R and stores the result (L * R) into D. L, R, and D must be of the same dimension and data type.
int dtp_ispt (
Xgl_sys_statesys_st,
Xgl_ctxctx,
float                    x,      /* Coordinates of input point in
float                    y,          Model Coordinate Space */
float                    z,
Dtp_pt_type             pt_type,
int                     (*failure) ())

Checks to see if point (x, y, z) is of the right color. The function internally transforms (x, y, z) to (x', y') in Device Coordinate Space. Then it checks a small region of pixels around (x', y'). The color(s) it looks for depend on the point type, that is, whether the point is on a line, an edge, a patterned line, text, interior of a surface, and so on. Returns 1 if the right color is read back in the region around (x', y') and 0 if not. It returns -1 if some lower-level pixel readback function returns an error like attempting to read back pixels from an obscured region of a window.
int dtp_isptc (
Xgl_sys_statesys_st,
Xgl_ctxctx,
            float                    x,      /* Coordinates of input point in
            float                    y,          Model Coordinate Space */
            float                    z,
            Xgl_color               *color, /* Check for this color at (x, y, z)
*/
            int (                   *failure) ())

Same as dtp_ispt() except that it checks for the color given as input.
int dtp_modelx (
Xgl_ctxctx,
Xgl_pt*ptp)
/* Pointer to input point */
Transforms the input point using the local modeling transform (XGL_CTX_LOCAL_MODEL_TRANS) and the global modeling transform (XGL_CTX_GLOBAL_MODEL_TRANS) in that order. The transformation is done in place in the input point. Returns 0 if successful and -1 if either of the input arguments is NULL.
int dtp_viewx (
Xgl_ctxctx,
Xgl_ptptp)../* Pointer to input point */
Same as dtp_modelx() except that the view transformation (XGL_CTX_VIEW_TRANS) is used instead of the modelling transforms.
void dtp_vuclipb (
Xgl_ctxctx,
Xgl_bbox*bounds)
/* Output argument in which view clip bounds will be returned */
Returns the view clip bounds (XGL_CTX_VIEW_CLIP_BOUNDS) in the argument bounds. The caller must have allocated space for bounds. The dimension of the bounds is also set in bounds>bbox_type as XGL_BBOX_F2D or
XGL_BBOX_F3D.

void dtp_vpclipb (
Xgl_ctxctx,
Xgl_bbox*bounds)
/* Output argument containing view clip bounds */
Returns the view clip bounds (XGL_CTX_DC_VIEWPORT) in the argument bounds. The caller must have allocated space for bounds. The dimension of the bounds is also set in bounds->bbox_type as XGL_BBOX_F2D or XGL_BBOX_F3D.
int dtp_vuclipd (
Xgl_ctx.......ctx,
            float                    x,      /* Coordinates of input point in
            float                    y,          Device Coordinate Space */
            float                    z)

Returns 1 if (x, y, z) is clipped by the view clip bounds, 0 if it is within the bounds, and -1 if ctx is NULL. The results of the clip checking also depend on the value of XGL_CTX_CLIP_PLANES, which determines the clip planes that are in effect. This function assumes that the VDC transform is identity.
int dtp_vpclipd (
Xgl_ctxctx,
floatx,
/* Coordinates of input point in
float........y,
Device Coordinate Space */
float........z)
Returns 1 if (x, y, z) is clipped by the viewport clip bounds, 0 if it is within the bounds, and -1 if ctx is NULL.
int dtp_mclipd (
Xgl_ctx.......ctx,
            float                    x,      /* Coordinates of input point in
            float                    y,          Model Coordinate Space */
            float                    z)

Returns 1 if point is model clipped, that is, (x,y,z) is outside the model clip volume, and 0 if the point is not clipped. Returns -1 if ctx is NULL or a 2D context (since model clipping is only defined for 3D contexts).
int dtp_vdcx (
Xgl_ctxctx,
Xgl_pt*ptp)
/* Input point */
Applies the VDC transform to the input point in place (that is, the transformed point is returned in ptp). Assumes that the view transformation is identity and works only for the default value of XGL_CTX_VDC_ORIENTATION. The dimension of the point and the context must match and the point type can only be XGL_PT_F2D or XGL_PT_F3D. Returns 0 if successful and -1 otherwise.
int dtp_devb (
Xgl_ctx.......ctx,
            Xgl_usgn32              *w,     /* Value of XGL_RAS_WIDTH */
            Xgl_usgn32              *h)     /* Value of XGL_RAS_HEIGHT */

Returns the raster width and height in w and h respectively. Space for w and h must have been allocated by the caller. Returns 0 if successful and -1 if there is no device associated with ctx.
int dtp_mc2dc (
Xgl_ctxctx,
Xgl_usgn32num_pt_lists,
Xgl_pt_list*pl)
Transforms the points in the point lists in the array pointed to by pl. The transformation includes model, view, and VDC transformation. Returns 0 if successful and -1 if invalid point types are given as input. The only valid point types are XGL_PT_F2D and XGL_PT_F3D.
int dtp_plcopy (
Xgl_usgn32        num_pt_lists,     /* Number of point lists to be
                                        copied */
Xgl_pt_list       pl[],              /* Array of point lists to be
                                        copied */
Xgl_pt_list       **outpl)          /* A pointer to an array of

pointers which contain pointers to copies of the elements of pl */
Copies the input point list array into outpl. Thus pl[i] is copied into (*outpl)[i]. The function allocates the space needed for outpl. Returns 0 if successful and -1 if the point type of the point lists is other than XGL_PT_F2D or XGL_PT_F3D.