Methods summary
public
boolean|MvcCore\Ext\Tools\Image |MvcCore\Ext\Tools\Images\IImage
|
#
Load( string $imgFullPath )
Load image into resource by given file full path.
Load image into resource by given file full path.
Parameters
Returns
Throws
RuntimeException
|
public
MvcCore\Ext\Tools\Image
|
#
Save( string $fullPath, string|MvcCore\Ext\Tools\Images\IFormat $format = \MvcCore\Ext\Tools\Images\IFormat::PNG, integer $quality = NULL )
Save image in desired full path by format and optional quality settings.
Save image in desired full path by format and optional quality settings.
Parameters
- $fullPath
- $format
png by default.
- $quality
NULL by default - no quality settings will be used.
Returns
|
public
MvcCore\Ext\Tools\Image
|
#
Resize( integer $width, integer $height )
Resize image to desired with and height without maintaining the aspect ratio.
Resize image to desired with and height without maintaining the aspect ratio.
Parameters
- $width
- Pixel width.
- $height
- Pixel height.
Returns
|
public
MvcCore\Ext\Tools\Image
|
#
Crop( integer $x, integer $y, integer $width, integer $height )
Crop image from left, top right or bottom side.
Crop image from left, top right or bottom side.
Parameters
- $x
- Pixel size to crop from left.
- $y
- Pixel size to crop from top.
- $width
- Pixel size to crop from right.
- $height
- Pixel size to crop from bottom.
Returns
|
public
MvcCore\Ext\Tools\Image
|
#
Frame( integer $width, integer $height )
Image will be resized into sizes not larger than $width
or $height params with maintaining the aspect ratio and
places without image content will be filled with transparent
background color.
Image will be resized into sizes not larger than $width
or $height params with maintaining the aspect ratio and
places without image content will be filled with transparent
background color.
Parameters
- $width
- Pixel width.
- $height
- Pixel height.
Returns
|
public
MvcCore\Ext\Tools\Image
|
#
SetBackgroundColor( string $hexColor )
Set background color for prepared image.
Set background color for prepared image.
Parameters
- $hexColor
- Color in hexadecimal format with or without leading hash.
Returns
|
public
MvcCore\Ext\Tools\Image
|
#
UnsharpMask( integer $amount, float $radius, integer $threshold )
Apply to whole image Photoshop like Unsharp Mask filter to sharp image.
This method is very time consuming!
Apply to whole image Photoshop like Unsharp Mask filter to sharp image.
This method is very time consuming!
Parameters
- $amount
- Typically: 50 - 200, min. 0, max. 500.
- $radius
- Typically: 0.5 - 1, min. 0, max. 50.
- $threshold
- Typically: 0 - 5, min. 0, max. 255.
Returns
|
public
MvcCore\Ext\Tools\Image
|
#
ApplyMask( string $maskImgFullPath )
Apply to whole image Photoshop like Channel Mask.
Image given as first argument will be used as grayscale
channel mask applied to this image instance.
This method is very time consuming!
Apply to whole image Photoshop like Channel Mask.
Image given as first argument will be used as grayscale
channel mask applied to this image instance.
This method is very time consuming!
Parameters
Returns
Throws
InvalidArgumentException
|
public
MvcCore\Ext\Tools\Image
|
#
Grayscale( )
Convert whole image to grayscale.
Convert whole image to grayscale.
Returns
|
public
MvcCore\Ext\Tools\Image
|
#
Sepia( float $threshold = 80 )
Applies a special effect to the image, similar to the effect achieved
in a photo darkroom by sepia toning. Threshold ranges from 0 to QuantumRange
and is a measure of the extent of the sepia toning. A threshold of 80 is
a good starting point for a reasonable tone.
Applies a special effect to the image, similar to the effect achieved
in a photo darkroom by sepia toning. Threshold ranges from 0 to QuantumRange
and is a measure of the extent of the sepia toning. A threshold of 80 is
a good starting point for a reasonable tone.
Parameters
Returns
|
public
MvcCore\Ext\Tools\Image
|
#
RoundCorners( float $x, float $y )
Round image corners with the same x-round and y-round sizes.
This method is very time consuming!
Round image corners with the same x-round and y-round sizes.
This method is very time consuming!
Parameters
- $x
- X-rounding.
- $y
- Y-rounding.
Returns
|
public
MvcCore\Ext\Tools\Image
|
#
Rotate( float $angle, string $hexBgColor = 'transparent' )
Rotate image with optional background color, transparent by default.
Rotate image with optional background color, transparent by default.
Parameters
- $angle
- $hexBgColor
- Color in hexadecimal format with or without leading hash. Transparent by default.
Returns
|
public
MvcCore\Ext\Tools\Image
|
#
SetBackgroundImage( string $bgImgFullPath )
Set background image. If background image has different sizes,
it's resized without maintaining the aspect ratio to the same
sizes as current image instance.
Set background image. If background image has different sizes,
it's resized without maintaining the aspect ratio to the same
sizes as current image instance.
Parameters
Returns
Throws
InvalidArgumentException
|
public
boolean
|
#
IsVectorGraphic( )
Return always FALSE , because GD graphic library doesn't
support any vector images processing. There will be triggered E_USER_NOTICE .
Return always FALSE , because GD graphic library doesn't
support any vector images processing. There will be triggered E_USER_NOTICE .
Returns
boolean
|
public
MvcCore\Ext\Tools\Image
|
#
AddOverlay( string $overlayImgFullPath, integer $x = 0, integer $y = 0, integer $alpha = NULL, integer|MvcCore\Ext\Tools\Images\IComposite $composite = \MvcCore\Ext\Tools\Images\IComposite::NORMAL )
Do nothing with image, because GD graphic library doesn't
support any overlay images processing. There will be triggered E_USER_NOTICE .
Do nothing with image, because GD graphic library doesn't
support any overlay images processing. There will be triggered E_USER_NOTICE .
Parameters
- $overlayImgFullPath
- $x
- $y
- $alpha
- $composite
Returns
Throws
InvalidArgumentException
|
public
resource
|
#
CreateEmptyImageResource( integer $width, integer $height, string $hexBgColor = 'transparent' )
Create new empty GD image resource instance.
Create new empty GD image resource instance.
Parameters
- $width
- Pixel width.
- $height
- Pixel height.
- $hexBgColor
- Color in hexadecimal format with or without leading hash.
Returns
resource
|
protected
MvcCore\Ext\Tools\Image
|
#
destroy( )
Destroy current image instance resource in RAM.
Destroy current image instance resource in RAM.
Returns
|