NAME

draw - Methods to Draw on an Image


SYNOPSIS

ColorFloodfillImage(image,target,tile,x,y,method)

DrawImage(image,annotate_info)

opacity=InsidePrimitive(primitive_info,annotate_info,target,image)

MatteFloodfillImage(image,target,matte,x,y,method)


FUNCTION DESCRIPTIONS


ColorFloodfillImage

Method ColorFloodfillImage floodfills the designated area with a color. The floodfill algorithm is strongly based on a similar algorithm in ``Graphics Gems'' by Paul Heckbert.

The format of the ColorFloodfillImage routine is:

        ColorFloodfillImage(image,target,tile,x,y,method)

A description of each parameter follows:

image:

The address of a structure of type Image.

target:

A RunlengthPacket structure. This is the RGB value of the target color.

tile:

An image representing the image to tile onto the floodplane.

x,y:

Unsigned integers representing the current location of the pen.

method:

drawing method of type PrimitiveType: floodfill or fill to border.


DrawImage

Method DrawImage draws a primitive (line, rectangle, ellipse) on the image.

The format of the DrawImage routine is:

        DrawImage(image,annotate_info)

A description of each parameter follows:

image:

The address of a structure of type Image.

annotate_info:

The address of a DrawInfo structure.


InsidePrimitive

Method InsidePrimitive returns the opacity of the pen at the (x,y) position of the image. The opacity is Opaque if the (x,y) position is within the primitive as defined in primitive_info. A value less than fully opaque and greater than fully transparent is returned for a primitive edge pixel to allow for anti-aliasing. Otherwise fully transparent is returned.

Rick Mabry provided the algorithms for anti-aliased primitives.

The format of the InsidePrimitive routine is:

        opacity=InsidePrimitive(primitive_info,annotate_info,target,image)

A description of each parameter follows:

opacity:

Method InsidePrimitive returns a pen opacity associated with the (x,y) position of the image.

primitive_info:

Specifies a pointer to a PrimitiveInfo structure.

annotate_info:

Specifies a pointer to a AnnotateInfo structure.

target:

PointInfo representing the (x,y) location in the image.

image:

The address of a structure of type Image.


MatteFloodfillImage

Method MatteFloodfillImage floodfills the designated area with a matte value. The floodfill algorithm is strongly based on a similar algorithm in ``Graphics Gems'' by Paul Heckbert.

The format of the MatteFloodfillImage routine is:

        MatteFloodfillImage(image,target,matte,x,y,method)

A description of each parameter follows:

image:

The address of a structure of type Image.

target:

A RunlengthPacket structure. This is the RGB value of the target color.

matte:

A integer value representing the amount of transparency.

x,y:

Unsigned integers representing the current location of the pen.

method:

drawing method of type PrimitiveType: floodfill or fill to border.


OpagueImage

Method OpaqueImage changes the color of an opaque pixel to the pen color.

The format of the OpaqueImage routine is:

    OpaqueImage(image,opaque_color,pen_color)

A description of each parameter follows:

image:

The address of a structure of type Image; returned from ReadImage.

opaque_color, pen_color:

A character string that contain an X11 color string.