Class Asido

Description

Asido API

This class stores the Asido API for some basic image-processing operations like resizing, watermarking and converting.

Located in /class.asido.php (line 282)


	
			
Method Summary
 Asido_Color color (integer $red, integer $green, integer $blue)
 boolean convert (Asido_Image &$image, string $mime_type)
 boolean copy (Asido_Image &$image, string $applied_image, integer $x, integer $y)
 boolean crop (Asido_Image &$image, integer $x, integer $y, integer $width, integer $height)
 boolean driver (string $driver_name)
 boolean fit (Asido_Image &$image, integer $width, integer $height)
 boolean flip (Asido_Image &$image)
 boolean flop (Asido_Image &$image)
 boolean frame (Asido_Image &$image, integer $width, integer $height, [Asido_Color $color = null])
 array get_supported_types ([mixed $mode = ASIDO_SUPPORT_READ_WRITE])
 boolean grayscale (Asido_Image &$image)
 boolean greyscale (Asido_Image &$image)
 boolean height (Asido_Image &$image, integer $height)
 Asido_Image image ([string $source = null], [string $target = null])
 array is_format_supported (string $mime_type, [mixed $mode = ASIDO_SUPPORT_READ_WRITE])
 boolean resize (Asido_Image &$image, integer $width, integer $height, [mixed $mode = ASIDO_RESIZE_PROPORTIONAL])
 boolean rotate (Asido_Image &$image, float $angle, [Asido_Color $color = null])
 boolean stretch (Asido_Image &$image, integer $width, integer $height)
 void trigger_abstract_error (string $class, mixed $function, string $function )
 string version ()
 boolean watermark (Asido_Image &$image, string $watermark_image, [mixed $position = ASIDO_WATERMARK_BOTTOM_RIGHT], [mixed $scalable = ASIDO_WATERMARK_SCALABLE_ENABLED], [float $scalable_factor = ASIDO_WATERMARK_SCALABLE_FACTOR])
 boolean width (Asido_Image &$image, integer $width)
 string __driver_classname (string $driver_name)
 string __driver_filename (string $driver_name)
Methods
color (line 811)

Return an color object (Asido_Color) with the provided RGB channels

  • static:
  • access: public
Asido_Color color (integer $red, integer $green, integer $blue)
  • integer $red: the value has to be from 0 to 255
  • integer $green: the value has to be from 0 to 255
  • integer $blue: the value has to be from 0 to 255
convert (line 696)

Convert an image from one file-type to another

Use this method to convert a previously created Asido_Image object from its original file-type to another.

  • static:
  • access: public
boolean convert (Asido_Image &$image, string $mime_type)
  • Asido_Image &$image
  • string $mime_type: MIME type of the file-type to which this image should be converted to
copy (line 828)

Copy an image onto an already created Acudo_Image object

  • static:
  • access: public
boolean copy (Asido_Image &$image, string $applied_image, integer $x, integer $y)
  • Asido_Image &$image
  • string $applied_image: filepath to the image that is going to be copied
  • integer $x
  • integer $y
crop (line 851)

Crop an already created Acudo_Image object

  • static:
  • access: public
boolean crop (Asido_Image &$image, integer $x, integer $y, integer $width, integer $height)
  • Asido_Image &$image
  • integer $x
  • integer $y
  • integer $width
  • integer $height
driver (line 310)

Set a driver

Set a driver as active by providing its name as argument to this static method

  • static:
  • access: public
boolean driver (string $driver_name)
  • string $driver_name
fit (line 640)

Resize an image by "fitting" in the provided width and height

Use this method to resize a previously created Asido_Image object if it is bigger then the "frame" set by the provided width and height: if it is smaller it will not be resized

  • static:
  • access: public
boolean fit (Asido_Image &$image, integer $width, integer $height)
flip (line 872)

Creates a vertical mirror (flip) by reflecting the pixels around the central X-axis

  • static:
  • access: public
boolean flip (Asido_Image &$image)
flop (line 888)

Creates a horizontal mirror (flop) by reflecting the pixels around the central Y-axis

  • static:
  • access: public
boolean flop (Asido_Image &$image)
frame (line 672)

Resize an image by "framing" it with the provided width and height

Use this method to resize a previously created Asido_Image object by placing it inside the "frame" set by the provided width and height. First the image will be resized in the same manner as Asido::fit() does, and then it will be placed in the center of a canvas with the proportions of the provided width and height (achieving a "Passepartout" framing effect). The background of the "passepartout" is set by the $color argument

  • static:
  • access: public
boolean frame (Asido_Image &$image, integer $width, integer $height, [Asido_Color $color = null])
get_supported_types (line 401)

Get the supported mime-types by the loaded driver

  • static:
  • access: public
array get_supported_types ([mixed $mode = ASIDO_SUPPORT_READ_WRITE])
  • mixed $mode
grayscale (line 760)

Grayscale the provided image

  • static:
  • access: public
boolean grayscale (Asido_Image &$image)
greyscale (line 776)

Grayscale the provided image

  • static:
  • access: public
