Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZImageObject Class Reference
Image object and layer handling

Image object which handles image layers. More...

Inheritance diagram for eZImageObject:

## Public Member Functions
| __construct ( $imageObjectRef=null, $imageObject=null, $width=false, $height=false)
| templateData ()
| setTemplateURI ( $uri)
| calculateAxisPlacement ( $value, $type, $alignment, $axisStart, $axisStop, $currentLength)
| initializeAxis ( $parameters, $name)
| calculatePosition ( $parameters, $width, $height)
| getTransparency ( $parameters)
| getTransparencyPercent ( $parameters)
| appendLayer (&$imageLayer, $parameters=array())
| prependLayer (&$imageLayer, $parameters=array())
| hasLayer ( $layerID)
| destroy ()
| removeLayer ( $layerID)
| processImage ()
| flatten ()
Public Member Functions inherited from eZImageInterface
| isTruecolor ()
| attributes ()
| hasAttribute ( $name)
| attribute ( $name)
| isProcessed ()
& | hasSize ()
& | imagePath ()
| setAlternativeText ( $text)
| alternativeText ()
| loadPNG ( $storedPath, $storedFile)
| loadJPEG ( $storedPath, $storedFile)
| loadGIF ( $storedPath, $storedFile)
| load ()
| imageObject ( $createMissing=true)
| process ()
| store ( $fileName, $filePath, $type)
| create ( $width, $height, $useTruecolor=null)
| __clone ()
| cloneImage ( $imageObject, $width, $height, $useTruecolor=null)
| width ()
| height ()
| setWidth ( $w)
| setHeight ( $h)
| setStoredFile ( $file, $path, $type)
| setFont ( $font)
| font ()
| copyImage ( $destinationImageObject, $imageObject, $destinationX, $destinationY, $sourceWidth, $sourceHeight, $sourceX=0, $sourceY=0)
| mergeImage ( $destinationImageObject, $imageObject, $destinationX, $destinationY, $sourceWidth, $sourceHeight, $sourceX=0, $sourceY=0, $transparency=0)
| blendImage ( $destinationImageObject, $imageObject, $destinationX, $destinationY, $sourceWidth, $sourceHeight, $sourceX=0, $sourceY=0)
| merge ( $imageObject, $x, $y, $width, $height)
| clear ( $color=false)
| allocateColor ( $name, $red, $green, $blue)
| color ( $name)
| textColor ()
| setTextColor ( $textColor)
| drawText (&$font, $textColor, $text, $x, $y, $angle, $imageObject=null)

## Public Attributes
| $ImageLayerCounter
| $ImageLayers
| $TemplateURI
| $ImageLayerIndex
const | ALIGN_AXIS_NONE = 0x00
| Alignment values. More...
const | ALIGN_AXIS_START = 0x01
const | ALIGN_AXIS_STOP = 0x02
const | ALIGN_AXIS_CENTER = 0x03
const | ALIGN_AXIS_MASK = 0x03
const | PLACE_CONSTANT = 1
const | PLACE_RELATIVE = 2
| Places the layer relative to the axis size. More...
Public Attributes inherited from eZImageInterface
| $TextColor
| $Width
| $Height
| $Font
| $ImageObject
| $ImageObjectRef
| $StoredFile
| $StoredPath
| $StoredType
| $PaletteIndex
| $Palette
| $AlternativeText
| $IsTrueColor
| $IsProcessed

## Additional Inherited Members
Static Public Member Functions inherited from eZImageInterface
static | unregisterImage ( $imageRef)
static | cleanupRegisteredImages ()
static | hasGD2 ()
Protected Member Functions inherited from eZImageInterface
| imageObjectInternal ( $createMissing=true)
Static Protected Member Functions inherited from eZImageInterface
static | registerImage ( $image)

## Detailed Description

Image object which handles image layers.

Definition at line 18 of file ezimageobject.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZImageObject::__construct | ( |  | $imageObjectRef = `null`,
|  |  | $imageObject = `null`,
|  |  | $width = `false`,
|  |  | $height = `false`
| ) |  |

Constructor

Parameters

  string | $imageObjectRef |
  eZContentObject | $imageObject |
  int | bool | $width |
  int | bool | $height |

Reimplemented from eZImageInterface.

Definition at line 36 of file ezimageobject.php.

## Member Function Documentation

## ◆ appendLayer()

eZImageObject::appendLayer | ( | & | $imageLayer,
|  |  | $parameters = `array()`
| ) |  |

Adds the image layer object $imageLayer to the end of the layer list with optional parameters $parameters

Returns
  the ID of the layer, the ID is unique per image object.

See also
  prependLayer

Definition at line 163 of file ezimageobject.php.

References $ImageLayerCounter, and eZDebug\writeWarning().

## ◆ calculateAxisPlacement()

eZImageObject::calculateAxisPlacement | ( |  | $value,
|  |  | $type,
|  |  | $alignment,
|  |  | $axisStart,
|  |  | $axisStop,
|  |  | $currentLength
| ) |  |

Figures out the absolute axis placement and returns it. The variable $type determines how $value is used, it can either be a constant value (self::PLACE_CONSTANT) or a relative value (self::PLACE_RELATIVE) where input value is placed relative to the length of the axis ($axisStop - $axisStart). $alignment determines where the axis should start, self::ALIGN_AXIS_NONE and self::ALIGN_AXIS_START will return the position from $axisStart towards $axisStop, self::ALIGN_AXIS_STOP returns the position from the $axisStop towards $axisStart while self::ALIGN_AXIS_CENTER returns the middle of $axisStart and $axisStop.

Definition at line 74 of file ezimageobject.php.

References ALIGN_AXIS_MASK.

Referenced by calculatePosition().

## ◆ calculatePosition()

