Mercurial > hg > digilib-old
annotate servlet/src/digilib/io/ImageFileset.java @ 286:07bb7d594477 Root_gen2
Servlet version 1.22b1
- more fast searching (hopefully all working now)
- some simple synchronisation
- some reshuffling of methods to eliminate cruft
author | robcast |
---|---|
date | Fri, 15 Oct 2004 17:00:15 +0200 |
parents | c633e97cac12 |
children | 90bab835fc25 |
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; | |
259 | 23 import java.util.Arrays; |
159 | 24 import java.util.Iterator; |
25 import java.util.ListIterator; | |
259 | 26 import java.util.Map; |
159 | 27 |
284 | 28 import org.apache.log4j.Logger; |
29 | |
30 import digilib.image.ImageOps; | |
159 | 31 import digilib.image.ImageSize; |
32 | |
33 /** | |
34 * @author casties | |
35 */ | |
36 public class ImageFileset extends DocuDirent { | |
37 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
38 /** this is an image file */ |
159 | 39 protected static int fileClass = FileOps.CLASS_IMAGE; |
284 | 40 |
41 /** logger for this class */ | |
42 private static Logger logger = Logger.getLogger(ImageFileset.class); | |
159 | 43 |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
44 /** list of files (ImageFile) */ |
159 | 45 private ArrayList list = null; |
233 | 46 |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
47 /** aspect ratio (width/height) */ |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
48 private double aspect = 0; |
233 | 49 |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
50 /** resolution of the biggest image (DPI) */ |
159 | 51 private double resX = 0; |
233 | 52 |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
53 /** resolution of the biggest image (DPI) */ |
159 | 54 private double resY = 0; |
55 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
56 /** |
259 | 57 * Creator for empty fileset. |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
58 * |
159 | 59 * |
60 * @param initialCapacity | |
61 */ | |
259 | 62 public ImageFileset() { |
63 list = new ArrayList(); | |
159 | 64 } |
65 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
66 /** |
259 | 67 * Constructor with a file and hints. |
159 | 68 * |
259 | 69 * The hints are expected to contain 'basedirs' and 'scaledfilext' keys. |
233 | 70 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
71 * @param file |
259 | 72 * @param hints |
159 | 73 */ |
259 | 74 public ImageFileset(File file, Map hints) { |
75 Directory[] dirs = (Directory[]) hints.get(FileOps.HINT_BASEDIRS); | |
159 | 76 int nb = dirs.length; |
77 list = new ArrayList(nb); | |
78 parent = dirs[0]; | |
284 | 79 fill(dirs, file, hints); |
159 | 80 } |
284 | 81 |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
82 /** |
176 | 83 * Adds an ImageFile to this Fileset. |
159 | 84 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
85 * 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
|
86 * The first file is considered the hires "original". |
159 | 87 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
88 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
89 * @param f |
233 | 90 * file to add |
159 | 91 * @return true (always) |
92 */ | |
93 public boolean add(ImageFile f) { | |
94 f.setParent(this); | |
95 return list.add(f); | |
96 } | |
97 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
98 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
99 * The number of image files in this Fileset. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
100 * |
159 | 101 * |
102 * @return number of image files | |
103 */ | |
104 public int size() { | |
105 return (list != null) ? list.size() : 0; | |
106 } | |
107 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
108 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
109 * Gets the default File. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
110 * |
159 | 111 */ |
112 public File getFile() { | |
113 return (list != null) ? ((ImageFile) list.get(0)).getFile() : null; | |
114 } | |
115 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
116 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
117 * Get the ImageFile at the index. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
118 * |
159 | 119 * |
120 * @param index | |
121 * @return | |
122 */ | |
123 public ImageFile get(int index) { | |
124 return (ImageFile) list.get(index); | |
125 } | |
126 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
127 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
128 * Get the next smaller ImageFile than the given size. |
159 | 129 * |
233 | 130 * Returns the ImageFile from the set that has a width and height smaller or |
131 * equal the given size. Returns null if there isn't any smaller image. | |
159 | 132 * Needs DocuInfo instance to checkFile(). |
133 * | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
134 * |
159 | 135 * @param size |
136 * @param info | |
137 * @return | |
138 */ | |
284 | 139 public ImageFile getNextSmaller(ImageSize size) { |
159 | 140 for (Iterator i = getHiresIterator(); i.hasNext();) { |
141 ImageFile f = (ImageFile) i.next(); | |
142 try { | |
143 if (!f.isChecked()) { | |
284 | 144 ImageOps.checkFile(f); |
159 | 145 } |
146 if (f.getSize().isTotallySmallerThan(size)) { | |
147 return f; | |
148 } | |
149 } catch (IOException e) { | |
150 } | |
151 } | |
152 return null; | |
153 } | |
154 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
155 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
156 * Get the next bigger ImageFile than the given size. |
159 | 157 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
158 * Returns the ImageFile from the set that has a width or height bigger or |
233 | 159 * equal the given size. Returns null if there isn't any bigger image. Needs |
160 * DocuInfo instance to checkFile(). | |
159 | 161 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
162 * |
159 | 163 * @param size |
164 * @param info | |
165 * @return | |
166 */ | |
284 | 167 public ImageFile getNextBigger(ImageSize size) { |
159 | 168 for (ListIterator i = getLoresIterator(); i.hasPrevious();) { |
169 ImageFile f = (ImageFile) i.previous(); | |
170 try { | |
171 if (!f.isChecked()) { | |
284 | 172 ImageOps.checkFile(f); |
159 | 173 } |
174 if (f.getSize().isBiggerThan(size)) { | |
175 return f; | |
176 } | |
177 } catch (IOException e) { | |
178 } | |
179 } | |
180 return null; | |
181 } | |
182 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
183 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
184 * Returns the biggest ImageFile in the set. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
185 * |
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 * @return |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
188 */ |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
189 public ImageFile getBiggest() { |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
190 return this.get(0); |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
191 } |
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 * Returns the biggest ImageFile in the set. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
195 * |
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 * @return |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
198 */ |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
199 public ImageFile getSmallest() { |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
200 return this.get(this.size() - 1); |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
201 } |
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 * Get an Iterator for this Fileset starting at the highest resolution |
159 | 205 * images. |
206 * | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
207 * |
159 | 208 * @return |
209 */ | |
210 public ListIterator getHiresIterator() { | |
211 return list.listIterator(); | |
212 } | |
213 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
214 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
215 * Get an Iterator for this Fileset starting at the lowest resolution |
159 | 216 * images. |
217 * | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
218 * The Iterator starts at the last element, so you have to use it backwards |
159 | 219 * with hasPrevious() and previous(). |
220 * | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
221 * |
159 | 222 * @return |
223 */ | |
224 public ListIterator getLoresIterator() { | |
225 return list.listIterator(list.size()); | |
226 } | |
227 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
228 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
229 * Fill the ImageFileset with files from different base directories. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
230 * |
159 | 231 * |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
232 * @param dirs |
233 | 233 * list of base directories |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
234 * @param fl |
233 | 235 * file (from first base dir) |
259 | 236 * @param hints |
284 | 237 * |
159 | 238 */ |
259 | 239 void fill(Directory[] dirs, File fl, Map hints) { |
240 String scalext = (String) hints.get(FileOps.HINT_FILEEXT); | |
159 | 241 int nb = dirs.length; |
242 String fn = fl.getName(); | |
259 | 243 String baseFn = FileOps.basename(fn); |
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 | |
284 | 247 for (int dirIdx = 1; dirIdx < nb; dirIdx++) { |
248 if (dirs[dirIdx] == null) { | |
159 | 249 continue; |
250 } | |
284 | 251 // read the directory |
252 if (dirs[dirIdx].getFilenames() == null) { | |
253 dirs[dirIdx].readDir(); | |
259 | 254 } |
284 | 255 String[] dirFiles = dirs[dirIdx].getFilenames(); |
256 // try the same filename as the original | |
257 int fileIdx = Arrays.binarySearch(dirFiles, fn); | |
258 if (fileIdx < 0) { | |
259 // try closest matches without extension | |
260 fileIdx = -fileIdx - 1; | |
261 // try idx | |
262 if ((fileIdx < dirFiles.length) | |
263 && (FileOps.basename(dirFiles[fileIdx]).equals(baseFn))) { | |
264 // idx ok | |
265 } else if ((fileIdx > 0) | |
266 && (FileOps.basename(dirFiles[fileIdx - 1]) | |
267 .equals(baseFn))) { | |
268 // idx-1 ok | |
269 fileIdx = fileIdx - 1; | |
270 } else if ((fileIdx+1 < dirFiles.length) | |
271 && (FileOps.basename(dirFiles[fileIdx + 1]) | |
272 .equals(baseFn))) { | |
273 // idx+1 ok | |
274 fileIdx = fileIdx + 1; | |
275 } else { | |
276 // basename doesn't match | |
277 continue; | |
259 | 278 } |
159 | 279 } |
284 | 280 if (FileOps.classForFilename(dirFiles[fileIdx]) == FileOps.CLASS_IMAGE) { |
281 logger.debug("adding file " + dirFiles[fileIdx] | |
282 + " to Fileset " + this.getName()); | |
283 add(new ImageFile(dirFiles[fileIdx], this, dirs[dirIdx])); | |
259 | 284 } |
159 | 285 } |
286 } | |
287 | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
288 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
289 * Checks metadata and sets resolution in resX and resY. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
290 * |
159 | 291 */ |
292 public void checkMeta() { | |
293 if (metaChecked) { | |
294 return; | |
295 } | |
296 if (fileMeta == null) { | |
297 // try to read metadata file | |
298 readMeta(); | |
299 if (fileMeta == null) { | |
300 // try directory metadata | |
233 | 301 ((DocuDirectory) parent).checkMeta(); |
159 | 302 if (((DocuDirectory) parent).getDirMeta() != null) { |
303 fileMeta = ((DocuDirectory) parent).getDirMeta(); | |
304 } else { | |
233 | 305 // try parent directory metadata |
306 DocuDirectory gp = (DocuDirectory) parent.getParent(); | |
307 if (gp != null) { | |
308 gp.checkMeta(); | |
309 if (gp.getDirMeta() != null) { | |
310 fileMeta = gp.getDirMeta(); | |
311 } else { | |
312 // no metadata available | |
313 metaChecked = true; | |
314 return; | |
315 } | |
316 } | |
159 | 317 } |
318 } | |
319 } | |
320 metaChecked = true; | |
321 String s; | |
322 double dpi = 0; | |
323 double dpix = 0; | |
324 double dpiy = 0; | |
325 double sizex = 0; | |
326 double sizey = 0; | |
327 double pixx = 0; | |
328 double pixy = 0; | |
329 // DPI is valid for X and Y | |
330 if (fileMeta.containsKey("original-dpi")) { | |
331 try { | |
332 dpi = Double.parseDouble((String) fileMeta.get("original-dpi")); | |
333 } catch (NumberFormatException e) { | |
334 } | |
335 if (dpi != 0) { | |
336 resX = dpi; | |
337 resY = dpi; | |
338 return; | |
339 } | |
340 } | |
341 // DPI-X and DPI-Y | |
342 if (fileMeta.containsKey("original-dpi-x") | |
233 | 343 && fileMeta.containsKey("original-dpi-y")) { |
159 | 344 try { |
233 | 345 dpix = Double.parseDouble((String) fileMeta |
346 .get("original-dpi-x")); | |
347 dpiy = Double.parseDouble((String) fileMeta | |
348 .get("original-dpi-y")); | |
159 | 349 } catch (NumberFormatException e) { |
350 } | |
351 if ((dpix != 0) && (dpiy != 0)) { | |
352 resX = dpix; | |
353 resY = dpiy; | |
354 return; | |
355 } | |
356 } | |
357 // SIZE-X and SIZE-Y and PIXEL-X and PIXEL-Y | |
358 if (fileMeta.containsKey("original-size-x") | |
233 | 359 && fileMeta.containsKey("original-size-y") |
360 && fileMeta.containsKey("original-pixel-x") | |
361 && fileMeta.containsKey("original-pixel-y")) { | |
159 | 362 try { |
233 | 363 sizex = Double.parseDouble((String) fileMeta |
364 .get("original-size-x")); | |
365 sizey = Double.parseDouble((String) fileMeta | |
366 .get("original-size-y")); | |
367 pixx = Double.parseDouble((String) fileMeta | |
368 .get("original-pixel-x")); | |
369 pixy = Double.parseDouble((String) fileMeta | |
370 .get("original-pixel-y")); | |
159 | 371 } catch (NumberFormatException e) { |
372 } | |
373 if ((sizex != 0) && (sizey != 0) && (pixx != 0) && (pixy != 0)) { | |
374 resX = pixx / (sizex * 100 / 2.54); | |
375 resY = pixy / (sizey * 100 / 2.54); | |
376 return; | |
377 } | |
378 } | |
379 } | |
380 | |
381 /** | |
382 * @return | |
383 */ | |
384 public double getResX() { | |
385 return resX; | |
386 } | |
387 | |
388 /** | |
389 * @return | |
390 */ | |
391 public double getResY() { | |
392 return resY; | |
393 } | |
394 | |
170
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 * Sets the aspect ratio from an ImageSize. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
397 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
398 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
399 * @param f |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
400 */ |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
401 public void setAspect(ImageSize s) { |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
402 aspect = s.getAspect(); |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
403 } |
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 /** |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
406 * Returns the aspect ratio. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
407 * |
233 | 408 * 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
|
409 * landscape. |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
410 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
411 * |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
412 * @return |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
413 */ |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
414 public double getAspect() { |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
415 return aspect; |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
416 } |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
159
diff
changeset
|
417 |
233 | 418 } |