Internals
[ class tree: Internals ] [ index: Internals ] [ all elements ]

Class: WideImage_Coordinate

Source Location: /Coordinate.php

Class Overview


A utility class for smart coordinates


Variables

Methods



Class Details

[line 36]
A utility class for smart coordinates



[ Top ]


Class Variables

static $coord_align = array("left", "center", "right", "top", "middle", "bottom")

[line 38]



Tags:

access:  protected

Type:   mixed


[ Top ]

static $coord_numeric = array("[0-9]+", "[0-9]+\.[0-9]+", "[0-9]+%", "[0-9]+\.[0-9]+%")

[line 39]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


static method evaluate [line 102]

static int evaluate( string $coord, int $dim, [int $sec_dim = null])

Evaluates the $coord relatively to $dim



Tags:

return:  Calculated value


Parameters:

string   $coord   A numeric value or percent string
int   $dim   Dimension
int   $sec_dim   Secondary dimension (for align)

[ Top ]

static method fix [line 167]

static int fix( mixed $value, int $dim, [int $sec_dim = null])

Calculates and fixes a smart coordinate into a numeric value



Tags:

return:  Calculated value


Parameters:

mixed   $value   Smart coordinate, relative to $dim
int   $dim   Coordinate to which $value is relative
int   $sec_dim   Secondary dimension (for align)

[ Top ]

static method fixForResize [line 237]

static array fixForResize( WideImage_Image $img, int $width, int $height)

Fix a coordinate for a resize (limits by image weight and height)



Tags:

return:  An array(width, height), fixed for resizing


Parameters:

WideImage_Image   $img  
int   $width   Width of the image
int   $height   Height of the image

[ Top ]

static method parse [line 47]

static array parse( $c, string $coord)

Parses a numeric or string representation of a corrdinate into a structure



Tags:

return:  Parsed smart coordinate


Parameters:

string   $coord   Smart coordinate
   $c  

[ Top ]


Documentation generated on Sat, 31 Jul 2010 20:37:58 +0200 by phpDocumentor 1.4.2