mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
EZ-Components
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageConverterSettings struct.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
* @filesource
|
||||
*/
|
||||
|
||||
/**
|
||||
* Struct to store the settings for objects of ezcImageConverter.
|
||||
*
|
||||
* This class is used as a struct for the settings of ezcImageConverter.
|
||||
*
|
||||
* @see ezcImageConverter
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageConverterSettings extends ezcBaseStruct
|
||||
{
|
||||
/**
|
||||
* Array with {@link ezcImageHandlerSettings handler settings} objects.
|
||||
* Each settings objects is consulted by the converter to figure out which
|
||||
* {@link ezcImageHandler image handlers} to use.
|
||||
*
|
||||
* @see ezcImageHandler
|
||||
* @see ezcImageGdHandler
|
||||
* @see ezcImageImagemagickHandler
|
||||
*
|
||||
* @var array(ezcImageHandlerSettings)
|
||||
*/
|
||||
public $handlers = array();
|
||||
|
||||
/**
|
||||
* Map of automatic MIME type conversions. The converter will automatically
|
||||
* perform the defined conversions when a transformation is applied through
|
||||
* it and the specific MIME type is recognized.
|
||||
*
|
||||
* The conversion map has the following structure:
|
||||
* <code>
|
||||
* array(
|
||||
* 'image/gif' => 'image/png', // Note: lower case!
|
||||
* 'image/bmp' => 'image/jpeg',
|
||||
* )
|
||||
* </code>
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $conversions = array();
|
||||
|
||||
/**
|
||||
* Create a new instance of ezcImageConverterSettings.
|
||||
* Create a new instance of ezcImageConverterSettings to be used with
|
||||
* {@link ezcImageConverter} objects..
|
||||
*
|
||||
* @see ezcImageConverterSettings::$handlers
|
||||
* @see ezcImageConverterSettings::$conversions
|
||||
*
|
||||
* @param array $handlers Array of {@link ezcImageHandlerSettings handler objects}.
|
||||
* @param array $conversions Map of standard MIME type conversions.
|
||||
*/
|
||||
public function __construct( array $handlers = array(), array $conversions = array() )
|
||||
{
|
||||
$this->handlers = $handlers;
|
||||
$this->conversions = $conversions;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageFilter struct.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
* @filesource
|
||||
*/
|
||||
|
||||
/**
|
||||
* Struct to store information about a filter operation.
|
||||
*
|
||||
* The struct contains the {@link self::name name} of the filter to use and
|
||||
* which {@link self::options options} to use for it.
|
||||
*
|
||||
* Possible filter names are determined by the methods defined in the following
|
||||
* filter interfaces:
|
||||
*
|
||||
* <ul>
|
||||
* <li>{@link ezcImageGeometryFilters}</li>
|
||||
* <li>{@link ezcImageColorspaceFilters}</li>
|
||||
* <li>{@link ezcImageEffectFilters}</li>
|
||||
* <li>{@link ezcImageWatermarkFilters}</li>
|
||||
* <li>{@link ezcImageThumbnailFilters}</li>
|
||||
* </ul>
|
||||
*
|
||||
* The options for each filter are represented by the parameters received by
|
||||
* their corresponding method. You can determine if a certain {@link
|
||||
* ezcImageHandler} implementation supports a filter by checking the interfaces
|
||||
* this handler implements.
|
||||
*
|
||||
* @see ezcImageTransformation
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageFilter extends ezcBaseStruct
|
||||
{
|
||||
/**
|
||||
* Name of filter operation to use.
|
||||
*
|
||||
* @see ezcImageEffectFilters
|
||||
* @see ezcImageGeometryFilters
|
||||
* @see ezcImageColorspaceFilters
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* Associative array of options for the filter operation.
|
||||
* The array key is the option name and the array entry is the value for
|
||||
* the option.
|
||||
* Consult each filter operation to see which names and values to use.
|
||||
*
|
||||
* @see ezcImageEffectFilters
|
||||
* @see ezcImageGeometryFilters
|
||||
* @see ezcImageColorspaceFilters
|
||||
*
|
||||
* @var array(string=>mixed)
|
||||
*/
|
||||
public $options;
|
||||
|
||||
/**
|
||||
* Initialize with the filter name and options.
|
||||
*
|
||||
* @see ezcImageFilter::$name
|
||||
* @see ezcImageFilter::$options
|
||||
*
|
||||
* @param array $name Name of filter operation.
|
||||
* @param array $options Associative array of options for filter operation.
|
||||
*/
|
||||
public function __construct( $name, array $options = array() )
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->options = $options;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageHandlerSettings struct.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
* @filesource
|
||||
*/
|
||||
|
||||
/**
|
||||
* Struct to store the settings for objects of ezcImageHandler.
|
||||
*
|
||||
* This class is used as a struct for the settings of ezcImageHandler
|
||||
* subclasses.
|
||||
*
|
||||
* @see ezcImageHandler
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageHandlerSettings extends ezcBaseStruct
|
||||
{
|
||||
/**
|
||||
* The reference name for the handler.
|
||||
* This name can be used when referencing the handler in certain operations
|
||||
* in the {@link ezcImageConverter converter} class.
|
||||
*
|
||||
* e.g. 'GD' and 'ImageMagick'.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $referenceName;
|
||||
|
||||
/**
|
||||
* Name of the class to instantiate as image handler.
|
||||
*
|
||||
* Note: This class must be a subclass of the {@link ezcImageHandler} class.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $className;
|
||||
|
||||
/**
|
||||
* Associative array of misc options for the handler.
|
||||
* These options will be read by the handler class and varies from handler
|
||||
* to handler. Consult the handler class for the available settings.
|
||||
*
|
||||
* The options array has the following structure:
|
||||
* <code>
|
||||
* array(
|
||||
* <optionName> => <optionValue>,
|
||||
* [ <optionName> => <optionValue>, ...]
|
||||
* )
|
||||
* </code>
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $options = array();
|
||||
|
||||
/**
|
||||
* Initialize settings to be used by image handler.
|
||||
* The settings passed as parameter will be read by the
|
||||
* {@link ezcImageConverter converter} to figure out which image handler to
|
||||
* use and then passed to the {@link ezcImageHandler image handler objects}.
|
||||
*
|
||||
* @see ezcImageHandlerSettings::$referenceName
|
||||
* @see ezcImageHandlerSettings::$className
|
||||
* @see ezcImageHandlerSettings::$settings
|
||||
*
|
||||
* @param string $referenceName
|
||||
* The reference name for the handler, e.g. 'GD' or 'ImageMagick'
|
||||
* @param string $className
|
||||
* The name of the handler class to instantiate, e.g.
|
||||
* 'ezcImageGdHandler' or 'ezcImageImagemagickHandler'
|
||||
* @param array $options
|
||||
* Associative array of settings for the handler.
|
||||
*/
|
||||
public function __construct( $referenceName, $className, array $options = array() )
|
||||
{
|
||||
$this->referenceName = $referenceName;
|
||||
$this->className = $className;
|
||||
$this->options = $options;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user