eZ Publish  [trunk]
eZImageInterface Class Reference

Base interface for all image object and layer classes. More...

+ Inheritance diagram for eZImageInterface:

List of all members.

Public Member Functions

 __clone ()
 allocateColor ($name, $red, $green, $blue)
 alternativeText ()
 attribute ($name)
 attributes ()
 blendImage ($destinationImageObject, $imageObject, $destinationX, $destinationY, $sourceWidth, $sourceHeight, $sourceX=0, $sourceY=0)
 clear ($color=false)
 cloneImage ($imageObject, $width, $height, $useTruecolor=null)
 color ($name)
 copyImage ($destinationImageObject, $imageObject, $destinationX, $destinationY, $sourceWidth, $sourceHeight, $sourceX=0, $sourceY=0)
 create ($width, $height, $useTruecolor=null)
 destroy ()
 drawText (&$font, $textColor, $text, $x, $y, $angle, $imageObject=null)
 eZImageInterface ($imageObjectRef=null, $imageObject=null, $width=false, $height=false)
 font ()
 hasAttribute ($name)
hasSize ()
 height ()
 imageObject ($createMissing=true)
imagePath ()
 isProcessed ()
 isTruecolor ()
 load ()
 loadGIF ($storedPath, $storedFile)
 loadJPEG ($storedPath, $storedFile)
 loadPNG ($storedPath, $storedFile)
 merge ($imageObject, $x, $y, $width, $height)
 mergeImage ($destinationImageObject, $imageObject, $destinationX, $destinationY, $sourceWidth, $sourceHeight, $sourceX=0, $sourceY=0, $transparency=0)
 process ()
 processImage ()
 setAlternativeText ($text)
 setFont ($font)
 setHeight ($h)
 setStoredFile ($file, $path, $type)
 setTextColor ($textColor)
 setWidth ($w)
 store ($fileName, $filePath, $type)
 textColor ()
 width ()

Static Public Member Functions

static cleanupRegisteredImages ()
static hasGD2 ()
static unregisterImage ($imageRef)

Public Attributes

 $AlternativeText
 $Font
 $Height
 $ImageObject
 $ImageObjectRef
 $IsProcessed
 $IsTrueColor
 $Palette
 $PaletteIndex
 $StoredFile
 $StoredPath
 $StoredType
 $Width

Protected Member Functions

 imageObjectInternal ($createMissing=true)

Static Protected Member Functions

static registerImage ($image)

Private Member Functions

 attributeFunctionMap ()
 attributeMemberMap ()

Static Private Member Functions

static createImage ($width, $height, &$useTruecolor)

Detailed Description

Base interface for all image object and layer classes.

Definition at line 19 of file ezimageinterface.php.


Member Function Documentation

Copies the image from $image as the current image object.

Definition at line 520 of file ezimageinterface.php.

eZImageInterface::allocateColor ( name,
red,
green,
blue 
)

Allocates the color $red, $green and $blue with name $name and returns it. Will return the palette index for palette based images and the color value for true color.

Definition at line 685 of file ezimageinterface.php.

Returns:
the alternative text for the image.
See also:
setAlternativeText

Definition at line 160 of file ezimageinterface.php.

Returns:
the attribute with name $name or null if the attribute does not exist.

Definition at line 96 of file ezimageinterface.php.

Returns:
a map array which maps from an attribute name to a member function. Used by attributes, hasAttribute and attribute.

Definition at line 64 of file ezimageinterface.php.

Referenced by attribute(), attributes(), and hasAttribute().

Returns:
a map array which maps from an attribute name to a member variable. Used by attributes, hasAttribute and attribute.

Definition at line 50 of file ezimageinterface.php.

Referenced by attribute(), attributes(), and hasAttribute().

Returns:
an array with attribute names which this object supports.

Definition at line 73 of file ezimageinterface.php.

eZImageInterface::blendImage ( destinationImageObject,
imageObject,
destinationX,
destinationY,
sourceWidth,
sourceHeight,
sourceX = 0,
sourceY = 0 
)

Alpha blends the image $imageObject with size $sourceWidth and $sourceHeight and position $sourceX and $sourceY onto the destination image $destinationImageObject at position $destinationX and $destinationY.

Note:
This required GD2 and uses color 0 (black) for blending.

Definition at line 642 of file ezimageinterface.php.

Cleans up all registered images.

Definition at line 202 of file ezimageinterface.php.

Referenced by eZGlobalImageCleanupFunction().

Clears the image object with color $color. If $color is not specified it will use the first color set.

Definition at line 667 of file ezimageinterface.php.

Referenced by eZImageTextLayer\processImage().

eZImageInterface::cloneImage ( imageObject,
width,
height,
useTruecolor = null 
)

Clones the image object $imageObject with width $width, height $height and truecolor settings $useTruecolor.

