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

Documentation generated by phpDocumentor 1.4.3