Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Image_Manip Class Reference

Static Public Member Functions

static gradientPalette ($input, $output, $colour_a, $colour_b)
 
static remapColour ($input, $output, $colour_map, $tolerance=0.2)
 
static resize ($input, $output, $w, $h)
 
static fromFile ($input)
 
static toFile ($image, $output, $jpeg_quality=80)
 

Detailed Description

Definition at line 30 of file image_manip.inc.

Member Function Documentation

static fromFile (   $input)
static

returns the image resource for the passed image file

Parameters
string$inputthe input image file
Returns
mixed image resource or false

Definition at line 192 of file image_manip.inc.

static gradientPalette (   $input,
  $output,
  $colour_a,
  $colour_b 
)
static

Takes a link to an image file with an (assumed) greyscale palette Then replaces the Black<->White with ColourA<->ColourB And outputs an a new file

Parameters
string$inputthe input image file
string$outputthe output image file
string$colour_ahex string or html colour name
string$colour_bhex string or html colour name
Returns
boolean

Definition at line 46 of file image_manip.inc.

static remapColour (   $input,
  $output,
  $colour_map,
  $tolerance = 0.2 
)
static

Takes a link to an image file with an (assumed) greyscale palette $colour_map is an associative array whose 'key' colour in the image and replaces if with the 'value' colour. The colours are in the form of HTML colour codes e.g. '5627e8', 'goldenrod'

Parameters
string$inputthe input image file
string$outputthe output image file
Array$colour_mapIt find the 'key' colour in the image and replaced if with the 'value' colour. Colours are in hex string or html colour name
float$tolerance
Returns
boolean

Definition at line 99 of file image_manip.inc.

static resize (   $input,
  $output,
  $w,
  $h 
)
static

Resizes an image

Parameters
string$inputthe input image file
string$outputthe output image file
int$wwidth of new image
int$hheight of new image
Returns
boolean

Definition at line 141 of file image_manip.inc.

static toFile (   $image,
  $output,
  $jpeg_quality = 80 
)
static

Write the image into the output file

Parameters
resource$imagethe image resource to output
string$outputthe output image file
int$jpeg_qualitynumber between 0 and 100
Returns
boolean

Definition at line 235 of file image_manip.inc.


The documentation for this class was generated from the following file: