Mercurial > hg > digilib-old
annotate servlet/src/digilib/io/ImageFileset.java @ 246:aaf6eace011d
Servlet version 1.19b4
- bug fixes
- new stuff in DocumentBean
author | robcast |
---|---|
date | Wed, 04 Aug 2004 20:42:48 +0200 |
parents | e40d8b2e3978 |
children | beed92ee6022 |
rev | line source |
---|---|
176 | 1 /* ImageFileset -- digilib image file info class. |
2 * Digital Image Library servlet components | |
3 * Copyright (C) 2003 Robert Casties (robcast@mail.berlios.de) | |
4 * | |
5 * This program is free software; you can | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
6 * redistribute it and/or modify it under the terms of the GNU General Public |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
7 * License as published by the Free Software Foundation; either version 2 of |
176 | 8 * the License, or (at your option) any later version. |
9 * | |
10 * Please read license.txt for the full details. A copy of the GPL may be | |
11 * found at http://www.gnu.org/copyleft/lgpl.html | |
12 * | |
13 * You should have received a copy of the GNU General Public License along | |
14 * with this program; if not, write to the Free Software Foundation, Inc., | |
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
159 | 16 */ |
176 | 17 |
159 | 18 package digilib.io; |
19 | |
20 import java.io.File; | |
21 import java.io.IOException; | |
22 import java.util.ArrayList; | |
23 import java.util.Iterator; | |
24 import java.util.ListIterator; | |
25 | |
26 import digilib.image.DocuInfo; | |
27 import digilib.image.ImageSize; | |
28 | |
29 /** | |
30 * @author casties | |
31 */ | |
32 public class ImageFileset extends DocuDirent { | |
33 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
34 /** this is an image file */ |
159 | 35 protected static int fileClass = FileOps.CLASS_IMAGE; |
36 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
37 /** list of files (ImageFile) */ |
159 | 38 private ArrayList list = null; |
233 | 39 |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
40 /** aspect ratio (width/height) */ |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
41 private double aspect = 0; |
233 | 42 |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
43 /** resolution of the biggest image (DPI) */ |
159 | 44 private double resX = 0; |
233 | 45 |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
46 /** resolution of the biggest image (DPI) */ |
159 | 47 private double resY = 0; |
48 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
49 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
50 * Creator for empty fileset with size for file list. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
51 * |
159 | 52 * |
53 * @param initialCapacity | |
54 */ | |
55 public ImageFileset(int initialCapacity) { | |
56 list = new ArrayList(initialCapacity); | |
57 } | |
58 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
59 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
60 * Creator with a file and base directories. |
159 | 61 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
62 * Reads the file and fills the fileset with corresponding files from the |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
63 * other base directories. First entry in dirs is the parent of this |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
64 * fileset. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
65 * |
159 | 66 * |
67 * @see fill | |
233 | 68 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
69 * @param dirs |
233 | 70 * array of base directories |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
71 * @param file |
233 | 72 * first file to read |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
73 * @param scalext |
233 | 74 * extension for scaled images |
159 | 75 */ |
76 public ImageFileset(Directory[] dirs, File file, String scalext) { | |
77 int nb = dirs.length; | |
78 list = new ArrayList(nb); | |
79 parent = dirs[0]; | |
80 fill(dirs, file, scalext); | |
81 } | |
82 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
83 /** |
176 | 84 * Adds an ImageFile to this Fileset. |
159 | 85 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
86 * The files should be added in the order of higher to lower resolutions. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
87 * The first file is considered the hires "original". |
159 | 88 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
89 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
90 * @param f |
233 | 91 * file to add |
159 | 92 * @return true (always) |
93 */ | |
94 public boolean add(ImageFile f) { | |
95 f.setParent(this); | |
96 return list.add(f); | |
97 } | |
98 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
99 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
100 * The number of image files in this Fileset. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
101 * |
159 | 102 * |
103 * @return number of image files | |
104 */ | |
105 public int size() { | |
106 return (list != null) ? list.size() : 0; | |
107 } | |
108 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
109 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
110 * Gets the default File. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
111 * |
159 | 112 */ |
113 public File getFile() { | |
114 return (list != null) ? ((ImageFile) list.get(0)).getFile() : null; | |
115 } | |
116 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
117 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
118 * Get the ImageFile at the index. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
119 * |
159 | 120 * |
121 * @param index | |
122 * @return | |
123 */ | |
124 public ImageFile get(int index) { | |
125 return (ImageFile) list.get(index); | |
126 } | |
127 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
128 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
129 * Get the next smaller ImageFile than the given size. |
159 | 130 * |
233 | 131 * Returns the ImageFile from the set that has a width and height smaller or |
132 * equal the given size. Returns null if there isn't any smaller image. | |
159 | 133 * Needs DocuInfo instance to checkFile(). |
134 * | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
135 * |
159 | 136 * @param size |
137 * @param info | |
138 * @return | |
139 */ | |
140 public ImageFile getNextSmaller(ImageSize size, DocuInfo info) { | |
141 for (Iterator i = getHiresIterator(); i.hasNext();) { | |
142 ImageFile f = (ImageFile) i.next(); | |
143 try { | |
144 if (!f.isChecked()) { | |
145 info.checkFile(f); | |
146 } | |
147 if (f.getSize().isTotallySmallerThan(size)) { | |
148 return f; | |
149 } | |
150 } catch (IOException e) { | |
151 } | |
152 } | |
153 return null; | |
154 } | |
155 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
156 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
157 * Get the next bigger ImageFile than the given size. |
159 | 158 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
159 * Returns the ImageFile from the set that has a width or height bigger or |
233 | 160 * equal the given size. Returns null if there isn't any bigger image. Needs |
161 * DocuInfo instance to checkFile(). | |
159 | 162 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
163 * |
159 | 164 * @param size |
165 * @param info | |
166 * @return | |
167 */ | |
168 public ImageFile getNextBigger(ImageSize size, DocuInfo info) { | |
169 for (ListIterator i = getLoresIterator(); i.hasPrevious();) { | |
170 ImageFile f = (ImageFile) i.previous(); | |
171 try { | |
172 if (!f.isChecked()) { | |
173 info.checkFile(f); | |
174 } | |
175 if (f.getSize().isBiggerThan(size)) { | |
176 return f; | |
177 } | |
178 } catch (IOException e) { | |
179 } | |
180 } | |
181 return null; | |
182 } | |
183 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
184 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
185 * Returns the biggest ImageFile in the set. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
186 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
187 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
188 * @return |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
189 */ |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
190 public ImageFile getBiggest() { |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
191 return this.get(0); |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
192 } |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
193 |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
194 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
195 * Returns the biggest ImageFile in the set. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
196 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
197 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
198 * @return |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
199 */ |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
200 public ImageFile getSmallest() { |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
201 return this.get(this.size() - 1); |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
202 } |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
203 |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
204 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
205 * Get an Iterator for this Fileset starting at the highest resolution |
159 | 206 * images. |
207 * | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
208 * |
159 | 209 * @return |
210 */ | |
211 public ListIterator getHiresIterator() { | |
212 return list.listIterator(); | |
213 } | |
214 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
215 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
216 * Get an Iterator for this Fileset starting at the lowest resolution |
159 | 217 * images. |
218 * | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
219 * The Iterator starts at the last element, so you have to use it backwards |
159 | 220 * with hasPrevious() and previous(). |
221 * | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
222 * |
159 | 223 * @return |
224 */ | |
225 public ListIterator getLoresIterator() { | |
226 return list.listIterator(list.size()); | |
227 } | |
228 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
229 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
230 * Fill the ImageFileset with files from different base directories. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
231 * |
159 | 232 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
233 * @param dirs |
233 | 234 * list of base directories |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
235 * @param fl |
233 | 236 * file (from first base dir) |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
237 * @param scalext |
233 | 238 * first extension to try in other base dirs |
159 | 239 */ |
240 void fill(Directory[] dirs, File fl, String scalext) { | |
241 int nb = dirs.length; | |
242 String fn = fl.getName(); | |
243 String fnx = fn.substring(0, fn.lastIndexOf('.') + 1); | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
244 // add the first ImageFile to the ImageFileset |
159 | 245 add(new ImageFile(fn, this, parent)); |
246 // iterate the remaining base directories | |
247 for (int j = 1; j < nb; j++) { | |
248 if (dirs[j] == null) { | |
249 continue; | |
250 } | |
251 File f; | |
252 if (scalext != null) { | |
253 // use the last extension | |
254 f = new File(dirs[j].getDir(), fnx + scalext); | |
255 } else { | |
256 // try the same filename as the original | |
257 f = new File(dirs[j].getDir(), fn); | |
258 } | |
259 // if the file exists, add to the ImageFileset | |
260 if (f.canRead()) { | |
261 add(new ImageFile(f.getName(), this, dirs[j])); | |
262 } else { | |
263 // try other file extensions | |
264 Iterator exts = FileOps.getImageExtensionIterator(); | |
265 while (exts.hasNext()) { | |
266 String s = (String) exts.next(); | |
267 f = new File(dirs[j].getDir(), fnx + s); | |
268 // if the file exists, add to the ImageFileset | |
269 if (f.canRead()) { | |
270 add(new ImageFile(f.getName(), this, dirs[j])); | |
271 scalext = s; | |
272 break; | |
273 } | |
274 } | |
275 } | |
276 } | |
277 } | |
278 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
279 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
280 * Checks metadata and sets resolution in resX and resY. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
281 * |
159 | 282 */ |
283 public void checkMeta() { | |
284 if (metaChecked) { | |
285 return; | |
286 } | |
287 if (fileMeta == null) { | |
288 // try to read metadata file | |
289 readMeta(); | |
290 if (fileMeta == null) { | |
291 // try directory metadata | |
233 | 292 ((DocuDirectory) parent).checkMeta(); |
159 | 293 if (((DocuDirectory) parent).getDirMeta() != null) { |
294 fileMeta = ((DocuDirectory) parent).getDirMeta(); | |
295 } else { | |
233 | 296 // try parent directory metadata |
297 DocuDirectory gp = (DocuDirectory) parent.getParent(); | |
298 if (gp != null) { | |
299 gp.checkMeta(); | |
300 if (gp.getDirMeta() != null) { | |
301 fileMeta = gp.getDirMeta(); | |
302 } else { | |
303 // no metadata available | |
304 metaChecked = true; | |
305 return; | |
306 } | |
307 } | |
159 | 308 } |
309 } | |
310 } | |
311 metaChecked = true; | |
312 String s; | |
313 double dpi = 0; | |
314 double dpix = 0; | |
315 double dpiy = 0; | |
316 double sizex = 0; | |
317 double sizey = 0; | |
318 double pixx = 0; | |
319 double pixy = 0; | |
320 // DPI is valid for X and Y | |
321 if (fileMeta.containsKey("original-dpi")) { | |
322 try { | |
323 dpi = Double.parseDouble((String) fileMeta.get("original-dpi")); | |
324 } catch (NumberFormatException e) { | |
325 } | |
326 if (dpi != 0) { | |
327 resX = dpi; | |
328 resY = dpi; | |
329 return; | |
330 } | |
331 } | |
332 // DPI-X and DPI-Y | |
333 if (fileMeta.containsKey("original-dpi-x") | |
233 | 334 && fileMeta.containsKey("original-dpi-y")) { |
159 | 335 try { |
233 | 336 dpix = Double.parseDouble((String) fileMeta |
337 .get("original-dpi-x")); | |
338 dpiy = Double.parseDouble((String) fileMeta | |
339 .get("original-dpi-y")); | |
159 | 340 } catch (NumberFormatException e) { |
341 } | |
342 if ((dpix != 0) && (dpiy != 0)) { | |
343 resX = dpix; | |
344 resY = dpiy; | |
345 return; | |
346 } | |
347 } | |
348 // SIZE-X and SIZE-Y and PIXEL-X and PIXEL-Y | |
349 if (fileMeta.containsKey("original-size-x") | |
233 | 350 && fileMeta.containsKey("original-size-y") |
351 && fileMeta.containsKey("original-pixel-x") | |
352 && fileMeta.containsKey("original-pixel-y")) { | |
159 | 353 try { |
233 | 354 sizex = Double.parseDouble((String) fileMeta |
355 .get("original-size-x")); | |
356 sizey = Double.parseDouble((String) fileMeta | |
357 .get("original-size-y")); | |
358 pixx = Double.parseDouble((String) fileMeta | |
359 .get("original-pixel-x")); | |
360 pixy = Double.parseDouble((String) fileMeta | |
361 .get("original-pixel-y")); | |
159 | 362 } catch (NumberFormatException e) { |
363 } | |
364 if ((sizex != 0) && (sizey != 0) && (pixx != 0) && (pixy != 0)) { | |
365 resX = pixx / (sizex * 100 / 2.54); | |
366 resY = pixy / (sizey * 100 / 2.54); | |
367 return; | |
368 } | |
369 } | |
370 } | |
371 | |
372 /** | |
373 * @return | |
374 */ | |
375 public double getResX() { | |
376 return resX; | |
377 } | |
378 | |
379 /** | |
380 * @return | |
381 */ | |
382 public double getResY() { | |
383 return resY; | |
384 } | |
385 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
386 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
387 * Sets the aspect ratio from an ImageSize. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
388 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
389 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
390 * @param f |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
391 */ |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
392 public void setAspect(ImageSize s) { |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
393 aspect = s.getAspect(); |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
394 } |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
395 |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
396 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
397 * Returns the aspect ratio. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
398 * |
233 | 399 * Aspect ratio is (width/height). So it's <1 for portrait and >1 for |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
400 * landscape. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
401 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
402 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
403 * @return |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
404 */ |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
405 public double getAspect() { |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
406 return aspect; |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
407 } |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
408 |
233 | 409 } |