Class Image_Transform

Description

The main "Image_Resize" class is a container and base class which provides the static methods for creating Image objects as well as some utility functions (maths) common to all parts of Image Resize.

The object model of DB is as follows (indentation means inheritance):

Image_Resize The base for each Image implementation. Provides default | implementations (in OO lingo virtual methods) for | the actual Image implementations as well as a bunch of | maths methods. | +-Image_GD The Image implementation for the PHP GD extension . Inherits Image_Resize When calling DB::setup for GD images the object returned is an instance of this class.

Located in /plugins/ImageManager/Classes/Transform.php (line 62)


	
			
Direct descendents
Class Description
 class Image_Transform_Driver_GD The main "Image_Resize" class is a container and base class which provides the static methods for creating Image objects as well as some utility functions (maths) common to all parts of Image Resize.
 class Image_Transform_Driver_NetPBM The main "Image_Resize" class is a container and base class which provides the static methods for creating Image objects as well as some utility functions (maths) common to all parts of Image Resize.
 class Image_Transform_Driver_IM The main "Image_Resize" class is a container and base class which provides the static methods for creating Image objects as well as some utility functions (maths) common to all parts of Image Resize.
Variable Summary
 string $image
 int $img_x
 int $img_y
 mixed $lapse_time
 mixed $lib_path
 int $new_x
 int $new_y
 mixed $resized
 string $type
 mixed $uid
Method Summary
 void addBorder ()
 void addDropShadow ()
 void addText ()
 void cleanUp (mixed $id, mixed $dir)
 PEAR_error colorarray2colorhex (mixed $color)
 PEAR_error colorhex2colorarray (mixed $colorhex)
 void createUnique (mixed $dir)
 void crop ()
 PEAR_error display (string $type, mixed $quality)
 mixed &factory (string $driver)
 void flip ()
 PEAR_error free ()
 void gamma ()
 string getImageType ()
 string getWebSafeFormat ()
 PEAR_error load (mixed $filename)
 mixed resize (mixed $new_x, mixed $new_y)
 PEAR_error save (string $filename, mixed $type, mixed $quality)
 mixed scale (mixed $size)
 none scaleByFactor (float $size)
 none scaleByLength (int $size)
 none scaleByPercentage (int $size)
 none scaleMaxX (int $new_x)
 none scaleMaxY (int $new_y)
 void uniqueStr ()
 void _get_image_details (mixed $image)
 void _set_img_x (int $size)
 void _set_img_y (int $size)
 void _set_new_x (int $size)
 void _set_new_y (int $size)
Variables
string $image = '' (line 68)

Name of the image file

int $img_x = '' (line 78)

Original image width in x direction

int $img_y = '' (line 83)

Original image width in y direction

mixed $lapse_time = 900 (line 109)
mixed $lib_path = '' (line 99)

Path the the library used

e.g. /usr/local/ImageMagick/bin/ or /usr/local/netpbm/

int $new_x = '' (line 88)

New image width in x direction

int $new_y = '' (line 93)

New image width in y direction

mixed $resized = false (line 104)

Flag to warn if image has been resized more than once before displaying or saving.

string $type = '' (line 73)

Type of the image file (eg. jpg, gif png ...)

mixed $uid = '' (line 107)
Methods
addBorder (line 549)
void addBorder ()
addDropShadow (line 544)
void addDropShadow ()
addText (line 539)
void addText ()

Redefined in descendants as:
cleanUp (line 340)
void cleanUp (mixed $id, mixed $dir)
colorarray2colorhex (line 532)

Reverse of rgb2colorname.

  • see: rgb2colorname
  • access: public
PEAR_error colorarray2colorhex (mixed $color)
colorhex2colorarray (line 517)

Reverse of rgb2colorname.

  • see: rgb2colorname
  • access: public
PEAR_error colorhex2colorarray (mixed $colorhex)
createUnique (line 365)
void createUnique (mixed $dir)
crop (line 554)
void crop ()

