aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/image/JimiImage.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2003-03-06 21:25:45 +0000
committerJeremias Maerki <jeremias@apache.org>2003-03-06 21:25:45 +0000
commitd708e7de1f09f12f02ab31c708c71d0310fccd2c (patch)
tree681d12893622c1d56c2f0861626e6b95d7a8c034 /src/org/apache/fop/image/JimiImage.java
parent32ec3613ce46fe506206e8fcd4e1e768b7d4c838 (diff)
downloadxmlgraphics-fop-d708e7de1f09f12f02ab31c708c71d0310fccd2c.tar.gz
xmlgraphics-fop-d708e7de1f09f12f02ab31c708c71d0310fccd2c.zip
Switched to long licence
Some general checkstyle fixing git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196030 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/image/JimiImage.java')
-rw-r--r--src/org/apache/fop/image/JimiImage.java77
1 files changed, 61 insertions, 16 deletions
diff --git a/src/org/apache/fop/image/JimiImage.java b/src/org/apache/fop/image/JimiImage.java
index 67d4b9bbe..d3a889f33 100644
--- a/src/org/apache/fop/image/JimiImage.java
+++ b/src/org/apache/fop/image/JimiImage.java
@@ -1,30 +1,71 @@
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.image;
// Java
-import java.net.URL;
import java.awt.image.ImageProducer;
import java.awt.image.ColorModel;
import java.awt.image.IndexColorModel;
import java.awt.color.ColorSpace;
-import java.io.InputStream;
// Jimi
-import com.sun.jimi.core.*;
+import com.sun.jimi.core.Jimi;
+
+// Avalon
+import org.apache.avalon.framework.logger.Logger;
// FOP
import org.apache.fop.pdf.PDFColor;
-import org.apache.fop.image.analyser.ImageReader;
import org.apache.fop.fo.FOUserAgent;
-import org.apache.avalon.framework.logger.Logger;
-
/**
* FopImage object for several images types, using Jimi.
* See Jimi documentation for supported image types.
@@ -33,6 +74,7 @@ import org.apache.avalon.framework.logger.Logger;
* @see FopImage
*/
public class JimiImage extends AbstractFopImage {
+
public JimiImage(FopImage.ImageInfo imgReader) {
super(imgReader);
try {
@@ -43,15 +85,18 @@ public class JimiImage extends AbstractFopImage {
}
protected boolean loadDimensions(FOUserAgent ua) {
- if(this.bitmaps == null) {
+ if (this.bitmaps == null) {
loadImage(ua.getLogger());
}
return this.bitmaps != null;
}
+ /**
+ * @see org.apache.fop.image.AbstractFopImage#loadBitmap(FOUserAgent)
+ */
protected boolean loadBitmap(FOUserAgent ua) {
- if(this.bitmaps == null) {
+ if (this.bitmaps == null) {
loadImage(ua.getLogger());
}
@@ -92,8 +137,7 @@ public class JimiImage extends AbstractFopImage {
int transparencyType = cm.getTransparency();
if (transparencyType == java.awt.Transparency.OPAQUE) {
this.isTransparent = false;
- } else if (transparencyType ==
- java.awt.Transparency.BITMASK) {
+ } else if (transparencyType == java.awt.Transparency.BITMASK) {
if (cm instanceof IndexColorModel) {
this.isTransparent = false;
byte[] alphas = new byte[
@@ -127,7 +171,8 @@ public class JimiImage extends AbstractFopImage {
* for (int i = 0; i < this.width * this.height; i++) {
* if (cm.getAlpha(tmpMap[i]) == 0) {
* this.isTransparent = true;
- * this.transparentColor = new PDFColor(cm.getRed(tmpMap[i]), cm.getGreen(tmpMap[i]), cm.getBlue(tmpMap[i]));
+ * this.transparentColor = new PDFColor(cm.getRed(tmpMap[i]),
+ * cm.getGreen(tmpMap[i]), cm.getBlue(tmpMap[i]));
* break;
* }
* }