eZImageObject::calculatePosition | ( |  | $parameters,
|  |  | $width,
|  |  | $height
| ) |  |

Calculates the position for `x` and `y` parameters in $parameters and returns an absolute position in an array. The returned array will contain the `x` and `y` key.

Definition at line 124 of file ezimageobject.php.

References calculateAxisPlacement(), eZImageInterface\height(), initializeAxis(), and eZImageInterface\width().

## ◆ destroy()

eZImageObject::destroy | ( |  | ) |

Cleans up the current image object if it is set.

Reimplemented from eZImageInterface.

Definition at line 211 of file ezimageobject.php.

## ◆ flatten()

eZImageObject::flatten | ( |  | ) |

Goes trough all layers and merges them together into a single image. This image can then be displayed on the webpage.

Definition at line 261 of file ezimageobject.php.

References eZImageInterface\height(), eZImageInterface\setHeight(), eZImageInterface\setWidth(), eZImageInterface\width(), and eZDebug\writeWarning().

Referenced by processImage().

## ◆ getTransparency()

eZImageObject::getTransparency | ( |  | $parameters | ) |

Returns
  the transparency value found in the parameters or 0 if no value is found.

Definition at line 139 of file ezimageobject.php.

Referenced by getTransparencyPercent().

## ◆ getTransparencyPercent()

eZImageObject::getTransparencyPercent | ( |  | $parameters | ) |

Returns
  the transparency percentage found in the parameters or 0 if no percentage is found.

Definition at line 152 of file ezimageobject.php.

References getTransparency().

## ◆ hasLayer()

eZImageObject::hasLayer | ( |  | $layerID | ) |

Returns
  true if the layer with ID $layerID exists in this image object.

Definition at line 202 of file ezimageobject.php.

## ◆ initializeAxis()

eZImageObject::initializeAxis | ( |  | $parameters,
|  |  | $name
| ) |  |

Initializes the axis from the parameter value $name filling in any missing values with defaults.

Definition at line 105 of file ezimageobject.php.

References ALIGN_AXIS_NONE, and PLACE_CONSTANT.

Referenced by calculatePosition().

## ◆ prependLayer()

eZImageObject::prependLayer | ( | & | $imageLayer,
|  |  | $parameters = `array()`
| ) |  |

Adds the image layer object $imageLayer to the beginning of the layer list with optional parameters $parameters

Returns
  the ID of the layer, the ID is unique per image object.

See also
  appendLayer

Definition at line 183 of file ezimageobject.php.

References $ImageLayerCounter, and eZDebug\writeWarning().

## ◆ processImage()

eZImageObject::processImage | ( |  | ) |

Flattens the image so that it can be displayed.

Reimplemented from eZImageInterface.

Definition at line 251 of file ezimageobject.php.

References flatten().

## ◆ removeLayer()

eZImageObject::removeLayer | ( |  | $layerID | ) |

Removes the layer with ID $layerID.

Returns
  true if succesful

See also
  hasLayer, appendLayer

Definition at line 231 of file ezimageobject.php.

## ◆ setTemplateURI()

eZImageObject::setTemplateURI | ( |  | $uri | ) |

Sets the URI of the template to use for displaying it using the template engine to $uri.

Definition at line 58 of file ezimageobject.php.

## ◆ templateData()

eZImageObject::templateData | ( |  | ) |

A definition which tells the template engine which template to use for displaying the image.

Definition at line 48 of file ezimageobject.php.

## Member Data Documentation

## ◆ $ImageLayerCounter

eZImageObject::$ImageLayerCounter

Definition at line 20 of file ezimageobject.php.

Referenced by appendLayer(), and prependLayer().

## ◆ $ImageLayerIndex

eZImageObject::$ImageLayerIndex

Definition at line 326 of file ezimageobject.php.

## ◆ $ImageLayers

eZImageObject::$ImageLayers

Definition at line 324 of file ezimageobject.php.

## ◆ $TemplateURI

eZImageObject::$TemplateURI

Definition at line 325 of file ezimageobject.php.

## ◆ ALIGN_AXIS_CENTER

const eZImageObject::ALIGN_AXIS_CENTER = 0x03

Definition at line 25 of file ezimageobject.php.

Referenced by eZTemplateImageOperator\readImageParameters().

## ◆ ALIGN_AXIS_MASK

const eZImageObject::ALIGN_AXIS_MASK = 0x03

Definition at line 26 of file ezimageobject.php.

Referenced by calculateAxisPlacement().

## ◆ ALIGN_AXIS_NONE

const eZImageObject::ALIGN_AXIS_NONE = 0x00

Alignment values.

Definition at line 22 of file ezimageobject.php.

Referenced by initializeAxis(), and eZTemplateImageOperator\readImageParameters().

## ◆ ALIGN_AXIS_START

const eZImageObject::ALIGN_AXIS_START = 0x01

Definition at line 23 of file ezimageobject.php.

Referenced by eZTemplateImageOperator\readImageParameters().

## ◆ ALIGN_AXIS_STOP

const eZImageObject::ALIGN_AXIS_STOP = 0x02

Definition at line 24 of file ezimageobject.php.

Referenced by eZTemplateImageOperator\readImageParameters().

## ◆ PLACE_CONSTANT

const eZImageObject::PLACE_CONSTANT = 1

Placement types Places the layer absolutely from on the axis.

Definition at line 31 of file ezimageobject.php.

Referenced by initializeAxis(), and eZTemplateImageOperator\readImageParameters().

## ◆ PLACE_RELATIVE

const eZImageObject::PLACE_RELATIVE = 2

Places the layer relative to the axis size.

Definition at line 33 of file ezimageobject.php.

Referenced by eZTemplateImageOperator\readImageParameters().

The documentation for this class was generated from the following file:

- ezimageobject.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.