AdapterInterface
in
Basic interface for all image adapters.
Table of Contents
- destroy() : void
- Destroys the image.
- getHeight() : int
- Returns image height.
- getPixelColor() : stdClass
- Returns the color of the specified pixel.
- getResource() : resource|object|null
- Get the raw resource.
- getWidth() : int
- Returns image width.
- isAvailable() : bool
- Checks if the image adapter is available.
- load() : self
- Loads an image resource.
- loadFromBinary() : self
- Loads an image from a binary string representation.
- loadFromPath() : self
- Loads an image from path in filesystem.
- loadFromUrl() : self
- Loads an image from given URL.
Methods
destroy()
Destroys the image.
public
destroy() : void
Return values
void —getHeight()
Returns image height.
public
getHeight() : int
Return values
int —getPixelColor()
Returns the color of the specified pixel.
public
getPixelColor(int $x, int $y) : stdClass
Parameters
- $x : int
- $y : int
Return values
stdClass —getResource()
Get the raw resource.
public
getResource() : resource|object|null
Return values
resource|object|null —getWidth()
Returns image width.
public
getWidth() : int
Return values
int —isAvailable()
Checks if the image adapter is available.
public
static isAvailable() : bool
Return values
bool —load()
Loads an image resource.
public
load(resource|object $resource) : self
Parameters
- $resource : resource|object
Return values
self —loadFromBinary()
Loads an image from a binary string representation.
public
loadFromBinary(string $data) : self
Parameters
- $data : string
Return values
self —loadFromPath()
Loads an image from path in filesystem.
public
loadFromPath(string $file) : self
Parameters
- $file : string
Return values
self —loadFromUrl()
Loads an image from given URL.
public
loadFromUrl(string $url) : self
Parameters
- $url : string