annotate servlet/src/digilib/image/ImageOps.java @ 470:16bd70715ac3

Improved performance of JAIDocuImage for large images - simulated subsampling by scaling
author robcast
date Wed, 15 Feb 2006 00:09:50 +0100
parents 5259018dce6c
children baaa5bab5e16
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
281
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
1 /* ImageOps -- convenience methods for images
458
eec0d8c9c3c9 Servlet version 1.5.9h
robcast
parents: 352
diff changeset
2
281
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
3 Digital Image Library servlet components
458
eec0d8c9c3c9 Servlet version 1.5.9h
robcast
parents: 352
diff changeset
4
281
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
5 Copyright (C) 2004 Robert Casties (robcast@mail.berlios.de)
458
eec0d8c9c3c9 Servlet version 1.5.9h
robcast
parents: 352
diff changeset
6
281
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
7 This program is free software; you can redistribute it and/or modify it
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
9 Free Software Foundation; either version 2 of the License, or (at your
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
10 option) any later version.
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
11
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
12 Please read license.txt for the full details. A copy of the GPL
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
13 may be found at http://www.gnu.org/copyleft/lgpl.html
458
eec0d8c9c3c9 Servlet version 1.5.9h
robcast
parents: 352
diff changeset
14
281
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
16 along with this program; if not, write to the Free Software
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
458
eec0d8c9c3c9 Servlet version 1.5.9h
robcast
parents: 352
diff changeset
18
281
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
19 * Created on 13.10.2004
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
20 */
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
21 package digilib.image;
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
22
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
23 import java.io.IOException;
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
24
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
25 import digilib.io.ImageFile;
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
26
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
27 /**
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
28 * convenience methods for images
458
eec0d8c9c3c9 Servlet version 1.5.9h
robcast
parents: 352
diff changeset
29 *
281
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
30 * @author casties
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
31 */
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
32 public class ImageOps {
458
eec0d8c9c3c9 Servlet version 1.5.9h
robcast
parents: 352
diff changeset
33
462
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 458
diff changeset
34 public static final int TYPE_AUTO = 0;
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 458
diff changeset
35 public static final int TYPE_JPEG = 1;
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 458
diff changeset
36 public static final int TYPE_PNG = 2;
458
eec0d8c9c3c9 Servlet version 1.5.9h
robcast
parents: 352
diff changeset
37
462
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 458
diff changeset
38 private static DocuImage docuImg;
458
eec0d8c9c3c9 Servlet version 1.5.9h
robcast
parents: 352
diff changeset
39
eec0d8c9c3c9 Servlet version 1.5.9h
robcast
parents: 352
diff changeset
40 public static boolean checkFile(ImageFile imgf) throws IOException {
462
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 458
diff changeset
41 return docuImg.identify(imgf);
458
eec0d8c9c3c9 Servlet version 1.5.9h
robcast
parents: 352
diff changeset
42 }
eec0d8c9c3c9 Servlet version 1.5.9h
robcast
parents: 352
diff changeset
43
462
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 458
diff changeset
44 public static void setDocuImage(DocuImage di) {
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 458
diff changeset
45 docuImg = di;
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 458
diff changeset
46 }
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 458
diff changeset
47
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 458
diff changeset
48 public static DocuImage getDocuImage() {
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 458
diff changeset
49 return docuImg;
03ff7238c9d4 second try for flashpix support (doesn't work currently...)
robcast
parents: 458
diff changeset
50 }
281
60a064f27d25 Servlet version 1.22b1
robcast
parents:
diff changeset
51 }