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

Class: Image_Transform_Driver_GD

Source Location: /main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/GD.php

Class Overview

Image_Transform
   |
   --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.


Author(s):

Version:

  • 1.00

Variables

Methods


Inherited Variables

Inherited Methods

Class: Image_Transform

Image_Transform::addBorder()
Image_Transform::addDropShadow()
Image_Transform::addText()
Image_Transform::cleanUp()
Image_Transform::colorarray2colorhex()
Reverse of rgb2colorname.
Image_Transform::colorhex2colorarray()
Reverse of rgb2colorname.
Image_Transform::createUnique()
Image_Transform::crop()
Image_Transform::display()
Place holder for the real display method used by extended methods to do the resizing
Image_Transform::factory()
Create a new Image_resize object
Image_Transform::flip()
Image_Transform::free()
Place holder for the real free method used by extended methods to do the resizing
Image_Transform::gamma()
Image_Transform::getImageType()
Get the type of the image being manipulated
Image_Transform::getWebSafeFormat()
Image_Transform::load()
Place holder for the real load method used by extended methods to do the resizing
Image_Transform::resize()
Resize the Image in the X and/or Y direction If either is 0 it will be scaled proportionally
Image_Transform::save()
Place holder for the real save method used by extended methods to do the resizing
Image_Transform::scale()
Scale Image to a maximum or percentage
Image_Transform::scaleByFactor()
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.
Image_Transform::scaleByLength()
Scales an image so that the longest side has this dimension.
Image_Transform::scaleByPercentage()
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
Image_Transform::scaleMaxX()
Scale the image to have the max x dimension specified.
Image_Transform::scaleMaxY()
Scale the image to have the max y dimension specified.
Image_Transform::uniqueStr()
Image_Transform::_get_image_details()
Image_Transform::_parse_size()
Parse input and convert If either is 0 it will be scaled proportionally
Image_Transform::_resize()
Place holder for the real resize method used by extended methods to do the resizing
Image_Transform::_set_img_x()
Set the image width
Image_Transform::_set_img_y()
Set the image height
Image_Transform::_set_new_x()
Set the image width
Image_Transform::_set_new_y()
Set the image height

Class Details

[line 47]
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.




Tags:

author:  Peter Bowyer <peter@mapledesign.co.uk>
version:  1.00


[ Top ]


Class Variables

$imageHandle =  ''

[line 52]

Holds the image file for manipulation


Type:   mixed


[ Top ]

$old_image =  ''

[line 57]

Holds the original image file


Type:   mixed


[ Top ]



Class Methods


method addText [line 109]

none addText( array $params)

addText



Tags:

see:  PEAR::isError()


Overrides Image_Transform::addText() (parent method not documented)

Parameters:

array   $params   options Array contains options array( 'text' The string to draw 'x' Horizontal position 'y' Vertical Position 'Color' Font color 'font' Font to be used 'size' Size of the fonts in pixel 'resize_first' Tell if the image has to be resized before drawing the text )

[ Top ]

method crop [line 377]

void crop( $new_x, $new_y, $new_width, $new_height, int $crop_x, int $crop_y, int $crop_width, int $crop_height)

Crop the image



Overrides Image_Transform::crop() (parent method not documented)

Parameters:

int   $crop_x   left column of the image
int   $crop_y   top row of the image
int   $crop_width   new cropped image width
int   $crop_height   new cropped image height
   $new_x  
   $new_y  
   $new_width  
   $new_height  

[ Top ]

method display [line 478]

none display( [string $type = ''], [int $quality = 75])

Display image without saving and lose changes



Overrides Image_Transform::display() (Place holder for the real display method used by extended methods to do the resizing)

Parameters:

string   $type   type (JPG,PNG...);
int   $quality   quality 75

[ Top ]

method flip [line 403]

void flip( boolean $horizontal)

Flip the image horizontally or vertically



Overrides Image_Transform::flip() (parent method not documented)

Parameters:

boolean   $horizontal   true if horizontal flip, vertical otherwise

[ Top ]

method free [line 500]

none free( )

Destroy image handle



Overrides Image_Transform::free() (Place holder for the real free method used by extended methods to do the resizing)

[ Top ]

method gamma [line 438]

none gamma( [float $outputgamma = 1.0])

Adjust the image gamma



Overrides Image_Transform::gamma() (parent method not documented)

Parameters:

float   $outputgamma  

[ Top ]

method Image_Transform_GD [line 66]

mixed Image_Transform_GD( )

Check settings



Tags:

return:  true or or a PEAR error object on error
see:  PEAR::isError()


[ Top ]

method load [line 79]

mixed load( string $image)

Load image



Tags:

return:  none or a PEAR error object on error
see:  PEAR::isError()


Overrides Image_Transform::load() (Place holder for the real load method used by extended methods to do the resizing)

Parameters:

string   $image   filename

[ Top ]

method rotate [line 157]

mixed rotate( int $angle, [array $options = null])

Rotate image by the given angle Uses a fast rotation algorythm for custom angles or lines copy for multiple of 90 degrees



Tags:

return:  none or a PEAR error object on error
author:  Pierre-Alain Joye
see:  PEAR::isError()


Parameters:

int   $angle   Rotation angle
array   $options   array( 'autoresize'=>true|false, 'color_mask'=>array(r,g,b), named color or #rrggbb )

[ Top ]

method save [line 452]

none save( $filename $filename, [$quality $type = ''], [$types $quality = 85])

Save the image file



Overrides Image_Transform::save() (Place holder for the real save method used by extended methods to do the resizing)

Parameters:

$filename   $filename   string the name of the file to write to
$quality   $type   int output DPI, default is 85
$types   $quality   string define the output format, default is the current used format

[ Top ]

method _resize [line 346]

true _resize( $new_x $new_x, $new_y $new_y)

Resize Action

For GD 2.01+ the new copyresampled function is used It uses a bicubic interpolation algorithm to get far better result.




Tags:

return:  on success or pear error
see:  PEAR::isError()


Overrides Image_Transform::_resize() (Place holder for the real resize method used by extended methods to do the resizing)

Parameters:

$new_x   $new_x   int new width
$new_y   $new_y   int new height

[ Top ]


Documentation generated on Thu, 12 Jun 2008 13:32:39 -0500 by phpDocumentor 1.4.1