Mercurial > hg > digilib-old
comparison servlet/src/digilib/image/DocuImage.java @ 588:aee436f0549d stream
more work on stream input
author | robcast |
---|---|
date | Thu, 06 Jan 2011 14:37:50 +0100 |
parents | beeedf90cb81 |
children | 2b58d2783ef0 |
comparison
equal
deleted
inserted
replaced
587:720d061a1b30 | 588:aee436f0549d |
---|---|
25 import java.io.OutputStream; | 25 import java.io.OutputStream; |
26 import java.util.Iterator; | 26 import java.util.Iterator; |
27 | 27 |
28 import javax.servlet.ServletException; | 28 import javax.servlet.ServletException; |
29 | 29 |
30 import digilib.io.ImageFile; | |
31 import digilib.io.FileOpException; | 30 import digilib.io.FileOpException; |
32 import digilib.io.ImageInput; | 31 import digilib.io.ImageInput; |
33 | 32 |
34 /** The basic class for the representation of a digilib image. | 33 /** The basic class for the representation of a digilib image. |
35 * | 34 * |
40 */ | 39 */ |
41 public interface DocuImage { | 40 public interface DocuImage { |
42 | 41 |
43 /** Loads an image file into the Object. | 42 /** Loads an image file into the Object. |
44 * | 43 * |
45 * @param f Image File. | 44 * @param ii Image File. |
46 * @throws FileOpException Exception thrown if any error occurs. | 45 * @throws FileOpException Exception thrown if any error occurs. |
47 */ | 46 */ |
48 public void loadImage(ImageFile f) throws FileOpException; | 47 public void loadImage(ImageInput ii) throws FileOpException; |
49 | 48 |
50 /** This DocuImage supports the loadSubImage operation. | 49 /** This DocuImage supports the loadSubImage operation. |
51 * | 50 * |
52 * @return boolean | 51 * @return boolean |
53 */ | 52 */ |
54 public boolean isSubimageSupported(); | 53 public boolean isSubimageSupported(); |
55 | 54 |
56 /** Load only a subsampled region of the image file. | 55 /** Load only a subsampled region of the image file. |
57 * | 56 * |
58 * @param f | 57 * @param ii |
59 * @param region | 58 * @param region |
60 * @param subsample | 59 * @param subsample |
61 * @throws FileOpException | 60 * @throws FileOpException |
62 */ | 61 */ |
63 public void loadSubimage(ImageFile f, Rectangle region, int subsample) | 62 public void loadSubimage(ImageInput ii, Rectangle region, int subsample) |
64 throws FileOpException; | 63 throws FileOpException; |
65 | 64 |
66 /** Writes the current image to a ServletResponse. | 65 /** Writes the current image to a ServletResponse. |
67 * | 66 * |
68 * The image is encoded to the mime-type <code>mt</code> and sent to the output | 67 * The image is encoded to the mime-type <code>mt</code> and sent to the output |
94 * | 93 * |
95 * @return | 94 * @return |
96 */ | 95 */ |
97 public ImageSize getSize(); | 96 public ImageSize getSize(); |
98 | 97 |
99 /** The mime-type of the current image. | 98 /** The mime-type of the image, i.e. the mime-type of the input that was read. |
100 * | 99 * |
101 * @return String the mime-type of this image. | 100 * @return String the mime-type of this image. |
102 */ | 101 */ |
103 public String getMimetype(); | 102 public String getMimetype(); |
104 | 103 |
220 * | 219 * |
221 */ | 220 */ |
222 public void dispose(); | 221 public void dispose(); |
223 | 222 |
224 /** | 223 /** |
225 * Check image size and type and store in ImageFile f | 224 * Check image size and type and store in ImageInput ii |
226 */ | 225 */ |
227 public ImageInput identify(ImageFile imgf) throws IOException; | 226 public ImageInput identify(ImageInput ii) throws IOException; |
228 | 227 |
229 /** | 228 /** |
230 * Returns a list of supported image formats | 229 * Returns a list of supported image formats |
231 */ | 230 */ |
232 public Iterator<String> getSupportedFormats(); | 231 public Iterator<String> getSupportedFormats(); |