Apache Zeta Components Manual :: File Source for save_options.php

Source for file save_options.php

Documentation is available at save_options.php

  1. <?php
  2. /**
  3.  * This file contains the ezcImageGdHandler class.
  4.  *
  5.  * Licensed to the Apache Software Foundation (ASF) under one
  6.  * or more contributor license agreements.  See the NOTICE file
  7.  * distributed with this work for additional information
  8.  * regarding copyright ownership.  The ASF licenses this file
  9.  * to you under the Apache License, Version 2.0 (the
  10.  * "License"); you may not use this file except in compliance
  11.  * with the License.  You may obtain a copy of the License at
  12.  * 
  13.  *   http://www.apache.org/licenses/LICENSE-2.0
  14.  * 
  15.  * Unless required by applicable law or agreed to in writing,
  16.  * software distributed under the License is distributed on an
  17.  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18.  * KIND, either express or implied.  See the License for the
  19.  * specific language governing permissions and limitations
  20.  * under the License.
  21.  *
  22.  * @package ImageConversion
  23.  * @version //autogentag//
  24.  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  25.  * @filesource
  26.  * @access public
  27.  */
  28.  
  29. /**
  30.  * Options class for ezcImageHandler->save() methods.
  31.  * 
  32.  * @property int $compression 
  33.  *            The compression level to use, if compression is supported by the
  34.  *            target format (e.g. TIFF). A value between 0 and 9 (incl.) is
  35.  *            expected.
  36.  * @property int $quality A quality indicator used to determine the quality of
  37.  *            the target image, if supported by the target format (e.g. JPEG). A
  38.  *            value between 0 and 100 (incl.) is expected.
  39.  * @property array(int) $transparencyReplacementColor 
  40.  *            Only certain image formats support transparent backgrounds (e.g.
  41.  *            GIF and PNG). If such images are converted to a format that does
  42.  *            not support transparency, this color will be used as the new
  43.  *            background. The color value is given as an array of integers, each
  44.  *            representing a color value in RGB between 0 and 255.
  45.  *            <code>array( 255, 0, 0 )</code> for example would be pure red.
  46.  *
  47.  * @package ImageConversion
  48.  * @version //autogen//
  49.  */
  50. {
  51.     /**
  52.      * Properties.
  53.      * 
  54.      * @var array(string=>mixed) 
  55.      */
  56.     protected $properties = array(
  57.         "compression"                  => null,
  58.         "quality"                      => null,
  59.         "transparencyReplacementColor" => null,
  60.     );
  61.  
  62.     /**
  63.      * Property set access.
  64.      * 
  65.      * @param string $propertyName 
  66.      * @param string $propertyValue 
  67.      * @ignore
  68.      * @return void 
  69.      */
  70.     public function __set$propertyName$propertyValue )
  71.     {
  72.         switch $propertyName )
  73.         {
  74.             case "compression":
  75.                 if ( ( !is_int$propertyValue || $propertyValue || $propertyValue && $propertyValue !== null )
  76.                 {
  77.                     throw new ezcBaseValueException$propertyName$propertyValue"int > 0 and < 10" );
  78.                 }
  79.                 break;
  80.             case "quality":
  81.                 if ( ( !is_int$propertyValue || $propertyValue || $propertyValue 100 && $propertyValue !== null )
  82.                 {
  83.                     throw new ezcBaseValueException$propertyName$propertyValue"int > 0 and <= 100" );
  84.                 }
  85.                 break;
  86.             case "transparencyReplacementColor":
  87.                 if ( ( !is_array$propertyValue || count$propertyValue || !isset$propertyValue[0|| !isset$propertyValue[1|| !isset$propertyValue[2) ) && $propertyValue !== null )
  88.                 {
  89.                     throw new ezcBaseValueException$propertyName$propertyValue"array(int)" );
  90.                 }
  91.                 break;
  92.             default:
  93.                 throw new ezcBasePropertyNotFoundException$propertyName );
  94.         }
  95.         $this->properties[$propertyName$propertyValue;
  96.     }
  97. }
  98.  
  99. ?>
Documentation generated by phpDocumentor 1.4.3