1draw - Methods to Draw on an Image9W




"NAME

)

draw - Methods to Draw on an Image



2page index




&SYNOPSIS

k

DrawInfo * CloneDrawInfo( const ImageInfo *image_info, const DrawInfo *draw_info );

Á

unsigned int ColorFloodfillImage( Image *image, const DrawInfo *draw_info, const PixelPacket target, const int x_offset, const int y_offset, const PaintMethod method );

E

void DestroyDrawInfo( DrawInfo *draw_info );

[

unsigned int DrawImage( Image *image, const DrawInfo *draw_info );

^

void GetDrawInfo( const ImageInfo *image_info, DrawInfo *draw_info );

À

unsigned int MatteFloodfillImage( Image *image, const PixelPacket target, const unsigned int matte, const int x_offset, const int y_offset, const PaintMethod method );

y

unsigned int OpaqueImage( Image *image, const PixelPacket target, const PixelPacket pen_color );

a

unsigned int TransparentImage( Image *image, const PixelPacket target );



2page index


$

FUNCTION *DESCRIPTIONS



2

CloneDrawInfo

U

Method CloneDrawInfo makes a duplicate of the given draw info, or if draw info is )NULL, a new one.

1

The format of the CloneDrawInfo method is:

×
DrawInfo *CloneDrawInfo ( const ImageInfo *image_info, const DrawInfo *draw_info );

AA description of each parameter follows:


L

cloned_info:

\Method CloneDrawInfo returns a duplicate of the given annotate info, or if annotate info is $NULL a new one.

J

image_info:

a structure of type ImageInfo.

H

draw_info:

a structure of type DrawInfo.



>

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.

7

The format of the ColorFloodfillImage method is:

^
unsigned int ColorFloodfillImage ( Image *image, const DrawInfo *draw_info, const PixelPacket target, const int x_offset, const int y_offset, const PaintMethod method );

AA description of each parameter follows:


@

image:

)The address of a structure of type Image.

&

draw_info:

a structure of type DrawInfo.

B

target:

;A PixelPacket structure. This is the 3RGB value of the target color.

>

x,y:

?Unsigned integers representing the current location of the pen.

B

method:

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



6

DestroyDrawInfo

W

Method DestroyDrawInfo deallocates memory associated with an DrawInfo structure.

3

The format of the DestroyDrawInfo method is:

l
void DestroyDrawInfo ( DrawInfo *draw_info );

AA description of each parameter follows:


&

draw_info:

-Specifies a pointer to an DrawInfo structure.



*

DrawImage

R

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

-

The format of the DrawImage method is:

¡
unsigned int DrawImage ( Image *image, const DrawInfo *draw_info );

AA description of each parameter follows:


"

image:

)The address of a structure of type Image.

&

draw_info:

$The address of a DrawInfo structure.



.

GetDrawInfo

=

Method GetDrawInfo initializes the DrawInfo structure.

/

The format of the GetDrawInfo method is:

¨
void GetDrawInfo ( const ImageInfo *image_info, DrawInfo *draw_info );

AA description of each parameter follows:


'

image_info:

.Specifies a pointer to an ImageInfo structure.

&

draw_info:

,Specifies a pointer to a DrawInfo structure.



>

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.

7

The format of the MatteFloodfillImage method is:

;
unsigned int MatteFloodfillImage ( Image *image, const PixelPacket target, const unsigned int matte, const int x_offset, const int y_offset, const PaintMethod method );

AA description of each parameter follows:


"

image:

)The address of a structure of type Image.

#

target:

;A PixelPacket structure. This is the 3RGB value of the target color.

@

matte:

MA integer value representing the amount of transparency.

x,y:

?Unsigned integers representing the current location of the pen.

#

method:

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



.

OpaqueImage

P

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

/

The format of the OpaqueImage method is:

ç
unsigned int OpaqueImage ( Image *image, const PixelPacket target, const PixelPacket pen_color );

AA description of each parameter follows:


"

image:

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

#

target:

%the color to search for in the image.

H

pen_color:

the color to replace it with.



8

TransparentImage

Å

Method TransparentImage creates a matte image associated with the image. All pixel locations are initially set to opaque. Any pixel that matches the specified color are set to transparent.

4

The format of the TransparentImage method is:

ª
unsigned int TransparentImage ( Image *image, const PixelPacket target );

AA description of each parameter follows:


"

image:

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

#

target:

%The color to search for in the image.
9

page index