Definition at line 530 of file ezimageinterface.php.

Referenced by __clone().

Returns:
the color for the name $name.

Definition at line 704 of file ezimageinterface.php.

Referenced by clear(), and drawText().

eZImageInterface::copyImage ( destinationImageObject,
imageObject,
destinationX,
destinationY,
sourceWidth,
sourceHeight,
sourceX = 0,
sourceY = 0 
)

Copies the image $imageObject with size $sourceWidth and $sourceHeight and position $sourceX and $sourceY onto the destination image $destinationImageObject at position $destinationX and $destinationY.

Definition at line 607 of file ezimageinterface.php.

eZImageInterface::create ( width,
height,
useTruecolor = null 
)

Creates a new image object with width $width and height $height. $useTruecolor determines the type of image, if true it will be truecolor, if false it will be palette based or if null it will create it depending on the GD version. GD 2 will get truecolor while < 2 will get palette based.

Definition at line 501 of file ezimageinterface.php.

Referenced by imageObjectInternal().

static eZImageInterface::createImage ( width,
height,
&$  useTruecolor 
) [static, private]

Creates an image with size $width and $height using GD and returns it.

Definition at line 475 of file ezimageinterface.php.

Referenced by cloneImage(), and create().

Cleans up the current image object if it is set.

Reimplemented in eZImageObject.

Definition at line 311 of file ezimageinterface.php.

Referenced by cloneImage(), and create().

eZImageInterface::drawText ( &$  font,
textColor,
text,
x,
y,
angle,
imageObject = null 
)

Draws the text $text using the font $font and color $textColor at position $x and $y with angle $angle. If $imageObject is specified it will use that for drawing instead of the current image.

Definition at line 736 of file ezimageinterface.php.

Referenced by eZImageTextLayer\mergeLayer(), and eZImageTextLayer\processImage().

eZImageInterface::eZImageInterface ( imageObjectRef = null,
imageObject = null,
width = false,
height = false 
)

Definition at line 21 of file ezimageinterface.php.

Referenced by eZImageLayer\eZImageLayer(), and eZImageObject\eZImageObject().

Returns:
the current font object or null if not font object has been set.

Definition at line 597 of file ezimageinterface.php.

Referenced by eZImageTextLayer\mergeLayer(), and eZImageTextLayer\processImage().

Returns:
true if the attribute $name exists.

Definition at line 82 of file ezimageinterface.php.

static eZImageInterface::hasGD2 ( ) [static]
Returns:
true if GD2 is installed.

Definition at line 454 of file ezimageinterface.php.

Referenced by createImage().

Returns:
true if the width and height of the image has been set.

Definition at line 132 of file ezimageinterface.php.

Returns:
the current height of the image or false if no size has been set.

Definition at line 554 of file ezimageinterface.php.

Referenced by __clone(), eZImageObject\calculatePosition(), eZImageObject\flatten(), eZImageLayer\mergeLayer(), and eZImageTextLayer\mergeLayer().

eZImageInterface::imageObject ( createMissing = true)
Returns:
the current image object, if $createMissing is true if will run the image processing to make sure it is created. Returns null if no image is available.
See also:
imageObjectInternal

Definition at line 329 of file ezimageinterface.php.

Referenced by __clone(), eZImageLayer\mergeLayer(), and store().

eZImageInterface::imageObjectInternal ( createMissing = true) [protected]
Returns:
the current image object, will create an empty image object if $createMissing is true and the image object is not already created.
See also:
imageObject

Definition at line 351 of file ezimageinterface.php.

Referenced by eZImageTextLayer\mergeLayer(), and eZImageTextLayer\processImage().

Returns:
the path to the image file including the file.

Definition at line 141 of file ezimageinterface.php.

Returns:
true if the image object has been processed, this means that image has been rendered.

Definition at line 124 of file ezimageinterface.php.

Returns:
true if the image is true color. True color images behave differently from palette based and GD has problems with mixing the two types.

Definition at line 40 of file ezimageinterface.php.

Referenced by __clone(), and eZImageLayer\mergeLayer().

Tries to load the stored image set by setStoredFile(). If the stored type is not set it will try all formats until one succeeds.

Returns:
true if succesful.

Definition at line 272 of file ezimageinterface.php.

Referenced by processImage().

eZImageInterface::loadGIF ( storedPath,
storedFile 
)

Tries to load the GIF image from the path $storedPath and file $storedFile into the current image object.

Returns:
true if succesful.

Definition at line 254 of file ezimageinterface.php.

Referenced by load().

eZImageInterface::loadJPEG ( storedPath,
storedFile 
)

Tries to load the JPEG image from the path $storedPath and file $storedFile into the current image object.

Returns:
true if succesful.

Definition at line 238 of file ezimageinterface.php.

Referenced by load().

eZImageInterface::loadPNG ( storedPath,
storedFile 
)

