Mercurial > hg > digilib-old
annotate servlet/src/digilib/io/ImageInputImpl.java @ 579:efd7a223f819 stream
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
author | robcast |
---|---|
date | Wed, 22 Dec 2010 19:17:52 +0100 |
parents | servlet/src/digilib/io/ImageInput.java@790cbfb58b52 |
children | f210731dc6cc |
rev | line source |
---|---|
566 | 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 digilib.image.ImageSize; | |
25 | |
579
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
26 public abstract class ImageInputImpl implements ImageInput { |
568 | 27 |
28 // mime file type | |
29 protected String mimetype = null; | |
30 // image size in pixels | |
31 protected ImageSize pixelSize = null; | |
32 | |
579
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
33 /* (non-Javadoc) |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
34 * @see digilib.io.ImageInput#getSize() |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
35 */ |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
36 @Override |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
37 public ImageSize getSize() { |
568 | 38 return pixelSize; |
39 } | |
566 | 40 |
579
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
41 /* (non-Javadoc) |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
42 * @see digilib.io.ImageInput#setSize(digilib.image.ImageSize) |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
43 */ |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
44 @Override |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
45 public void setSize(ImageSize imageSize) { |
568 | 46 this.pixelSize = imageSize; |
47 } | |
48 | |
579
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
49 /* (non-Javadoc) |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
50 * @see digilib.io.ImageInput#getMimetype() |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
51 */ |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
52 @Override |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
53 public String getMimetype() { |
568 | 54 return mimetype; |
55 } | |
566 | 56 |
579
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
57 /* (non-Javadoc) |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
58 * @see digilib.io.ImageInput#setMimetype(java.lang.String) |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
59 */ |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
60 @Override |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
61 public void setMimetype(String filetype) { |
568 | 62 this.mimetype = filetype; |
63 } | |
566 | 64 |
579
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
65 /* (non-Javadoc) |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
66 * @see digilib.io.ImageInput#isChecked() |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
67 */ |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
68 @Override |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
69 public boolean isChecked() { |
568 | 70 return (pixelSize != null); |
71 } | |
72 | |
579
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
73 /* (non-Javadoc) |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
74 * @see digilib.io.ImageInput#getAspect() |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
75 */ |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
76 @Override |
efd7a223f819
try: ImageInput as interface, ImageFile inherits from Dirent and implements ImageInput
robcast
parents:
574
diff
changeset
|
77 public float getAspect() { |
568 | 78 return (pixelSize != null) ? pixelSize.getAspect() : 0; |
79 } | |
566 | 80 |
81 } |