AbstractAdapter
in package
Abstract adapter class
Tags
Table of Contents
- IMAGE_CMYK = 3
- IMAGE_GRAY = 1
- Colorspace constants
- IMAGE_RGB = 2
- $adjust : AdjustInterface
- Image adjust object
- $colorspace : int
- Image colorspace
- $draw : DrawInterface
- Image draw object
- $effect : EffectInterface
- Image effect object
- $exif : array<string|int, mixed>
- EXIF data
- $filter : FilterInterface
- Image filter object
- $format : string
- Image format
- $height : int
- Image height
- $indexed : bool
- Index color flag
- $layer : LayerInterface
- Image layer object
- $name : string
- Image name
- $resource : mixed
- Image resource
- $type : TypeInterface
- Image type object
- $width : int
- Image width
- __construct() : mixed
- Constructor
- __get() : mixed
- Magic get method to return a manipulation object
- __toString() : string
- Output the image
- adjust() : AdjustInterface
- Get the image adjust object
- convert() : AbstractAdapter
- Convert the image object to another format
- create() : AbstractAdapter
- Create a new image resource
- createColor() : mixed
- Create and return a color.
- createIndex() : AbstractAdapter
- Create a new indexed image resource
- createResource() : void
- Create the image resource
- crop() : AbstractAdapter
- Crop the image object to a image whose dimensions are based on the value of the $wid and $hgt argument. The optional $x and $y arguments allow for the adjustment of the crop to select a certain area of the image to be cropped.
- cropThumb() : AbstractAdapter
- Crop the image object to a square image whose dimensions are based on the value of the $px argument. The optional $offset argument allows for the adjustment of the crop to select a certain area of the image to be cropped.
- destroy() : void
- Destroy the image object and the related image file directly
- draw() : DrawInterface
- Get the image draw object
- effect() : EffectInterface
- Get the image effect object
- filter() : FilterInterface
- Get the image filter object
- flip() : AbstractAdapter
- Method to flip the image over the x-axis
- flop() : AbstractAdapter
- Method to flip the image over the y-axis
- getColorspace() : int
- Get the colorspace
- getExif() : array<string|int, mixed>
- Get the image EXIF data
- getFormat() : string
- Get the image format
- getHeight() : int
- Get the image height
- getName() : string
- Get the image name
- getResource() : resource
- Get the image resource
- getWidth() : int
- Get the image width
- hasResource() : bool
- Determine if there is an image resource
- isCmyk() : bool
- Determine if the image is CMYK
- isGray() : bool
- Determine if the image is grayscale
- isIndexed() : bool
- Determine if the image is index color
- isRgb() : bool
- Determine if the image is RGB
- layer() : LayerInterface
- Get the image layer object
- load() : AbstractAdapter
- Load the image resource from the existing image file
- loadFromString() : AbstractAdapter
- Load the image resource from data
- outputToHttp() : void
- Output the image object directly to HTTP
- resize() : AbstractAdapter
- Resize the image object, allowing for the largest dimension to be scaled to the value of the $px argument.
- resizeToHeight() : AbstractAdapter
- Resize the image object to the height parameter passed
- resizeToWidth() : AbstractAdapter
- Resize the image object to the width parameter passed
- rotate() : Gd
- Rotate the image object
- scale() : AbstractAdapter
- Scale the image object, allowing for the dimensions to be scaled proportionally to the value of the $scl argument.
- sendHeaders() : void
- Send image headers the image
- setAdjust() : AbstractAdapter
- Set the image adjust object
- setDraw() : AbstractAdapter
- Set the image draw object
- setEffect() : AbstractAdapter
- Set the image effect object
- setFilter() : AbstractAdapter
- Set the image filter object
- setLayer() : AbstractAdapter
- Set the image layer object
- setType() : AbstractAdapter
- Set the image type object
- type() : TypeInterface
- Get the image type object
- writeToFile() : void
- Write the image object to a file on disk
Constants
IMAGE_CMYK
public
mixed
IMAGE_CMYK
= 3
IMAGE_GRAY
Colorspace constants
public
mixed
IMAGE_GRAY
= 1
IMAGE_RGB
public
mixed
IMAGE_RGB
= 2
Properties
$adjust
Image adjust object
protected
AdjustInterface
$adjust
= null
$colorspace
Image colorspace
protected
int
$colorspace
= 2
$draw
Image draw object
protected
DrawInterface
$draw
= null
$effect
Image effect object
protected
EffectInterface
$effect
= null
$exif
EXIF data
protected
array<string|int, mixed>
$exif
= []
$filter
Image filter object
protected
FilterInterface
$filter
= null
$format
Image format
protected
string
$format
= 'jpg'
$height
Image height
protected
int
$height
= 480
$indexed
Index color flag
protected
bool
$indexed
= false
$layer
Image layer object
protected
LayerInterface
$layer
= null
$name
Image name
protected
string
$name
= 'pop-image.jpg'
$resource
Image resource
protected
mixed
$resource
= null
$type
Image type object
protected
TypeInterface
$type
= null
$width
Image width
protected
int
$width
= 640
Methods
__construct()
Constructor
public
__construct() : mixed
Instantiate an image object based on either a pre-existing image file on disk, or a new image file.
Return values
mixed —__get()
Magic get method to return a manipulation object
public
__get(string $name) : mixed
Parameters
- $name : string
Return values
mixed —__toString()
Output the image
public
abstract __toString() : string
Return values
string —adjust()
Get the image adjust object
public
abstract adjust() : AdjustInterface
Return values
AdjustInterface —convert()
Convert the image object to another format
public
abstract convert(string $type) : AbstractAdapter
Parameters
- $type : string
Tags
Return values
AbstractAdapter —create()
Create a new image resource
public
abstract create([int $width = null ][, int $height = null ][, string $name = null ]) : AbstractAdapter
Parameters
- $width : int = null
- $height : int = null
- $name : string = null
Return values
AbstractAdapter —createColor()
Create and return a color.
public
abstract createColor([ColorInterface $color = null ][, int $alpha = 100 ]) : mixed
Parameters
- $color : ColorInterface = null
- $alpha : int = 100
Tags
Return values
mixed —createIndex()
Create a new indexed image resource
public
abstract createIndex([int $width = null ][, int $height = null ][, string $name = null ]) : AbstractAdapter
Parameters
- $width : int = null
- $height : int = null
- $name : string = null
Return values
AbstractAdapter —createResource()
Create the image resource
public
abstract createResource() : void
Return values
void —crop()
Crop the image object to a image whose dimensions are based on the value of the $wid and $hgt argument. The optional $x and $y arguments allow for the adjustment of the crop to select a certain area of the image to be cropped.
public
abstract crop(int $w, int $h, int $x, int $y) : AbstractAdapter
Parameters
- $w : int
- $h : int
- $x : int
- $y : int
Return values
AbstractAdapter —cropThumb()
Crop the image object to a square image whose dimensions are based on the value of the $px argument. The optional $offset argument allows for the adjustment of the crop to select a certain area of the image to be cropped.
public
abstract cropThumb(int $px[, int $offset = null ]) : AbstractAdapter
Parameters
- $px : int
- $offset : int = null
Return values
AbstractAdapter —destroy()
Destroy the image object and the related image file directly
public
abstract destroy([bool $delete = false ]) : void
Parameters
- $delete : bool = false
Return values
void —draw()
Get the image draw object
public
abstract draw() : DrawInterface
Return values
DrawInterface —effect()
Get the image effect object
public
abstract effect() : EffectInterface
Return values
EffectInterface —filter()
Get the image filter object
public
abstract filter() : FilterInterface
Return values
FilterInterface —flip()
Method to flip the image over the x-axis
public
abstract flip() : AbstractAdapter
Return values
AbstractAdapter —flop()
Method to flip the image over the y-axis
public
abstract flop() : AbstractAdapter
Return values
AbstractAdapter —getColorspace()
Get the colorspace
public
getColorspace() : int
Return values
int —getExif()
Get the image EXIF data
public
getExif() : array<string|int, mixed>
Return values
array<string|int, mixed> —getFormat()
Get the image format
public
getFormat() : string
Return values
string —getHeight()
Get the image height
public
getHeight() : int
Return values
int —getName()
Get the image name
public
getName() : string
Return values
string —getResource()
Get the image resource
public
getResource() : resource
Return values
resource —getWidth()
Get the image width
public
getWidth() : int
Return values
int —hasResource()
Determine if there is an image resource
public
hasResource() : bool
Return values
bool —isCmyk()
Determine if the image is CMYK
public
isCmyk() : bool
Return values
bool —isGray()
Determine if the image is grayscale
public
isGray() : bool
Return values
bool —isIndexed()
Determine if the image is index color
public
isIndexed() : bool
Return values
bool —isRgb()
Determine if the image is RGB
public
isRgb() : bool
Return values
bool —layer()
Get the image layer object
public
abstract layer() : LayerInterface
Return values
LayerInterface —load()
Load the image resource from the existing image file
public
abstract load([string $name = null ]) : AbstractAdapter
Parameters
- $name : string = null
Return values
AbstractAdapter —loadFromString()
Load the image resource from data
public
abstract loadFromString(string $data[, string $name = null ]) : AbstractAdapter
Parameters
- $data : string
- $name : string = null
Return values
AbstractAdapter —outputToHttp()
Output the image object directly to HTTP
public
abstract outputToHttp([int $quality = 100 ][, string $to = null ][, bool $download = false ][, bool $sendHeaders = true ]) : void
Parameters
- $quality : int = 100
- $to : string = null
- $download : bool = false
- $sendHeaders : bool = true
Tags
Return values
void —resize()
Resize the image object, allowing for the largest dimension to be scaled to the value of the $px argument.
public
abstract resize(int $px) : AbstractAdapter
Parameters
- $px : int
Return values
AbstractAdapter —resizeToHeight()
Resize the image object to the height parameter passed
public
abstract resizeToHeight(int $h) : AbstractAdapter
Parameters
- $h : int
Return values
AbstractAdapter —resizeToWidth()
Resize the image object to the width parameter passed
public
abstract resizeToWidth(int $w) : AbstractAdapter
Parameters
- $w : int
Return values
AbstractAdapter —rotate()
Rotate the image object
public
abstract rotate(int $degrees[, ColorInterface $bgColor = null ]) : Gd
Parameters
- $degrees : int
- $bgColor : ColorInterface = null
Tags
Return values
Gd —scale()
Scale the image object, allowing for the dimensions to be scaled proportionally to the value of the $scl argument.
public
abstract scale(float $scale) : AbstractAdapter
Parameters
- $scale : float
Return values
AbstractAdapter —sendHeaders()
Send image headers the image
public
sendHeaders([string $to = null ][, bool $download = false ][, array<string|int, mixed> $additionalHeaders = [] ]) : void
Parameters
- $to : string = null
- $download : bool = false
- $additionalHeaders : array<string|int, mixed> = []
Return values
void —setAdjust()
Set the image adjust object
public
setAdjust(AdjustInterface $adjust) : AbstractAdapter
Parameters
- $adjust : AdjustInterface
Return values
AbstractAdapter —setDraw()
Set the image draw object
public
setDraw(DrawInterface $draw) : AbstractAdapter
Parameters
- $draw : DrawInterface
Return values
AbstractAdapter —setEffect()
Set the image effect object
public
setEffect(EffectInterface $effect) : AbstractAdapter
Parameters
- $effect : EffectInterface
Return values
AbstractAdapter —setFilter()
Set the image filter object
public
setFilter(FilterInterface $filter) : AbstractAdapter
Parameters
- $filter : FilterInterface
Return values
AbstractAdapter —setLayer()
Set the image layer object
public
setLayer(LayerInterface $layer) : AbstractAdapter
Parameters
- $layer : LayerInterface
Return values
AbstractAdapter —setType()
Set the image type object
public
setType(TypeInterface $type) : AbstractAdapter
Parameters
- $type : TypeInterface
Return values
AbstractAdapter —type()
Get the image type object
public
abstract type() : TypeInterface
Return values
TypeInterface —writeToFile()
Write the image object to a file on disk
public
abstract writeToFile([string $to = null ][, int $quality = 100 ]) : void
Parameters
- $to : string = null
- $quality : int = 100