CaMykS  1.0-20181201
 All Classes Files Functions Variables Pages
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
CImage Class Reference

Public Member Functions

 __construct ($source='')
 
 check_imageManipulationEngine ()
 
 load_image ($source)
 
 save_image ($filename, $type='')
 
 is_loaded ()
 
 update_JPGQuality ($quality=75)
 
 crop ($width, $height, $position='', $bgColor='#FFFFFF')
 
 resize ($width, $height=0, $homothetic=0)
 
 sharp ($gain=40)
 
 blur ($loss=50)
 
 darken ($factor=0)
 
 lighten ($factor=0)
 
 trim ($params=array())
 
 rotate ($params=array())
 

Public Attributes

 $width
 Image current width. More...
 
 $height
 Image current height. More...
 

Private Member Functions

 _gd_load_image ($source)
 
 _gd_save_image ($filename, $type)
 
 _gd_crop ($width, $height, $position, $bgColor)
 
 _gd_resize ($width, $height, $homothetic)
 
 _gd_sharp ($gain)
 
 _gd_blur ($loss)
 
 _gd_darken ($factor)
 
 _gd_lighten ($factor)
 
 _gd_trim ($params)
 
 _gd_rotate ($params)
 
 _gd_getAllocatedColor ($color, $resource=false)
 
 _gd_convolution ($matrix, $divisor=false, $offset=0)
 
 _gd_is_transparencyEnabled ()
 
 _gd_add_transparency ()
 

Private Attributes

 $source
 Image source path. More...
 
 $resource
 Image ressource to manipulate. More...
 
 $loaded = false
 Is image loaded. More...
 
 $engine
 Image editing engine to use. More...
 
 $type
 Image type. More...
 
 $jpgQuality = 75
 JPG Quality value for compression while saving. More...
 
 $transparentReplacement = '0xFFFFFF'
 Replacement color for transparency. More...
 
 $hasTransparency = false
 Indicate if picture has transparency. More...
 

Detailed Description

CImage class.

Author
CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Constructor & Destructor Documentation

CImage::__construct (   $source = '')

Object constructor.

Parameters
string$source
Returns
boolean success

Member Function Documentation

CImage::_gd_add_transparency ( )
private

Add transparency support for current picture

Returns
void
CImage::_gd_blur (   $loss)
private

Blur image with GD.

Parameters
integer$loss
Returns
boolean success
CImage::_gd_convolution (   $matrix,
  $divisor = false,
  $offset = 0 
)
private

Execute convolution for GD.

Parameters
array$matrix
float$divisor
float$offset
Returns
boolean success
CImage::_gd_crop (   $width,
  $height,
  $position,
  $bgColor 
)
private

Crop image with GD.

Parameters
integer$width
integer$height
mixed$position
string$bgColor
Returns
boolean success
CImage::_gd_darken (   $factor)
private

Darken image with GD.

Parameters
integer$factor
Returns
boolean success
CImage::_gd_getAllocatedColor (   $color,
  $resource = false 
)
private

Return allocated color for GD.

Parameters
string$color
resource$resource
Returns
resource
CImage::_gd_is_transparencyEnabled ( )
private

Check if picture has transparency enabled

Returns
void
CImage::_gd_lighten (   $factor)
private

Lighten image with GD.

Parameters
integer$factor
Returns
boolean success
CImage::_gd_load_image (   $source)
private

Load image with GD.

Returns
boolean success
CImage::_gd_resize (   $width,
  $height,
  $homothetic 
)
private

Resize image with GD.

Parameters
integer$width
integer$height
integer$homothetic
Returns
result success
CImage::_gd_rotate (   $params)
private

Trim rotate with GD.

Parameters
array$params
Returns
boolean success
CImage::_gd_save_image (   $filename,
  $type 
)
private

Save image with GD.

Parameters
string$filename
string$type
Returns
boolean success
CImage::_gd_sharp (   $gain)
private

Sharp image with GD.

Parameters
integer$gain
Returns
boolean success
CImage::_gd_trim (   $params)
private

Trim image with GD.

Parameters
array$params
Returns
boolean success
CImage::blur (   $loss = 50)

Blur image.

Parameters
integer$loss
Returns
boolean success
CImage::check_imageManipulationEngine ( )

Check which image manipulation to use.

Returns
void
CImage::crop (   $width,
  $height,
  $position = '',
  $bgColor = '#FFFFFF' 
)

Crop image.

Parameters
integer$width
integer$height
mixed$position
string$bgColor(#transp for transparent background)
Returns
boolean success
CImage::darken (   $factor = 0)

Darken image.

Parameters
integer$factor
Returns
boolean success
CImage::is_loaded ( )

Check if image is loaded.

Returns
boolean result
CImage::lighten (   $factor = 0)

Lighten image.

Parameters
integer$factor
Returns
boolean success
CImage::load_image (   $source)

Load image resource.

Parameters
string$source
Returns
boolean result
CImage::resize (   $width,
  $height = 0,
  $homothetic = 0 
)

Resize image.

Parameters
integer$width
integer$height
integer$homothetic(0 : no / 1 : yes, use min value / 2 : yes, use max value)
Returns
boolean success
CImage::rotate (   $params = array())

Rotate image.

Parameters
array$params
Returns
boolean success
CImage::save_image (   $filename,
  $type = '' 
)

Save resource as file.

Parameters
string$filename
string$type
Returns
boolean success
CImage::sharp (   $gain = 40)

Sharp image.

Parameters
integer$gain
Returns
boolean success
CImage::trim (   $params = array())

Trim image.

Parameters
array$params
Returns
boolean success
CImage::update_JPGQuality (   $quality = 75)

Update JPEG Quality value.

Parameters
integer$quality
Returns
void

Member Data Documentation

string CImage::$engine
private

Image editing engine to use.

boolean CImage::$hasTransparency = false
private

Indicate if picture has transparency.

integer CImage::$height

Image current height.

integer CImage::$jpgQuality = 75
private

JPG Quality value for compression while saving.

boolean CImage::$loaded = false
private

Is image loaded.

Ressource CImage::$resource
private

Image ressource to manipulate.

string CImage::$source
private

Image source path.

string CImage::$transparentReplacement = '0xFFFFFF'
private

Replacement color for transparency.

string CImage::$type
private

Image type.

integer CImage::$width

Image current width.


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