Tries to load the PNG image from the path $storedPath and file $storedFile into the current image object.

Returns:
true if succesful.

Definition at line 220 of file ezimageinterface.php.

Referenced by load().

eZImageInterface::merge ( imageObject,
x,
y,
width,
height 
)

Definition at line 652 of file ezimageinterface.php.

eZImageInterface::mergeImage ( destinationImageObject,
imageObject,
destinationX,
destinationY,
sourceWidth,
sourceHeight,
sourceX = 0,
sourceY = 0,
transparency = 0 
)

Merges the image $imageObject with size $sourceWidth and $sourceHeight and position $sourceX and $sourceY with the destination image $destinationImageObject at position $destinationX and $destinationY. The merged image is placed on the $destinationImageObject.

Parameters:
$transparencydetermines how transparent the source image is. 0 is the same as copyImage and 100 is the same is no copy is made.

Definition at line 624 of file ezimageinterface.php.

Makes sure the image object is processed and rendered. Calls processImage() which is implemented by all descendants of this class to do the real work.

Definition at line 366 of file ezimageinterface.php.

Referenced by imageObject(), and store().

Tries to render an image onto the image object, each inheriting class must override this to do somethign sensible. By default it will try to load the stored image if one is set.

Returns:
true if the image was succesfully processed.

Reimplemented in eZImageObject, and eZImageTextLayer.

Definition at line 378 of file ezimageinterface.php.

Referenced by process().

static eZImageInterface::registerImage ( image) [static, protected]

Registers the GD image object $image for destruction upon script end. This makes sure that image resources are cleaned up after use.

Returns:
a reference for the image which can be used in unregisterImage later on. Returns false if resource can't be registered.

Definition at line 171 of file ezimageinterface.php.

Referenced by cloneImage(), create(), loadGIF(), loadJPEG(), and loadPNG().

Sets the alternative text to $text, it will be used for describing the image and can be used by browsers that cannot view images.

Definition at line 151 of file ezimageinterface.php.

Sets the current font object to $font.

Definition at line 589 of file ezimageinterface.php.

Referenced by eZImageLayer\eZImageLayer().

Sets the height of the image to $h.

Definition at line 570 of file ezimageinterface.php.

Referenced by eZImageObject\flatten().

eZImageInterface::setStoredFile ( file,
path,
type 
)

Sets the path, file and type of the stored file. These settings will be used by load().

Definition at line 579 of file ezimageinterface.php.

Sets the color used for text drawing to $textColor.

Definition at line 725 of file ezimageinterface.php.

Sets the width of the image to $w.

Definition at line 562 of file ezimageinterface.php.

Referenced by eZImageObject\flatten().

eZImageInterface::store ( fileName,
filePath,
type 
)

Stores the current image object to disk, the image is stored in the path $filePath with filename $fileName. The parameter $type determines the image format, supported are png and jpg.

Returns:
true if the image was stored correctly.

Definition at line 408 of file ezimageinterface.php.

Returns:
the color used for text drawing.

Definition at line 717 of file ezimageinterface.php.

Referenced by eZImageTextLayer\mergeLayer(), and eZImageTextLayer\processImage().

static eZImageInterface::unregisterImage ( imageRef) [static]

Tries to unregister the image with reference $imageRef

Definition at line 189 of file ezimageinterface.php.

Referenced by destroy().

Returns:
the current width of the image or false if no size has been set.

Definition at line 546 of file ezimageinterface.php.

Referenced by __clone(), eZImageObject\calculatePosition(), eZImageObject\flatten(), eZImageLayer\mergeLayer(), and eZImageTextLayer\mergeLayer().


Member Data Documentation

eZImageInterface::$AlternativeText

Definition at line 778 of file ezimageinterface.php.

eZImageInterface::$Font

Definition at line 770 of file ezimageinterface.php.

eZImageInterface::$Height

Definition at line 769 of file ezimageinterface.php.

eZImageInterface::$ImageObject

Definition at line 771 of file ezimageinterface.php.

eZImageInterface::$ImageObjectRef

Definition at line 772 of file ezimageinterface.php.

eZImageInterface::$IsProcessed

Definition at line 780 of file ezimageinterface.php.

eZImageInterface::$IsTrueColor

Definition at line 779 of file ezimageinterface.php.

eZImageInterface::$Palette

Definition at line 777 of file ezimageinterface.php.

eZImageInterface::$PaletteIndex

Definition at line 776 of file ezimageinterface.php.

eZImageInterface::$StoredFile

Definition at line 773 of file ezimageinterface.php.

eZImageInterface::$StoredPath

Definition at line 774 of file ezimageinterface.php.

eZImageInterface::$StoredType

Definition at line 775 of file ezimageinterface.php.

eZImageInterface::$Width

Definition at line 768 of file ezimageinterface.php.


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