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

Source for file geometry.php

Documentation is available at geometry.php

  1. <?php
  2. /**
  3.  * File containing the ezcImageGeometryFilters interface.
  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.  */
  27.  
  28. /**
  29.  * This interface has to implemented by ezcImageFilters classes to
  30.  * support geometry filters.
  31.  *
  32.  * @see ezcImageHandler
  33.  * @see ezcImageTransformation
  34.  * @see ezcImageFiltersInterface
  35.  *
  36.  * @package ImageConversion
  37.  * @version //autogentag//
  38.  */
  39. {
  40.     /**
  41.      * Scale up and down, as fits
  42.      * @var int 
  43.      */
  44.     const SCALE_BOTH 1;
  45.  
  46.     /**
  47.      * Scale down only
  48.      * @var int 
  49.      */
  50.     const SCALE_DOWN 2;
  51.  
  52.     /**
  53.      * Scale up only
  54.      * @var int 
  55.      */
  56.     const SCALE_UP 3;
  57.  
  58.     /**
  59.      * Scale filter.
  60.      * General scale filter. Scales the image to fit into a given box size,
  61.      * determined by a given width and height value, measured in pixel. This
  62.      * method maintains the aspect ratio of the given image. Depending on the
  63.      * given direction value, this method performs the following scales:
  64.      *
  65.      * - ezcImageGeometryFilters::SCALE_BOTH:
  66.      *      The image will be scaled to fit exactly into the given box
  67.      *      dimensions, no matter if it was smaller or larger as the box
  68.      *      before.
  69.      * - ezcImageGeometryFilters::SCALE_DOWN:
  70.      *      The image will be scaled to fit exactly into the given box
  71.      *      only if it was larger than the given box dimensions before. If it
  72.      *      is smaller, the image will not be scaled at all.
  73.      * - ezcImageGeometryFilters::SCALE_UP:
  74.      *      The image will be scaled to fit exactly into the given box
  75.      *      only if it was smaller than the given box dimensions before. If it
  76.      *      is larger, the image will not be scaled at all. ATTENTION:
  77.      *      In this case, the image does not necessarily fit into the given box
  78.      *      afterwards.
  79.      *
  80.      * @param int $width     Scale to width
  81.      * @param int $height    Scale to height
  82.      * @param int $direction Scale to which direction.
  83.      * @return void 
  84.      *
  85.      * @throws ezcImageInvalidReferenceException
  86.      *          If no valid resource for the active reference could be found.
  87.      * @throws ezcImageFilterFailedException
  88.      *          If the operation performed by the the filter failed.
  89.      * @throws ezcBaseValueException
  90.      *          If a submitted parameter was out of range or type.
  91.      */
  92.     function scale$width$height$direction ezcImageGeometryFilters::SCALE_BOTH );
  93.  
  94.     /**
  95.      * Scale after width filter.
  96.      * Scales the image to a give width, measured in pixel. Scales the height
  97.      * automatically while keeping the ratio. The direction dictates, if an
  98.      * image may only be scaled {@link self::SCALE_UP}{@link self::SCALE_DOWN}
  99.      * or if the scale may work in {@link self::SCALE_BOTH} directions.
  100.      *
  101.      * @param int $width     Scale to width
  102.      * @param int $direction Scale to which direction
  103.      * @return void 
  104.      *
  105.      * @throws ezcImageInvalidReferenceException
  106.      *          If no valid resource for the active reference could be found.
  107.      * @throws ezcImageFilterFailedException
  108.      *          If the operation performed by the the filter failed.
  109.      * @throws ezcBaseValueException
  110.      *          If a submitted parameter was out of range or type.
  111.      */
  112.     function scaleWidth$width$direction );
  113.  
  114.     /**
  115.      * Scale after height filter.
  116.      * Scales the image to a give height, measured in pixel. Scales the width
  117.      * automatically while keeping the ratio. The direction dictates, if an
  118.      * image may only be scaled {@link self::SCALE_UP}{@link self::SCALE_DOWN}
  119.      * or if the scale may work in {@link self::SCALE_BOTH} directions.
  120.      *
  121.      * @param int $height    Scale to height
  122.      * @param int $direction Scale to which direction
  123.      * @return void 
  124.      *
  125.      * @throws ezcImageInvalidReferenceException
  126.      *          If no valid resource for the active reference could be found.
  127.      * @throws ezcImageFilterFailedException
  128.      *          If the operation performed by the the filter failed.
  129.      * @throws ezcBaseValueException
  130.      *          If a submitted parameter was out of range or type.
  131.      */
  132.     function scaleHeight$height$direction );
  133.  
  134.     /**
  135.      * Scale percent measures filter.
  136.      * Scale an image to a given percentage value size.
  137.      *
  138.      * @param int $width  Scale to width
  139.      * @param int $height Scale to height
  140.      * @return void 
  141.      *
  142.      * @throws ezcImageInvalidReferenceException
  143.      *          If no valid resource for the active reference could be found.
  144.      * @throws ezcImageFilterFailedException
  145.      *          If the operation performed by the the filter failed.
  146.      * @throws ezcBaseValueException
  147.      *          If a submitted parameter was out of range or type.
  148.      */
  149.     function scalePercent$width$height );
  150.  
  151.     /**
  152.      * Scale exact filter.
  153.      * Scale the image to a fixed given pixel size, no matter to which
  154.      * direction.
  155.      * 
  156.      * @param int $width  Scale to width
  157.      * @param int $height Scale to height
  158.      * @return void 
  159.      *
  160.      * @throws ezcImageInvalidReferenceException
  161.      *          If no valid resource for the active reference could be found.
  162.      * @throws ezcImageFilterFailedException
  163.      *          If the operation performed by the the filter failed.
  164.      * @throws ezcBaseValueException
  165.      *          If a submitted parameter was out of range or type.
  166.      */
  167.     function scaleExact$width$height );
  168.  
  169.     /**
  170.      * Crop filter.
  171.      * Crop an image to a given size. This takes cartesian coordinates of a
  172.      * rect area to crop from the image. The cropped area will replace the old
  173.      * image resource (not the input image immediately, if you use the
  174.      * {@link ezcImageConverter}).  Coordinates are given as integer values and
  175.      * are measured from the top left corner.
  176.      *
  177.      * @param int $x      Start cropping, x coordinate.
  178.      * @param int $y      Start cropping, y coordinate.
  179.      * @param int $width  Width of cropping area.
  180.      * @param int $height Height of cropping area.
  181.      * @return void 
  182.      *
  183.      * @throws ezcImageInvalidReferenceException
  184.      *          If no valid resource for the active reference could be found.
  185.      * @throws ezcImageFilterFailedException
  186.      *          If the operation performed by the the filter failed.
  187.      * @throws ezcBaseValueException
  188.      *          If a submitted parameter was out of range or type.
  189.      */
  190.     function crop$x$y$width$height );
  191. }
  192. ?>
Documentation generated by phpDocumentor 1.4.3