## 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. */
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. class ezcImageAnalyzerData extends ezcBaseStruct
52. {
53. /**
54. * Detected MIME type for the image.
55. *
56. * @var string
57. */
58. public $mime ;
60. /**
61. * EXIF information retrieved from image.
62. *
63. * This will only be filled in for images which supports EXIF entries,
64. * currently they are:
65. * - image/jpeg
66. * - image/tiff
67. *
68. * @link http://php.net/manual/en/function.exif-read-data.php
69. *
70. * @var array(string=>string)
71. */
72. public $exif = array();
74. /**
75. * Width of image in pixels.
76. *
77. * @var int
78. */
79. public $width = 0;
81. /**
82. * Height of image in pixels.
83. *
84. * @var int
85. */
86. public $height = 0;
88. /**
89. * Size of image file in bytes.
90. *
91. * @var int
92. */
93. public $size = 0;
95. /**
96. * The image mode.
97. *
98. * Can be one of:
99. * - ezcImageAnalyzerHandler::MODE_INDEXED - Image is built with a palette and consists of
100. * indexed values per pixel.
101. * - ezcImageAnalyzerHandler::MODE_TRUECOLOR - Image consists of RGB value per pixel.
102. *
103. * @var int
104. */
105. public $mode = ezcImageAnalyzerHandler::MODE_TRUECOLOR;
107. /**
108. * Type of transparency in image.
109. *
110. * Can be one of:
111. * - ezcImageAnalyzerHandler::TRANSPARENCY_OPAQUE - No parts of image is transparent.
112. * - ezcImageAnalyzerHandler::TRANSPARENCY_TRANSPARENT - Selected palette entries are
113. * completely see-through.
114. * - ezcImageAnalyzerHandler::TRANSPARENCY_TRANSLUCENT - Transparency determined pixel per
115. * pixel with a fuzzy value.
116. *
117. * @var int
118. */
119. public $transparencyType ;
121. /**
122. * Does the image have colors?
123. *
124. * @var bool
125. */
126. public $isColor = true;
128. /**
129. * Number of colors in image.
130. *
131. * @var int
132. */
133. public $colorCount = 0;
135. /**
136. * First inline comment for the image.
137. *
138. * @var string
139. */
140. public $comment = null;
142. /**
143. * List of inline comments for the image.
144. *
145. * @var array(string)
146. */
147. public $commentList = array();
149. /**
150. * Copyright text for the image.
151. *
152. * @var string
153. */
154. public $copyright = null;
156. /**
157. * The date when the picture was taken as UNIX timestamp.
158. *
159. * @var int
160. */
161. public $date ;
163. /**
164. * Does the image have a thumbnail?
165. *
166. * @var bool
167. */
168. public $hasThumbnail = false;
170. /**
171. * Is the image animated?
172. *
173. * @var bool
174. */
175. public $isAnimated = false;
177. /**
178. * Create a new instance of ezcImageAnalyzerData.
179. *
180. * Create a new instance of ezcImageAnalyzerData to be used with
181. * {@link ezcImageAnalyzer} objects.
182. *
183. * @see ezcImageAnalyzer::analyzeImage()
184. * @see ezcImageAnalyzerHandler::analyzeImage()
185. *
186. * @param string $mime {@link ezcImageAnalyzerData::$mime}
187. * @param array $exif {@link ezcImageAnalyzerData::$exif}
188. * @param int $width {@link ezcImageAnalyzerData::$width}
189. * @param int $height {@link ezcImageAnalyzerData::$height}
190. * @param int $size {@link ezcImageAnalyzerData::$size}
191. * @param int $mode {@link ezcImageAnalyzerData::$mode}
192. * @param int $transparencyType {@link ezcImageAnalyzerData::$transparencyType}
193. * @param bool $isColor {@link ezcImageAnalyzerData::$isColor}
194. * @param int $colorCount {@link ezcImageAnalyzerData::$colorCount}
195. * @param string $comment {@link ezcImageAnalyzerData::$comment}
196. * @param array $commentList {@link ezcImageAnalyzerData::$commentList}
197. * @param string $copyright {@link ezcImageAnalyzerData::$copyright}
198. * @param int $date {@link ezcImageAnalyzerData::$date}
199. * @param bool $hasThumbnail {@link ezcImageAnalyzerData::$hasThumbnail}
200. * @param bool $isAnimated {@link ezcImageAnalyzerData::$isAnimated}
201. */
202. public function __construct (
203. $mime = null,
204. $exif = array(),
205. $width = 0,
206. $height = 0,
207. $size = 0,
208. $mode = ezcImageAnalyzerHandler::MODE_TRUECOLOR,
209. $transparencyType = null,
210. $isColor = true,
211. $colorCount = 0,
212. $comment = null,
213. $commentList = array(),
214. $copyright = null,
215. $date = null,
216. $hasThumbnail = false,
217. $isAnimated = false
218. )
219. {
220. $this-> mime = $mime;
221. $this-> exif = $exif;
222. $this-> width = $width;
223. $this-> height = $height;
224. $this-> size = $size;
225. $this-> mode = $mode;
226. $this-> transparencyType = $transparencyType;
227. $this-> isColor = $isColor;
228. $this-> colorCount = $colorCount;
229. $this-> comment = $comment;
230. $this-> commentList = $commentList;
231. $this-> copyright = $copyright;
232. $this-> date = $date;
233. $this-> hasThumbnail = $hasThumbnail;
234. $this-> isAnimated = $isAnimated;
235. }
236. }
237. ?>

Documentation generated by phpDocumentor 1.4.3