Redefined in descendants as:
display (line 482)

Place holder for the real display method used by extended methods to do the resizing

  • access: public
PEAR_error display (string $type, mixed $quality)
  • string $type: filename

Redefined in descendants as:
factory (line 122)

Create a new Image_resize object

  • return: a newly created Image_Transform object, or a PEAR error object on error
  • see: Image_Transform::setOption()
  • see: PEAR::isError()
mixed &factory (string $driver)
  • string $driver: name of driver class to initialize
flip (line 559)
void flip ()

Redefined in descendants as:
free (line 505)

Place holder for the real free method used by extended methods to do the resizing

  • access: public
PEAR_error free ()

Redefined in descendants as:
gamma (line 564)
void gamma ()

Redefined in descendants as:
getImageType (line 430)

Get the type of the image being manipulated

  • return: the image type
string getImageType ()
getWebSafeFormat (line 440)
  • return: web-safe image type
  • access: public
string getWebSafeFormat ()
load (line 470)

Place holder for the real load method used by extended methods to do the resizing

  • access: public
PEAR_error load (mixed $filename)

Redefined in descendants as:
resize (line 149)

Resize the Image in the X and/or Y direction If either is 0 it will be scaled proportionally

  • return: none or PEAR_error
  • access: public
mixed resize (mixed $new_x, mixed $new_y)
  • mixed $new_x: (0, number, percentage 10% or 0.1)
  • mixed $new_y: (0, number, percentage 10% or 0.1)
save (line 494)

Place holder for the real save method used by extended methods to do the resizing

  • access: public
PEAR_error save (string $filename, mixed $type, mixed $quality)
  • string $filename: filename

Redefined in descendants as:
scale (line 191)

Scale Image to a maximum or percentage

  • return: none or PEAR_error
  • access: public
mixed scale (mixed $size)
  • mixed $size: (number, percentage 10% or 0.1)
scaleByFactor (line 225)

Scales an image to a factor of its original size. For example, if my image was 640x480 and I called scaleByFactor(0.5) then the image would be resized to 320x240.

  • access: public
none scaleByFactor (float $size)
  • float $size: Factor of original size to scale to
scaleByLength (line 239)

Scales an image so that the longest side has this dimension.

  • access: public
none scaleByLength (int $size)
  • int $size: Max dimension in pixels
scaleByPercentage (line 211)

Scales an image to a percentage of its original size. For example, if my image was 640x480 and I called scaleByPercentage(10) then the image would be resized to 64x48

  • access: public
none scaleByPercentage (int $size)
  • int $size: Percentage of original size to scale to
scaleMaxX (line 165)

Scale the image to have the max x dimension specified.

none scaleMaxX (int $new_x)
  • int $new_x: Size to scale X-dimension to
scaleMaxY (line 178)

Scale the image to have the max y dimension specified.

  • access: public
none scaleMaxY (int $new_y)
  • int $new_y: Size to scale Y-dimension to
uniqueStr (line 334)
void uniqueStr ()
_get_image_details (line 257)
  • access: public
void _get_image_details (mixed $image)
_set_img_x (line 387)

Set the image width

  • since: 29/05/02 13:36:31
void _set_img_x (int $size)
  • int $size: dimension to set
_set_img_y (line 398)

Set the image height

  • since: 29/05/02 13:36:31
void _set_img_y (int $size)
  • int $size: dimension to set
_set_new_x (line 409)

Set the image width

  • since: 29/05/02 13:36:31
void _set_new_x (int $size)
  • int $size: dimension to set
_set_new_y (line 420)

Set the image height

  • since: 29/05/02 13:36:31
void _set_new_y (int $size)
  • int $size: dimension to set

Documentation generated on Mon, 13 Jun 2005 20:27:39 -0400 by phpDocumentor 1.3.0RC3