Mercurial > hg > digilib-old
comparison servlet/src/digilib/io/ImageInput.java @ 566:50f291d808b1 digilibPDF
starting stream support
author | robcast |
---|---|
date | Mon, 20 Dec 2010 11:57:55 +0100 |
parents | |
children | 34701340922e |
comparison
equal
deleted
inserted
replaced
565:8beefd1142b2 | 566:50f291d808b1 |
---|---|
1 /* ImageInput-- digilib image input interface. | |
2 | |
3 Digital Image Library servlet components | |
4 | |
5 Copyright (C) 2010 Robert Casties (robcast@mail.berlios.de) | |
6 | |
7 This program is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
9 Free Software Foundation; either version 2 of the License, or (at your | |
10 option) any later version. | |
11 | |
12 Please read license.txt for the full details. A copy of the GPL | |
13 may be found at http://www.gnu.org/copyleft/lgpl.html | |
14 | |
15 You should have received a copy of the GNU General Public License | |
16 along with this program; if not, write to the Free Software | |
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
19 * Created on 20.12.2010 | |
20 */ | |
21 | |
22 package digilib.io; | |
23 | |
24 import java.io.File; | |
25 import java.io.InputStream; | |
26 | |
27 import digilib.image.ImageSize; | |
28 | |
29 public interface ImageInput { | |
30 | |
31 /** | |
32 * @return ImageSize | |
33 */ | |
34 public abstract ImageSize getSize(); | |
35 | |
36 /** | |
37 * @return String | |
38 */ | |
39 public abstract String getMimetype(); | |
40 | |
41 /** | |
42 * Sets the imageSize. | |
43 * @param imageSize The imageSize to set | |
44 */ | |
45 public abstract void setSize(ImageSize imageSize); | |
46 | |
47 /** | |
48 * Sets the mimetype. | |
49 * @param mimetype The mimetype to set | |
50 */ | |
51 public abstract void setMimetype(String filetype); | |
52 | |
53 /** returns if this image has been checked | |
54 * (i.e. has size and mimetype) | |
55 * @return boolean | |
56 */ | |
57 public abstract boolean isChecked(); | |
58 | |
59 /** Returns the aspect ratio of the image (width/height). | |
60 * | |
61 * @return | |
62 */ | |
63 public abstract float getAspect(); | |
64 | |
65 /** Returns if this ImageInput is File-based. | |
66 * @return | |
67 */ | |
68 public abstract boolean hasFile(); | |
69 | |
70 /** Returns the underlying File (if applicable) | |
71 * | |
72 * @return | |
73 */ | |
74 public abstract File getFile(); | |
75 | |
76 /** Returns the underlying Stream (if applicable) | |
77 * | |
78 * @return | |
79 */ | |
80 public abstract InputStream getStream(); | |
81 | |
82 /** Returns if this ImageInput is Stream-based. | |
83 * @return | |
84 */ | |
85 public abstract boolean hasStream(); | |
86 | |
87 } |