Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezimagelayer.php
Go to the documentation of this file.
1 <?php
18 class eZImageLayer extends eZImageInterface
19 {
20 public function __construct( $imageObjectRef = null, $imageObject = null,
21 $width = false, $height = false, $font = false )
22 {
23 parent::__construct( $imageObjectRef, $imageObject, $width, $height );
24 $this->setFont( $font );
25 $this->TemplateURI = 'design:image/layer.tpl';
26 }
27
32 function templateData()
33 {
34 return array( 'type' => 'template',
35 'template_variable_name' => 'layer',
36 'uri' => $this->TemplateURI );
37 }
38
42 function setTemplateURI( $uri )
43 {
44 $this->TemplateURI = $uri;
45 }
46
52 function mergeLayer( $image, $layerData, $lastLayerData )
53 {
54 $position = $image->calculatePosition( $layerData['parameters'], $this->width(), $this->height() );
55 $x = $position['x'];
56 $y = $position['y'];
57 $imageObject = $this->imageObject();
58 if ( $lastLayerData === null )
59 {
60 $destinationImageObject = $image->imageObjectInternal( false );
61 if ( $destinationImageObject === null )
62 {
63 $isTrueColor = $this->isTruecolor();
64 $image->cloneImage( $this->imageObject(), $this->width(), $this->height(),
65 $isTrueColor );
66 }
67 else
68 {
69 $image->mergeImage( $destinationImageObject, $imageObject,
70 $x, $y,
71 $this->width(), $this->height(), 0, 0,
72 $image->getTransparencyPercent( $layerData['parameters'] ) );
73 }
74 }
75 else
76 {
77 $destinationImageObject = $image->imageObjectInternal();
78 $image->mergeImage( $destinationImageObject, $imageObject,
79 $x, $y,
80 $this->width(), $this->height(), 0, 0,
81 $image->getTransparencyPercent( $layerData['parameters'] ) );
82 }
83 }
84
88 static function createForFile( $fileName, $filePath, $fileType = false )
89 {
90 $layer = new eZImageLayer();
91 $layer->setStoredFile( $fileName, $filePath, $fileType );
92 $layer->process();
93 return $layer;
94 }
95
97 public $TemplateURI;
98 }
99
100 ?>
eZImageInterface
Base interface for all image object and layer classes.
Definition: ezimageinterface.php:20
eZImageInterface\width
width()
Definition: ezimageinterface.php:555
eZImageInterface\isTruecolor
isTruecolor()
Definition: ezimageinterface.php:49
eZImageInterface\height
height()
Definition: ezimageinterface.php:563
eZImageInterface\imageObject
imageObject( $createMissing=true)
Definition: ezimageinterface.php:338
eZImageInterface\setFont
setFont( $font)
Definition: ezimageinterface.php:598
eZImageLayer
Defines a layer in a image object.
Definition: ezimagelayer.php:19
eZImageLayer\__construct
__construct( $imageObjectRef=null, $imageObject=null, $width=false, $height=false, $font=false)
Definition: ezimagelayer.php:20
eZImageLayer\$TemplateURI
$TemplateURI
Definition: ezimagelayer.php:97
eZImageLayer\mergeLayer
mergeLayer( $image, $layerData, $lastLayerData)
Definition: ezimagelayer.php:52
eZImageLayer\templateData
templateData()
Definition: ezimagelayer.php:32
eZImageLayer\createForFile
static createForFile( $fileName, $filePath, $fileType=false)
Definition: ezimagelayer.php:88
eZImageLayer\setTemplateURI
setTemplateURI( $uri)
Definition: ezimagelayer.php:42
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.