Image manipulating object.
More...
Image manipulating object.
Engine / Object Library
- Author
- CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m
- Version
- 1.0.2.2
- Date
- Creation: Nov 2011
-
Modification: Oct 2021
- Copyright
- 2011 - 2021 CaMykS Team
- Note
- This program is distributed as is - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- Todo:
Finalise crop calculation in _gd_rotate method.
Complete method documentation with params details.
CImage class.
- Author
- CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m
◆ __construct()
CImage::__construct |
( |
|
$source = '' | ) |
|
Object constructor.
- Parameters
-
- Returns
- boolean success
◆ check_imageManipulationEngine()
CImage::check_imageManipulationEngine |
( |
| ) |
|
Check which image manipulation to use.
- Returns
- void
◆ load_image()
CImage::load_image |
( |
|
$source | ) |
|
Load image resource.
- Parameters
-
- Returns
- boolean result
◆ save_image()
CImage::save_image |
( |
|
$filename, |
|
|
|
$type = '' |
|
) |
| |
Save resource as file.
- Parameters
-
string | $filename | |
string | $type | |
- Returns
- boolean success
◆ is_loaded()
Check if image is loaded.
- Returns
- boolean result
◆ update_JPGQuality()
CImage::update_JPGQuality |
( |
|
$quality = 75 | ) |
|
Update JPEG Quality value.
- Parameters
-
- Returns
- void
◆ crop()
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
◆ resize()
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
◆ sharp()
CImage::sharp |
( |
|
$gain = 40 | ) |
|
Sharp image.
- Parameters
-
- Returns
- boolean success
◆ blur()
CImage::blur |
( |
|
$loss = 50 | ) |
|
Blur image.
- Parameters
-
- Returns
- boolean success
◆ darken()
CImage::darken |
( |
|
$factor = 0 | ) |
|
Darken image.
- Parameters
-
- Returns
- boolean success
◆ lighten()
CImage::lighten |
( |
|
$factor = 0 | ) |
|
Lighten image.
- Parameters
-
- Returns
- boolean success
◆ trim()
CImage::trim |
( |
|
$params = array() | ) |
|
Trim image.
- Parameters
-
- Returns
- boolean success
◆ rotate()
CImage::rotate |
( |
|
$params = array() | ) |
|
Rotate image.
- Parameters
-
- Returns
- boolean success
◆ _gd_load_image()
CImage::_gd_load_image |
( |
|
$source | ) |
|
|
private |
Load image with GD.
- Returns
- boolean success
◆ _gd_save_image()
CImage::_gd_save_image |
( |
|
$filename, |
|
|
|
$type |
|
) |
| |
|
private |
Save image with GD.
- Parameters
-
string | $filename | |
string | $type | |
- Returns
- boolean success
◆ _gd_crop()
CImage::_gd_crop |
( |
|
$width, |
|
|
|
$height, |
|
|
|
$position, |
|
|
|
$bgColor |
|
) |
| |
|
private |
Crop image with GD.
- Parameters
-
integer | $width | |
integer | $height | |
mixed | $position | |
string | $bgColor | |
- Returns
- boolean success
◆ _gd_resize()
CImage::_gd_resize |
( |
|
$width, |
|
|
|
$height, |
|
|
|
$homothetic |
|
) |
| |
|
private |
Resize image with GD.
- Parameters
-
integer | $width | |
integer | $height | |
integer | $homothetic | |
- Returns
- result success
◆ _gd_sharp()
CImage::_gd_sharp |
( |
|
$gain | ) |
|
|
private |
Sharp image with GD.
- Parameters
-
- Returns
- boolean success
◆ _gd_blur()
CImage::_gd_blur |
( |
|
$loss | ) |
|
|
private |
Blur image with GD.
- Parameters
-
- Returns
- boolean success
◆ _gd_darken()
CImage::_gd_darken |
( |
|
$factor | ) |
|
|
private |
Darken image with GD.
- Parameters
-
- Returns
- boolean success
◆ _gd_lighten()
CImage::_gd_lighten |
( |
|
$factor | ) |
|
|
private |
Lighten image with GD.
- Parameters
-
- Returns
- boolean success
◆ _gd_trim()
CImage::_gd_trim |
( |
|
$params | ) |
|
|
private |
Trim image with GD.
- Parameters
-
- Returns
- boolean success
◆ _gd_rotate()
CImage::_gd_rotate |
( |
|
$params | ) |
|
|
private |
Trim rotate with GD.
- Parameters
-
- Returns
- boolean success
◆ _gd_getAllocatedColor()
CImage::_gd_getAllocatedColor |
( |
|
$color, |
|
|
|
$resource = false |
|
) |
| |
|
private |
Return allocated color for GD.
- Parameters
-
string | $color | |
resource | $resource | |
- Returns
- resource
◆ _gd_convolution()
CImage::_gd_convolution |
( |
|
$matrix, |
|
|
|
$divisor = false , |
|
|
|
$offset = 0 |
|
) |
| |
|
private |
Execute convolution for GD.
- Parameters
-
array | $matrix | |
float | $divisor | |
float | $offset | |
- Returns
- boolean success
◆ _gd_is_transparencyEnabled()
CImage::_gd_is_transparencyEnabled |
( |
| ) |
|
|
private |
Check if picture has transparency enabled
- Returns
- void
◆ _gd_add_transparency()
CImage::_gd_add_transparency |
( |
| ) |
|
|
private |
Add transparency support for current picture
- Returns
- void
◆ $source
◆ $resource
Ressource CImage::$resource |
|
private |
Image ressource to manipulate.
◆ $loaded
boolean CImage::$loaded = false |
|
private |
◆ $engine
Image editing engine to use.
◆ $type
◆ $width
◆ $height
◆ $jpgQuality
integer CImage::$jpgQuality = 75 |
|
private |
JPG Quality value for compression while saving.
◆ $transparentReplacement
string CImage::$transparentReplacement = '0xFFFFFF' |
|
private |
Replacement color for transparency.
◆ $hasTransparency
boolean CImage::$hasTransparency = false |
|
private |
Indicate if picture has transparency.
The documentation for this class was generated from the following file: