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

Source for file analyzer_data.php

Documentation is available at analyzer_data.php

  1. <?php
  2. /**
  3.  * File containing the ezcImageAnalyzerData struct.
  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 ImageAnalysis
  23.  * @version //autogentag//
  24.  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  25.  * @filesource
  26.  */
  27.  
  28. /**
  29.  * Struct to store the data retrieved from an image analysis.
  30.  *
  31.  * This class is used as a struct for the data retrieved from
  32.  * an {@link ezcImageAnalyzerHandler}. It stores various information about
  33.  * an analyzed image and pre-fills it's attributes with sensible default
  34.  * values, to make the usage as easy as possible.
  35.  *
  36.  * Ths struct class should not be accessed directly (except form
  37.  * {@link ezcImageAnalyzerHandler} classes, where it is created). From a
  38.  * users view it is transparently accessable through
  39.  * {@link ezcImageAnalyzer::$data}, more specific using
  40.  * <code>
  41.  * $analyzer = new ezcImageAnalyzer( 'myfile.jpg' );
  42.  * echo $analyzer->data->size;
  43.  * </code>
  44.  *
  45.  * @see ezcImageAnalyzer
  46.  * @see ezcImageAnalyzerHandler
  47.  *
  48.  * @package ImageAnalysis
  49.  * @version //autogentag//
  50.  */
  51. {
  52.     /**
  53.      * Detected MIME type for the image.
  54.      *
  55.      * @var string 
  56.      */
  57.     public $mime;
  58.  
  59.     /**
  60.      * EXIF information retrieved from image.
  61.      *
  62.      * This will only be filled in for images which supports EXIF entries,
  63.      * currently they are:
  64.      * - image/jpeg
  65.      * - image/tiff
  66.      *
  67.      * @link http://php.net/manual/en/function.exif-read-data.php
  68.      *
  69.      * @var array(string=>string) 
  70.      */
  71.     public $exif = array();
  72.  
  73.     /**
  74.      * Width of image in pixels.
  75.      *
  76.      * @var int 
  77.      */
  78.     public $width = 0;
  79.  
  80.     /**
  81.      * Height of image in pixels.
  82.      *
  83.      * @var int 
  84.      */
  85.     public $height = 0;
  86.  
  87.     /**
  88.      * Size of image file in bytes.
  89.      *
  90.      * @var int 
  91.      */
  92.     public $size = 0;
  93.  
  94.     /**
  95.      * The image mode.
  96.      *
  97.      * Can be one of:
  98.      * - ezcImageAnalyzerHandler::MODE_INDEXED   - Image is built with a palette and consists of
  99.      *                          indexed values per pixel.
  100.      * - ezcImageAnalyzerHandler::MODE_TRUECOLOR - Image consists of RGB value per pixel.
  101.      *
  102.      * @var int 
  103.      */
  104.     public $mode = ezcImageAnalyzerHandler::MODE_TRUECOLOR;
  105.  
  106.     /**
  107.      * Type of transparency in image.
  108.      *
  109.      * Can be one of:
  110.      * - ezcImageAnalyzerHandler::TRANSPARENCY_OPAQUE      - No parts of image is transparent.
  111.      * - ezcImageAnalyzerHandler::TRANSPARENCY_TRANSPARENT - Selected palette entries are
  112.      *                                    completely see-through.
  113.      * - ezcImageAnalyzerHandler::TRANSPARENCY_TRANSLUCENT - Transparency determined pixel per
  114.      *                                    pixel with a fuzzy value.
  115.      *
  116.      * @var int 
  117.      */
  118.     public $transparencyType;
  119.  
  120.     /**
  121.      * Does the image have colors?
  122.      *
  123.      * @var bool 
  124.      */
  125.     public $isColor = true;
  126.  
  127.     /**
  128.      * Number of colors in image.
  129.      *
  130.      * @var int 
  131.      */
  132.     public $colorCount = 0;
  133.  
  134.     /**
  135.      * First inline comment for the image.
  136.      *
  137.      * @var string 
  138.      */
  139.     public $comment = null;
  140.  
  141.     /**
  142.      * List of inline comments for the image.
  143.      *
  144.      * @var array(string) 
  145.      */
  146.     public $commentList = array();
  147.  
  148.     /**
  149.      * Copyright text for the image.
  150.      *
  151.      * @var string 
  152.      */
  153.     public $copyright = null;
  154.  
  155.     /**
  156.      * The date when the picture was taken as UNIX timestamp.
  157.      *
  158.      * @var int 
  159.      */
  160.     public $date;
  161.  
  162.     /**
  163.      * Does the image have a thumbnail?
  164.      *
  165.      * @var bool 
  166.      */
  167.     public $hasThumbnail = false;
  168.  
  169.     /**
  170.      * Is the image animated?
  171.      *
  172.      * @var bool 
  173.      */
  174.     public $isAnimated = false;
  175.  
  176.     /**
  177.      * Create a new instance of ezcImageAnalyzerData.
  178.      *
  179.      * Create a new instance of ezcImageAnalyzerData to be used with
  180.      * {@link ezcImageAnalyzer} objects.
  181.      *
  182.      * @see ezcImageAnalyzer::analyzeImage()
  183.      * @see ezcImageAnalyzerHandler::analyzeImage()
  184.      *
  185.      * @param string $mime {@link ezcImageAnalyzerData::$mime}
  186.      * @param array $exif {@link ezcImageAnalyzerData::$exif}
  187.      * @param int $width {@link ezcImageAnalyzerData::$width}
  188.      * @param int $height {@link ezcImageAnalyzerData::$height}
  189.      * @param int $size {@link ezcImageAnalyzerData::$size}
  190.      * @param int $mode {@link ezcImageAnalyzerData::$mode}
  191.      * @param int $transparencyType {@link ezcImageAnalyzerData::$transparencyType}
  192.      * @param bool $isColor {@link ezcImageAnalyzerData::$isColor}
  193.      * @param int $colorCount {@link ezcImageAnalyzerData::$colorCount}
  194.      * @param string $comment {@link ezcImageAnalyzerData::$comment}
  195.      * @param array $commentList {@link ezcImageAnalyzerData::$commentList}
  196.      * @param string $copyright {@link ezcImageAnalyzerData::$copyright}
  197.      * @param int $date {@link ezcImageAnalyzerData::$date}
  198.      * @param bool $hasThumbnail {@link ezcImageAnalyzerData::$hasThumbnail}
  199.      * @param bool $isAnimated {@link ezcImageAnalyzerData::$isAnimated}
  200.      */
  201.     public function __construct(
  202.         $mime null,
  203.         $exif array(),
  204.         $width 0,
  205.         $height 0,
  206.         $size 0,
  207.         $mode ezcImageAnalyzerHandler::MODE_TRUECOLOR,
  208.         $transparencyType null,
  209.         $isColor true,
  210.         $colorCount 0,
  211.         $comment null,
  212.         $commentList array(),
  213.         $copyright null,
  214.         $date null,
  215.         $hasThumbnail false,
  216.         $isAnimated false
  217.     )
  218.     {
  219.         $this->mime = $mime;
  220.         $this->exif = $exif;
  221.         $this->width = $width;
  222.         $this->height = $height;
  223.         $this->size = $size;
  224.         $this->mode = $mode;
  225.         $this->transparencyType = $transparencyType;
  226.         $this->isColor = $isColor;
  227.         $this->colorCount = $colorCount;
  228.         $this->comment = $comment;
  229.         $this->commentList = $commentList;
  230.         $this->copyright = $copyright;
  231.         $this->date = $date;
  232.         $this->hasThumbnail = $hasThumbnail;
  233.         $this->isAnimated = $isAnimated;
  234.     }
  235. }
  236. ?>
Documentation generated by phpDocumentor 1.4.3