class RoundCorners extends BaseAction

Round one or more corners of an image or video.

Learn more: Rounded images | Rounded videos

Methods

__construct(mixed ...$qualifiers)

RoundCorners constructor.

addQualifier(BaseComponent $qualifier = null)

Adds the qualifier to the action.

addQualifiers(array ...$qualifiers)

Adds qualifiers to the action.

setGenericAction(string $action)

Adds (sets) generic (raw) action.

setFlag(FlagQualifier $flag, bool $set = true)

Sets the flag.

unsetFlag(FlagQualifier $flag)

Removes the flag.

importAction(BaseAction|null $action)

Imports (merges) qualifiers and flags from another action.

jsonSerialize()

Serializes to json.

__toString()

Serializes to Cloudinary URL format

max()

Generates an asset with a circular crop using the 'max' radius value.

byRadius(array ...$values)

Rounds the specified corners of an image by specifying 1-4 pixel values as follows:

topLeft(int $radius)

Sets top-left corner radius

topRight(int $radius)

Sets top-right corner radius.

bottomRight(int $radius)

Sets bottom-right corner radius.

bottomLeft(int $radius)

Sets bottom-left corner radius.

setRadius(int|string|array|mixed ...$values)

Sets the corner radius.

setSymmetricRadius(int $topLeftBottomRight, int $topRightBottomLeft)

Sets radius separately for (top-left, bottom-right) and (top-right, bottom-left) corners.

setPartiallySymmetricRadius(int $topLeft, int $topRightBottomLeft, int $bottomRight)

Sets radius separately for top-left, (top-right, bottom-left) and bottom-right corners.

Details

__construct(mixed ...$qualifiers)

RoundCorners constructor.

Parameters

Name Type Description
...$qualifiers mixed

$this addQualifier(BaseComponent $qualifier = null)

Adds the qualifier to the action.

Parameters

Name Type Description
$qualifier BaseComponent The qualifier to add.

Return Value

$this

$this addQualifiers(array ...$qualifiers)

Adds qualifiers to the action.

Parameters

Name Type Description
...$qualifiers array The qualifiers to add.

Return Value

$this

BaseAction setGenericAction(string $action)

Adds (sets) generic (raw) action.

Parameters

Name Type Description
$action string The generic action string.

Return Value

BaseAction

$this setFlag(FlagQualifier $flag, bool $set = true)

Sets the flag.

Parameters

Name Type Description
$flag FlagQualifier The flag to set.
$set bool Indicates whether to set(true) or unset(false) the flag instead. (Used for avoiding if conditions all over the code)

Return Value

$this

$this unsetFlag(FlagQualifier $flag)

Removes the flag.

Parameters

Name Type Description
$flag FlagQualifier The flag to unset.

Return Value

$this

$this importAction(BaseAction|null $action)

Imports (merges) qualifiers and flags from another action.

Parameters

Name Type Description
$action BaseAction|null The action to import.

Return Value

$this

mixed jsonSerialize()

Serializes to json.

Return Value

mixed

string __toString()

Serializes to Cloudinary URL format

Return Value

string

static CornerRadiusTrait max()

Generates an asset with a circular crop using the 'max' radius value.

Return Value

CornerRadiusTrait

static CornerRadiusTrait byRadius(array ...$values)

Rounds the specified corners of an image by specifying 1-4 pixel values as follows:

1 value: All four corners are rounded equally according to the specified value. 2 values: 1st value => top-left & bottom-right. 2nd value => top-right & bottom-left. 3 values: 1st value => top-left. 2nd value => top-right & bottom-left. 3rd value => bottom-right. 4 values: Each corner specified separately, in clockwise order, starting with top-left.

Parameters

Name Type Description
...$values array

Return Value

CornerRadiusTrait

CornersTrait topLeft(int $radius)

Sets top-left corner radius

Parameters

Name Type Description
$radius int Radius length in pixels

Return Value

CornersTrait

CornersTrait topRight(int $radius)

Sets top-right corner radius.

Parameters

Name Type Description
$radius int Radius length in pixels

Return Value

CornersTrait

CornersTrait bottomRight(int $radius)

Sets bottom-right corner radius.

Parameters

Name Type Description
$radius int Radius length in pixels

Return Value

CornersTrait

CornersTrait bottomLeft(int $radius)

Sets bottom-left corner radius.

Parameters

Name Type Description
$radius int Radius length in pixels

Return Value

CornersTrait

RoundCorners setRadius(int|string|array|mixed ...$values)

Sets the corner radius.

Parameters

Name Type Description
...$values int|string|array|mixed The corner(s) radius.

Return Value

RoundCorners

CornersTrait setSymmetricRadius(int $topLeftBottomRight, int $topRightBottomLeft)

Sets radius separately for (top-left, bottom-right) and (top-right, bottom-left) corners.

Parameters

Name Type Description
$topLeftBottomRight int Radius for top-left and bottom-right corners
$topRightBottomLeft int Radius for top-right and bottom-left corners

Return Value

CornersTrait

CornersTrait setPartiallySymmetricRadius(int $topLeft, int $topRightBottomLeft, int $bottomRight)

Sets radius separately for top-left, (top-right, bottom-left) and bottom-right corners.

Parameters

Name Type Description
$topLeft int Radius for top-left corner
$topRightBottomLeft int Radius for top-right and bottom-left corners
$bottomRight int Radius for bottom-right corner

Return Value

CornersTrait

Constants

MAIN_QUALIFIER