DATASERV (kgeom) functions


LIBRARY ROUTINE

kgeom_new_has_alpha - cast a geometry object to one with a new has_alpha

LIBRARY CALL

kgeom_object *
kgeom_new_has_alpha(
   kgeom_object *object, 
   int           new_has_alpha)

INPUT

OUTPUT

none

RETURN VALUE

a pointer to the cast object on success, NULL on failure

DESCRIPTION

This function will "cast" an existing geometry object to have a new value of has_alpha. If the requested has_alpha value is different than the has_alpha value of the provided object, then a new object is returned which matches the original object, but has the requested has_alpha value.

Specifically, this routine will adjust the size of the color vectors contained in each primitive of the given object to match the requested has_alpha value.

This function is intended to simplify processing. For example, a routine which only wants color data with alpha values can use this function to guarantee that the geometry it will process has only color data with alpha values.

The cast geometry object is a distinct from the original geometry object; it is constructed by first making a copy of the original geometry object and then adjusting the size of color vectors so that they include an alpha component. The original object will be destroyed after the copy. If there are no changes necessary, then the original object will be returned.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$DATASERV/objects/library/kgeom/src/cast.c

SEE ALSO

kgeom(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.