comparison servlet/src/digilib/image/DocuImage.java @ 1:0ff3ede32060

Initial revision
author robcast
date Thu, 17 Jan 2002 15:25:46 +0100
parents
children 3b8797fc3e90 9cedd170b581
comparison
equal deleted inserted replaced
0:ffd2df307e81 1:0ff3ede32060
1 /* DocuImage -- General image interface class
2
3 Digital Image Library servlet components
4
5 Copyright (C) 2001, 2002 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 */
20
21 package digilib.image;
22
23 import javax.servlet.*;
24 import javax.servlet.http.*;
25 import java.io.*;
26 import java.util.*;
27
28 import java.awt.image.*;
29 import java.awt.image.renderable.*;
30
31 import digilib.*;
32 import digilib.io.*;
33
34 public interface DocuImage {
35
36 public String[] getKnownFileTypes();
37
38 /**
39 * send an image file as-is
40 */
41 public void sendFile(File f, ServletResponse res) throws FileOpException;
42
43 /**
44 * load image file
45 */
46 public void loadImage(File f) throws FileOpException;
47
48 /**
49 * write image with mime type mt to Stream
50 */
51 public void writeImage(String mt, ServletResponse res) throws FileOpException;
52
53 /**
54 * get the image height and width
55 */
56 public int getWidth();
57 public int getHeight();
58
59 /**
60 * crop and scale image
61 * take rectangle width,height at position x_off,y_off
62 * and scale by scale with interpolation quality qual (0=worst)
63 */
64 public void cropAndScale(
65 int x_off, int y_off,
66 int width, int height,
67 float scale, int qual) throws ImageOpException;
68 }