AnewtImageDrawingContext Class Reference

Drawing context for AnewtImage. More...

List of all members.

Public Member Functions

 color_at ($x, $y)
 Return the color value of the specified pixel.
 draw_point ($x, $y)
 Draw a single point on the image.
 draw_line ($x1, $y1, $x2, $y2)
 Draw a line from one point to another point.
 draw_rectangle ($x1, $y1, $x2, $y2)
 Draw a rectangle.
 draw_filled_rectangle ($x1, $y1, $x2, $y2)
 Draw a filled rectangle.
 draw_rectangle_size ($x, $y, $width, $height)
 Draw a rectangle of a given width and height.
 draw_filled_rectangle_size ($x, $y, $width, $height)
 Draw a filled rectangle of a given width and height.
 draw_string ($x, $y, $str)
 Draw a simple string at the given point.

Private Member Functions

 __construct ($image)
 Create a new drawing context.
 _install_gd_properties ()
 Set the gd properties on the actual image instance.
 _draw_rectangle ($x1, $y1, $x2, $y2, $filled)
 Draw a rectangle.
 _draw_rectangle_size ($x, $y, $width, $height, $filled)
 Draw a rectangle of a given width and height.

Private Attributes

 $image = null
 AnewtImage instance this AnewtImageDrawingContext belongs to.


Detailed Description

Drawing context for AnewtImage.

A drawing context keeps some drawing properties and offers drawing methods. Note that not all functions might be available on your particular setup (eg. anti-aliasing).

See also:
AnewtImage

AnewtImage::create_drawing_context

Todo:
Add proper Doxygen method grouping marks.

Definition at line 25 of file drawingcontext.lib.php.


Constructor & Destructor Documentation

AnewtImageDrawingContext::__construct ( image  )  [private]

Create a new drawing context.

Do not instantiate this class directly, use AnewtImage::create_drawing_context instead.

Parameters:
$image A valid AnewtImage instance.
See also:
AnewtImage::create_drawing_context

Reimplemented from AnewtContainer.

Definition at line 41 of file drawingcontext.lib.php.


Member Function Documentation

AnewtImageDrawingContext::_install_gd_properties (  )  [private]

Set the gd properties on the actual image instance.

All drawing methods should call this method before any GD function is invoked. This method shouldn't be called by non-drawing methods.

Definition at line 64 of file drawingcontext.lib.php.

AnewtImageDrawingContext::color_at ( x,
y 
)

Return the color value of the specified pixel.

Parameters:
$x X coordinate
$y Y coordinate
Returns:
Color value

Definition at line 96 of file drawingcontext.lib.php.

AnewtImageDrawingContext::draw_point ( x,
y 
)

Draw a single point on the image.

Parameters:
$x X coordinate
$y Y coordinate

Definition at line 108 of file drawingcontext.lib.php.

AnewtImageDrawingContext::draw_line ( x1,
y1,
x2,
y2 
)

Draw a line from one point to another point.

Parameters:
$x1 X coordinate of the first point
$y1 Y coordinate of the first point
$x2 X coordinate of the second point
$y2 Y coordinate of the second point

Definition at line 126 of file drawingcontext.lib.php.

AnewtImageDrawingContext::_draw_rectangle ( x1,
y1,
x2,
y2,
filled 
) [private]

Draw a rectangle.

Parameters:
$x1 X coordinate of the top-left point
$y1 X coordinate of the top-left point
$x2 X coordinate of the bottom-right point
$y2 X coordinate of the bottom-right point
$filled Whether the rectangle is filled

Definition at line 145 of file drawingcontext.lib.php.

AnewtImageDrawingContext::_draw_rectangle_size ( x,
y,
width,
height,
filled 
) [private]

Draw a rectangle of a given width and height.

Negative width and height values cause the rectangle to be drawn from the bottom right coordinate, extending to the top left.

Parameters:
$x X coordinate of the top-left point
$y X coordinate of the top-left point
$width Width of the rectangle
$height Height of the rectangle
$filled Whether the rectangle is filled

Definition at line 197 of file drawingcontext.lib.php.

AnewtImageDrawingContext::draw_rectangle ( x1,
y1,
x2,
y2 
)

Draw a rectangle.

Parameters:
$x1 X coordinate of the top-left point
$y1 X coordinate of the top-left point
$x2 X coordinate of the bottom-right point
$y2 X coordinate of the bottom-right point

Definition at line 236 of file drawingcontext.lib.php.

AnewtImageDrawingContext::draw_filled_rectangle ( x1,
y1,
x2,
y2 
)

Draw a filled rectangle.

Parameters:
$x1 X coordinate of the top-left point
$y1 X coordinate of the top-left point
$x2 X coordinate of the bottom-right point
$y2 X coordinate of the bottom-right point

Definition at line 249 of file drawingcontext.lib.php.

AnewtImageDrawingContext::draw_rectangle_size ( x,
y,
width,
height 
)

Draw a rectangle of a given width and height.

Negative width and height values cause the rectangle to be drawn from the bottom right coordinate, extending to the top left.

Parameters:
$x X coordinate of the top-left point
$y X coordinate of the top-left point
$width Width of the rectangle
$height Height of the rectangle

Definition at line 264 of file drawingcontext.lib.php.

AnewtImageDrawingContext::draw_filled_rectangle_size ( x,
y,
width,
height 
)

Draw a filled rectangle of a given width and height.

Negative width and height values cause the rectangle to be drawn from the bottom right coordinate, extending to the top left.

Parameters:
$x X coordinate of the top-left point
$y X coordinate of the top-left point
$width Width of the rectangle
$height Height of the rectangle

Definition at line 279 of file drawingcontext.lib.php.

AnewtImageDrawingContext::draw_string ( x,
y,
str 
)

Draw a simple string at the given point.

Parameters:
$x X coordinate
$y y coordinate
$str String to draw
Todo:
This method doesn't work like it really should

Definition at line 296 of file drawingcontext.lib.php.


The documentation for this class was generated from the following file:

Generated on Sun Aug 2 22:54:37 2009 for Anewt by  doxygen 1.5.9