Bånder

Driver
in package

AbstractYes

Table of Contents

Properties

$height  : int
Image height.
$maxSize  : int
$width  : int
Image width.

Methods

__construct()  : mixed
Create a new driver 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()  : object
Reads an image from a path and returns an image resource based on the driver.
resize()  : object
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

$width

Image width.

public int $width

Methods

__construct()

Create a new driver instance.

public __construct(positive-int $maxSize) : mixed
Parameters
$maxSize : positive-int

color()

Obtains the color at a specific position.

public abstract color(object $image, int $x, int $y) : array{0: int<0, 255>, 1: int<0, 255>, 2: int<0, 255>}|false
Parameters
$image : object
$x : int
$y : int
Return values
array{0: int<0, 255>, 1: int<0, 255>, 2: int<0, 255>}|false

colors()

public colors(string $path) : array<int, array<int, array{0: float, 1: float, 2: float}>>
Parameters
$path : string
Tags
throws
UnableToGetColorException
Return values
array<int, array<int, array{0: float, 1: float, 2: float}>>

create()

Creates a new image with specified width and height.

public abstract create(positive-int $width, positive-int $height) : static
Parameters
$width : positive-int
$height : positive-int
Return values
static

pixel()

Applies a color at a specific position.

public abstract pixel(int $x, int $y, array{0: int<0, 255>, 1: int<0, 255>, 2: int<0, 255>} $color) : bool
Parameters
$x : int
$y : int
$color : array{0: int<0, 255>, 1: int<0, 255>, 2: int<0, 255>}
Return values
bool

read()

Reads an image from a path and returns an image resource based on the driver.

public abstract read(string $path) : object
Parameters
$path : string
Return values
object

resize()

Resizes the image to a smaller version.

public abstract resize(object $image) : object
Parameters
$image : object
Return values
object

scale()

Get resizing factor.

public scale(positive-int $width, positive-int $height) : float
Parameters
$width : positive-int
$height : positive-int
Return values
float

size()

Retrieves the image's width and height.

public abstract size(object $image) : array{0: positive-int, 1: positive-int}
Parameters
$image : object
Return values
array{0: positive-int, 1: positive-int}

        
On this page

Search results