CSShapeUtils
in package
This utility class provides shape-related methods.
Tags
Table of Contents
- SHAPE_ORIGIN = 'SHAPE_ORIGIN'
- Basic shape information classifiers
- SHAPE_PROP_FILLCOLOR = '-fill'
- Shape properties
- SHAPE_PROP_STROKECOLOR = '-stroke'
- SHAPE_PROP_STROKEWITDH = '-strokewidth'
- SHAPE_PROPS = 'SHAPE_PROPS'
- SHAPE_SIZE = 'SHAPE_SIZE'
- SHAPE_TYPE = 'SHAPE_TYPE'
- SHAPE_TYPE_RECTANGLE = 'rectangle'
- Shape types
- getShapeMagickDrawPrimitives() : array<string|int, mixed>
- Returns an array of ImageMagick command line arguments, which make up the drawing primitives for a given shape.
- makeRectangle() : array<string|int, mixed>
- Creates a shape structure describing a rectangle.
Constants
SHAPE_ORIGIN
Basic shape information classifiers
public
mixed
SHAPE_ORIGIN
= 'SHAPE_ORIGIN'
Tags
SHAPE_PROP_FILLCOLOR
Shape properties
public
mixed
SHAPE_PROP_FILLCOLOR
= '-fill'
Tags
SHAPE_PROP_STROKECOLOR
public
mixed
SHAPE_PROP_STROKECOLOR
= '-stroke'
Tags
SHAPE_PROP_STROKEWITDH
public
mixed
SHAPE_PROP_STROKEWITDH
= '-strokewidth'
Tags
SHAPE_PROPS
public
mixed
SHAPE_PROPS
= 'SHAPE_PROPS'
Tags
SHAPE_SIZE
public
mixed
SHAPE_SIZE
= 'SHAPE_SIZE'
Tags
SHAPE_TYPE
public
mixed
SHAPE_TYPE
= 'SHAPE_TYPE'
Tags
SHAPE_TYPE_RECTANGLE
Shape types
public
mixed
SHAPE_TYPE_RECTANGLE
= 'rectangle'
Tags
Methods
getShapeMagickDrawPrimitives()
Returns an array of ImageMagick command line arguments, which make up the drawing primitives for a given shape.
public
static getShapeMagickDrawPrimitives(array<string|int, mixed> $amShape) : array<string|int, mixed>
Parameters
- $amShape : array<string|int, mixed>
-
The shape structure for which the drawing primitives should be gathered.
Tags
Return values
array<string|int, mixed> —An array containing command line arguments for IM's "convert" or "mogrify" utilities. Individual parameters may be added, deleted or changed before imploding the array for command line use with a white-space character. If a shape structure is malformed or contains a shape type not supported by this class, an empty array is returned.
makeRectangle()
Creates a shape structure describing a rectangle.
public
static makeRectangle(array<string|int, mixed> $amOrigin, array<string|int, mixed> $amSize[, array<string|int, mixed> $amProperties = array() ]) : array<string|int, mixed>
Parameters
- $amOrigin : array<string|int, mixed>
-
A point structure as created by CSMeasureUtils::makePoint(), defining the upper left corner of the rectangle.
- $amSize : array<string|int, mixed>
-
A size structure as created by CSMeasureUtils::makeSize(), defining the width and the height of the rectangle.
- $amProperties : array<string|int, mixed> = array()
-
An associative array of shape properties, using one or more of the SHAPE_PROP_* constants as the array keys. The values must be valid ImageMagick colors/sizes/etc. .
Tags
Return values
array<string|int, mixed> —An array structure, containing the specified rectangle parameters.
