Fat-Free Framework: Image Class Reference

Fat-Free-Framework

Fat-Free Framework  3.1.0 API Reference

Image manipulation tools. More...

Public Member Functions

 rgb ($color)
 
 invert ()
 
 brightness ($level)
 
 contrast ($level)
 
 grayscale ()
 
 smooth ($level)
 
 emboss ()
 
 sepia ()
 
 pixelate ($size)
 
 blur ($selective=FALSE)
 
 sketch ()
 
 hflip ()
 
 vflip ()
 
 crop ($x1, $y1, $x2, $y2)
 
 resize ($width, $height, $crop=TRUE, $enlarge=TRUE)
 
 rotate ($angle)
 
 overlay (Image $img, $align=NULL)
 
 identicon ($str, $size=64, $blocks=4)
 
 captcha ($font, $size=24, $len=5, $key=NULL, $path='')
 
 width ()
 
 height ()
 
 render ()
 
 dump ()
 
 save ()
 
 restore ($state=1)
 
 undo ()
 
 __construct ($file=NULL, $flag=FALSE, $path='')
 
 __destruct ()
 

Public Attributes

 $data
 Image resource.
 
 $flag =FALSE
 Enable/disable history.
 
 $count =0
 Filter count.
 
const E_Color ='Invalid color specified: %s'
 
const E_Font ='CAPTCHA font not found'
 
const POS_Left =1
 
const POS_Center =2
 
const POS_Right =4
 
const POS_Top =8
 
const POS_Middle =16
 
const POS_Bottom =32
 

Detailed Description

Image manipulation tools.

Constructor & Destructor Documentation

Image::__construct (   $file = NULL,
  $flag = FALSE,
  $path = '' 
)

Instantiate image

Parameters
$filestring
$flagbool
$pathstring
Image::__destruct ( )

Wrap-up

Returns
NULL

Member Function Documentation

Image::blur (   $selective = FALSE)

Blur the image using Gaussian filter

Returns
object
Parameters
$selectivebool
Image::brightness (   $level)

Adjust brightness (range:-255 to 255)

Returns
object
Parameters
$levelint
Image::captcha (   $font,
  $size = 24,
  $len = 5,
  $key = NULL,
  $path = '' 
)

Generate CAPTCHA image

Returns
object|FALSE
Parameters
$fontstring
$sizeint
$lenint
$keystring
$pathstring
Image::contrast (   $level)

Adjust contrast (range:-100 to 100)

Returns
object
Parameters
$levelint
Image::crop (   $x1,
  $y1,
  $x2,
  $y2 
)

Crop the image

Returns
object
Parameters
$x1int
$y1int
$x2int
$y2int
Image::dump ( )

Return image as a string

Returns
string
Image::emboss ( )

Emboss the image

Returns
object
Image::grayscale ( )

Convert to grayscale

Returns
object
Image::height ( )

Return image height

Returns
int
Image::hflip ( )

Flip on horizontal axis

Returns
object
Image::identicon (   $str,
  $size = 64,
  $blocks = 4 
)

Generate identicon

Returns
object
Parameters
$strstring
$sizeint
$blocksint
Image::invert ( )

Invert image

Returns
object
Image::overlay ( Image  $img,
  $align = NULL 
)

Apply an image overlay

Returns
object
Parameters
$imgobject
$alignint
Image::pixelate (   $size)

Pixelate the image

Returns
object
Parameters
$sizeint
Image::render ( )

Send image to HTTP client

Returns
NULL
Image::resize (   $width,
  $height,
  $crop = TRUE,
  $enlarge = TRUE 
)

Resize image (Maintain aspect ratio); Crop relative to center if flag is enabled; Enlargement allowed if flag is enabled

Returns
object
Parameters
$widthint
$heightint
$cropbool
$enlargebool
Image::restore (   $state = 1)

Revert to specified state

Returns
object
Parameters
$stateint
Image::rgb (   $color)

Convert RGB hex triad to array

Returns
array|FALSE
Parameters
$colorint
Image::rotate (   $angle)

Rotate image

Returns
object
Parameters
$angleint
Image::save ( )

Save current state

Returns
object
Image::sepia ( )

Apply sepia effect

Returns
object
Image::sketch ( )

Apply sketch effect

Returns
object
Image::smooth (   $level)

Adjust smoothness

Returns
object
Parameters
$levelint
Image::undo ( )

Undo most recently applied filter

Returns
object
Image::vflip ( )

Flip on vertical axis

Returns
object
Image::width ( )

Return image width

Returns
int

The documentation for this class was generated from the following file:
  • image.php
Generated on Mon Aug 19 2013 21:27:47 for Fat-Free Framework by   doxygen 1.8.4