GdDriver
extends Driver
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- Create a new GdDriver instance.
- color() : array{0: int<0, 255>, 1: int<0, 255>, 2: int<0, 255>}|false
- Obtains the color at a specific position.
- colors() : array<int, array<int, array{0: float, 1: float, 2: float}>>
- create() : static
- Creates a new image with specified width and height.
- pixel() : bool
- Applies a color at a specific position.
- read() : GdImage
- Reads an image from a path and returns an image resource based on the driver.
- resize() : GdImage
- Resizes the image to a smaller version.
- scale() : float
- Get resizing factor.
- size() : array{0: positive-int, 1: positive-int}
- Retrieves the image's width and height.
Properties
$height
Image height.
public
int
$height
$image
public
GdImage
$image
$maxSize
public
int
$maxSize
$width
Image width.
public
int
$width
Methods
__construct()
Create a new GdDriver instance.
public
__construct(int $maxSize) : mixed
Parameters
- $maxSize : int
Tags
color()
Obtains the color at a specific position.
public
color(GdImage $image, int $x, int $y) : array{0: int<0, 255>, 1: int<0, 255>, 2: int<0, 255>}|false
Parameters
- $image : GdImage
- $x : int
- $y : int
Return values
array{0: int<0, 255>, 1: int<0, 255>, 2: int<0, 255>}|falsecolors()
public
colors(string $path) : array<int, array<int, array{0: float, 1: float, 2: float}>>
Parameters
- $path : string
Tags
Return values
array<int, array<int, array{0: float, 1: float, 2: float}>>create()
Creates a new image with specified width and height.
public
create(int $width, int $height) : static
Parameters
- $width : int
- $height : int
Tags
Return values
staticpixel()
Applies a color at a specific position.
public
pixel(int $x, int $y, array<string|int, mixed> $color) : bool
Parameters
- $x : int
- $y : int
- $color : array<string|int, mixed>
Tags
Return values
boolread()
Reads an image from a path and returns an image resource based on the driver.
public
read(string $path) : GdImage
Parameters
- $path : string
Tags
Return values
GdImageresize()
Resizes the image to a smaller version.
public
resize(GdImage $origin) : GdImage
Parameters
- $origin : GdImage
Tags
Return values
GdImagescale()
Get resizing factor.
public
scale(positive-int $width, positive-int $height) : float
Parameters
- $width : positive-int
- $height : positive-int
Return values
floatsize()
Retrieves the image's width and height.
public
size(GdImage $image) : array{0: positive-int, 1: positive-int}
Parameters
- $image : GdImage