boolean greyscale (Asido_Image &$image)
height (line 588)

Resize an image by making it fit a particular height

Use this method to resize a previously created Asido_Image object by making it fit a particular height while keeping the proportions ratio.

  • static:
  • access: public
boolean height (Asido_Image &$image, integer $height)
image (line 509)

Get a new image object

  • static:
  • access: public
Asido_Image image ([string $source = null], [string $target = null])
  • string $source: source image for the image operations
  • string $target: target image for the image operations
is_format_supported (line 426)

Checks whether a mime-type is supported

  • static:
  • access: public
array is_format_supported (string $mime_type, [mixed $mode = ASIDO_SUPPORT_READ_WRITE])
  • string $mime_type
  • mixed $mode
resize (line 538)

Resize an image

Use this method to resize a previously created Asido_Image object. The resize operation can be performed in three modes. The proportional mode set by ASIDO_RESIZE_PROPORTIONAL will attempt to fit the image inside the "frame" create by the $width and $height arguments, while the stretch mode set by ASIDO_RESIZE_STRETCH will stretch the image if necessary to fit into that "frame". The "fitting" mode set by ASIDO_RESIZE_FIT will attempt to resize the image proportionally only if it does not fit inside the "frame" set by the provided width and height: if it does fit, the image will not be resized at all.

  • static:
  • access: public
boolean resize (Asido_Image &$image, integer $width, integer $height, [mixed $mode = ASIDO_RESIZE_PROPORTIONAL])
  • Asido_Image &$image
  • integer $width
  • integer $height
  • mixed $mode: mode for resizing the image: either ASIDO_RESIZE_STRETCH or ASIDO_RESIZE_PROPORTIONAL or ASIDO_RESIZE_FIT
rotate (line 791)

Rotate the provided image (clockwise)

  • static:
  • access: public
boolean rotate (Asido_Image &$image, float $angle, [Asido_Color $color = null])
  • Asido_Image &$image
  • float $angle
  • Asido_Color $color: background color for when non-rectangular angles are used
stretch (line 614)

Resize an image by stretching it by the provided width and height

Use this method to resize a previously created Asido_Image object by stretching it to fit a particular height without keeping the proportions ratio.

  • static:
  • access: public
boolean stretch (Asido_Image &$image, integer $width, integer $height)
trigger_abstract_error (line 968)

Output an error when trying to access an abstract method

  • static:
  • access: public
void trigger_abstract_error (string $class, mixed $function, string $function )
  • string $class
  • string $function
version (line 293)

Get version of Asido release

  • static:
  • access: public
string version ()
watermark (line 735)

Watermark an image

Use this method to watermark a previously create Asido_Image object. You can set the position of the watermark (the gravity) by using each of the nine available "single" positions (single means the watermark will appear only once), or the "tile" position, which applied the watermark all over the image like a tiled wallpaper. If the watermark image is larger than the image that is supposed to be watermarked you can shrink the watermark image: the scale of its shrinking is determined by the $scalable_factor argument.

  • static:
  • access: public
boolean watermark (Asido_Image &$image, string $watermark_image, [mixed $position = ASIDO_WATERMARK_BOTTOM_RIGHT], [mixed $scalable = ASIDO_WATERMARK_SCALABLE_ENABLED], [float $scalable_factor = ASIDO_WATERMARK_SCALABLE_FACTOR])
  • Asido_Image &$image
  • string $watermark_image: path to the file which is going to be use as watermark
  • mixed $position: position(gravity) of the watermark: the available values are ASIDO_WATERMARK_TOP_LEFT, ASIDO_WATERMARK_TOP_CENTER, ASIDO_WATERMARK_TOP_RIGHT, ASIDO_WATERMARK_MIDDLE_LEFT, ASIDO_WATERMARK_MIDDLE_CENTER, ASIDO_WATERMARK_MIDDLE_RIGHT, ASIDO_WATERMARK_BOTTOM_LEFT, ASIDO_WATERMARK_BOTTOM_CENTER, ASIDO_WATERMARK_BOTTOM_RIGHT and ASIDO_WATERMARK_TILE
  • mixed $scalable: whether to shrink the watermark or not if the watermark image is bigger than the image that is supposed to be watermarked.
  • float $scalable_factor: watermark scaling factor
width (line 563)

Resize an image by making it fit a particular width

Use this method to resize a previously created Asido_Image object by making it fit a particular width while keeping the proportions ratio.

  • static:
  • access: public
boolean width (Asido_Image &$image, integer $width)
__driver_classname (line 387)

Compose the classname for a driver

If you want to use a different mechanism for composing driver's classname, then override this method in a subclass of Asido

  • static:
  • access: protected
string __driver_classname (string $driver_name)
  • string $driver_name
__driver_filename (line 371)

Compose the filename for a driver

If you want to use a different mechanism for composing driver's filename, then override this method in a subclass of Asido

  • static:
  • access: protected
string __driver_filename (string $driver_name)
  • string $driver_name

Documentation generated on Mon, 09 Apr 2007 23:57:01 +0300 by phpDocumentor 1.3.0RC4