annotate servlet/src/digilib/image/DocuImage.java @ 567:70c135bd17aa stream

Starting 'stream' branch
author robcast
date Tue, 21 Dec 2010 10:05:54 +0100
parents 50f291d808b1
children beeedf90cb81
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
1 /* DocuImage -- General image interface class
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
2
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
3 Digital Image Library servlet components
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
4
85
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
5 Copyright (C) 2001, 2002, 2003 Robert Casties (robcast@mail.berlios.de)
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
6
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
7 This program is free software; you can redistribute it and/or modify it
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
9 Free Software Foundation; either version 2 of the License, or (at your
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
10 option) any later version.
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
11
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
12 Please read license.txt for the full details. A copy of the GPL
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
13 may be found at http://www.gnu.org/copyleft/lgpl.html
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
14
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
16 along with this program; if not, write to the Free Software
149
04ad64b2137a Servlet version 1.14b1
robcast
parents: 122
diff changeset
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
18
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
19 */
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
20
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
21 package digilib.image;
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
22
85
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
23 import java.awt.Rectangle;
462
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 278
diff changeset
24 import java.io.IOException;
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
25 import java.io.OutputStream;
463
d76a9e3f1ec9 Servlet version 1.10b
robcast
parents: 462
diff changeset
26 import java.util.Iterator;
73
3b8797fc3e90 New servlet version 1.5b.
robcast
parents: 1
diff changeset
27
159
e743b853efca servlet version 1.16a4
robcast
parents: 149
diff changeset
28 import digilib.io.ImageFile;
73
3b8797fc3e90 New servlet version 1.5b.
robcast
parents: 1
diff changeset
29 import digilib.io.FileOpException;
566
50f291d808b1 starting stream support
robcast
parents: 562
diff changeset
30 import digilib.io.ImageInput;
73
3b8797fc3e90 New servlet version 1.5b.
robcast
parents: 1
diff changeset
31
3b8797fc3e90 New servlet version 1.5b.
robcast
parents: 1
diff changeset
32 /** The basic class for the representation of a digilib image.
3b8797fc3e90 New servlet version 1.5b.
robcast
parents: 1
diff changeset
33 *
3b8797fc3e90 New servlet version 1.5b.
robcast
parents: 1
diff changeset
34 * The actual image object is hidden in the class, only methods for loading,
3b8797fc3e90 New servlet version 1.5b.
robcast
parents: 1
diff changeset
35 * manipulation, and saving are exported. This strategy enables implementations
3b8797fc3e90 New servlet version 1.5b.
robcast
parents: 1
diff changeset
36 * using different toolkits that rely on different image base classes (like
3b8797fc3e90 New servlet version 1.5b.
robcast
parents: 1
diff changeset
37 * JIMI, Java2D and JAI).
3b8797fc3e90 New servlet version 1.5b.
robcast
parents: 1
diff changeset
38 */
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
39 public interface DocuImage {
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
40
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
41 /** Loads an image file into the Object.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
42 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
43 * @param f Image File.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
44 * @throws FileOpException Exception thrown if any error occurs.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
45 */
159
e743b853efca servlet version 1.16a4
robcast
parents: 149
diff changeset
46 public void loadImage(ImageFile f) throws FileOpException;
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
47
566
50f291d808b1 starting stream support
robcast
parents: 562
diff changeset
48 /** This DocuImage supports the loadSubImage operation.
85
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
49 *
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
50 * @return boolean
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
51 */
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
52 public boolean isSubimageSupported();
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
53
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
54 /** Load only a subsampled region of the image file.
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
55 *
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
56 * @param f
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
57 * @param region
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
58 * @param subsample
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
59 * @throws FileOpException
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
60 */
159
e743b853efca servlet version 1.16a4
robcast
parents: 149
diff changeset
61 public void loadSubimage(ImageFile f, Rectangle region, int subsample)
85
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
62 throws FileOpException;
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
63
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
64 /** Writes the current image to a ServletResponse.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
65 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
66 * The image is encoded to the mime-type <code>mt</code> and sent to the output
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
67 * stream of the <code>ServletResponse</code> <code>res</code>.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
68 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
69 * Currently only mime-types "image/jpeg" and "image/png" are supported.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
70 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
71 * @param mt mime-type of the image to be sent.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
72 * @param res ServletResponse where the image is sent.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
73 * @throws FileOpException Exception thrown on any error.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
74 */
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
75 public void writeImage(String mt, OutputStream ostream)
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
76 throws FileOpException;
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
77
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
78 /** The width of the current image in pixel.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
79 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
80 * @return Image width in pixels.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
81 */
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
82 public int getWidth();
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
83
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
84 /** The height of the current image in pixel.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
85 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
86 * @return Image height in pixels.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
87 */
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
88 public int getHeight();
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
89
86
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
90 /** The mime-type of the current image.
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
91 *
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
92 * @return String the mime-type of this image.
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
93 */
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
94 public String getMimetype();
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
95
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
96 /** Crops the current image.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
97 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
98 * Cuts out a region of the size <code>width</code> x <code>height</code> at
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
99 * the offset <code>xoff</code>, <code>yoff</code> from the current image
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
100 * and replaces the current image with the result.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
101 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
102 * @param xoff X offset of crop region
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
103 * @param yoff Y offset of crop region
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
104 * @param width width of crop region
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
105 * @param height height of crop region
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
106 * @throws ImageOpException
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
107 */
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
108 public void crop(int xoff, int yoff, int width, int height)
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
109 throws ImageOpException;
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
110
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
111 /** Scales the current image.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
112 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
113 * Replaces the current image with an image scaled by the factor
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
114 * <code>scale</code>.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
115 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
116 * @param scale scaling factor
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
117 * @throws ImageOpException
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
118 */
149
04ad64b2137a Servlet version 1.14b1
robcast
parents: 122
diff changeset
119 public void scale(double scaleX, double scaleY) throws ImageOpException;
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
120
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
121 /** Crops and scales the current image.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
122 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
123 * The current image is cropped to a rectangle of <code>width</code>,
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
124 * <code>height</code> at position <code>x_off</code>, <code>y_off</code>. The
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
125 * resulting image is scaled by the factor <code>scale</code> using the
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
126 * interpolation quality <code>qual</code> (0=worst).
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
127 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
128 * @param x_off x offset of the crop rectangle in pixel.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
129 * @param y_off y offset of the crop rectangle in pixel.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
130 * @param width width of the crop rectangle in pixel.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
131 * @param height height of the crop rectangle in pixel.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
132 * @param scale scaling factor.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
133 * @param qual interpolation quality (0=worst).
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
134 * @throws ImageOpException exception thrown on any error.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
135 */
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
136 public void cropAndScale(
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
137 int x_off,
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
138 int y_off,
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
139 int width,
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
140 int height,
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
141 double scale,
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
142 int qual)
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
143 throws ImageOpException;
85
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
144
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
145 /** Rotates the current image.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
146 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
147 * Replaces the current image with a rotated image. The image is rotated
101
78f52a1876fe digilib V1.9b1
robcast
parents: 86
diff changeset
148 * around the center by the <code>angle</code>
85
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
149 * given in degrees [0, 360] clockwise.
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
150 * Image size and aspect ratio are likely to change.
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
151 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
152 * @param angle rotation angle in degree
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
153 */
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
154 public void rotate(double angle) throws ImageOpException;
85
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
155
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
156 /** Mirrors the current image.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
157 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
158 * Replaces the current image with a mirrored image. The mirror axis goes
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
159 * through the center of the image and is rotated by <code>angle</code>
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
160 * degrees. Currently only horizontal and vertical mirroring (0 and 90
101
78f52a1876fe digilib V1.9b1
robcast
parents: 86
diff changeset
161 * degree) are supported.
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
162 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
163 * @param angle angle of mirror axis
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
164 * @throws ImageOpException
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
165 */
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
166 public void mirror(double angle) throws ImageOpException;
85
4e6757e8ccd4 New enhanced ImageLoader stuff.
robcast
parents: 79
diff changeset
167
86
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
168 /** Enhances brightness and contrast of the current image.
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
169 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
170 * Replaces the current image with a brightness and contrast enhanced image.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
171 * Contrast is enhanced by multiplying the pixel value with the constant
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
172 * <code>mult</code>. Brightness is enhanced by adding the constant
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
173 * <code>add</code> to the pixel value. Operation: p1 = (p0*mult)+add.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
174 *
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
175 * @param mult multiplicative constant for contrast enhancement
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
176 * @param add additive constant for brightness enhancement
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
177 * @throws ImageOpException
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
178 */
86
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
179 public void enhance(float mult, float add) throws ImageOpException;
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
180
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
181 /** Manipulates the colors of the current image.
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
182 *
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
183 * Replaces the current image with a color modified image.
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
184 * For the red, green and blue color channels all pixel values are multiplied
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
185 * by the constant
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
186 * <code>m</code> and added to the constant
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
187 * <code>a</code>. Operation: p1 = (p0*m)+a.
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
188 *
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
189 * @param rgbm multiplicative constants for red, green, blue
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
190 * @param rgba additive constant for red, green, blue
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
191 * @throws ImageOpException
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
192 */
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
193 public void enhanceRGB(float[] rgbm, float[] rgba)
997ba69afb81 New version 1.8b1.
robcast
parents: 85
diff changeset
194 throws ImageOpException;
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
195
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
196 /**
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
197 * Returns the interpolation quality.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
198 * @return int
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
199 */
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
200 public int getQuality();
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
201
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
202 /**
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
203 * Sets the interpolation quality.
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
204 * @param quality The quality to set
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
205 */
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
206 public void setQuality(int quality);
207
1a65d8e43620 Servlet version 1.18b9 -- cleanup and bugfixes
robcast
parents: 159
diff changeset
207
1a65d8e43620 Servlet version 1.18b9 -- cleanup and bugfixes
robcast
parents: 159
diff changeset
208 /** Frees all resources bound to the DocuImage.
1a65d8e43620 Servlet version 1.18b9 -- cleanup and bugfixes
robcast
parents: 159
diff changeset
209 *
1a65d8e43620 Servlet version 1.18b9 -- cleanup and bugfixes
robcast
parents: 159
diff changeset
210 * Things that should be freed are image objects and open files.
1a65d8e43620 Servlet version 1.18b9 -- cleanup and bugfixes
robcast
parents: 159
diff changeset
211 *
1a65d8e43620 Servlet version 1.18b9 -- cleanup and bugfixes
robcast
parents: 159
diff changeset
212 */
1a65d8e43620 Servlet version 1.18b9 -- cleanup and bugfixes
robcast
parents: 159
diff changeset
213 public void dispose();
79
63c8186455c1 Servlet version 1.6b. Further cleanup and new functionality:
robcast
parents: 73
diff changeset
214
462
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 278
diff changeset
215 /**
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 278
diff changeset
216 * Check image size and type and store in ImageFile f
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 278
diff changeset
217 */
566
50f291d808b1 starting stream support
robcast
parents: 562
diff changeset
218 public ImageInput identify(ImageFile imgf) throws IOException;
462
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 278
diff changeset
219
463
d76a9e3f1ec9 Servlet version 1.10b
robcast
parents: 462
diff changeset
220 /**
d76a9e3f1ec9 Servlet version 1.10b
robcast
parents: 462
diff changeset
221 * Returns a list of supported image formats
d76a9e3f1ec9 Servlet version 1.10b
robcast
parents: 462
diff changeset
222 */
531
9cedd170b581 * PDF generation works now even with subdirectories
robcast
parents: 1
diff changeset
223 public Iterator<String> getSupportedFormats();
533
87cb3dc2aa12 improved pdf generation (not done yet)
robcast
parents: 531
diff changeset
224
87cb3dc2aa12 improved pdf generation (not done yet)
robcast
parents: 531
diff changeset
225 /**
87cb3dc2aa12 improved pdf generation (not done yet)
robcast
parents: 531
diff changeset
226 * returns the underlying image as java.awt.Image (if possible, or null)
87cb3dc2aa12 improved pdf generation (not done yet)
robcast
parents: 531
diff changeset
227 * @return
87cb3dc2aa12 improved pdf generation (not done yet)
robcast
parents: 531
diff changeset
228 */
87cb3dc2aa12 improved pdf generation (not done yet)
robcast
parents: 531
diff changeset
229 public java.awt.Image getAwtImage();
463
d76a9e3f1ec9 Servlet version 1.10b
robcast
parents: 462
diff changeset
230
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
231 }