[prev in list] [next in list] [prev in thread] [next in thread]
List: batik-dev
Subject: cvs commit: xml-batik/sources/org/apache/batik/ext/awt/image/spi ImageTagRegistry.java JDKRegistryEn
From: deweese () apache ! org
Date: 2001-04-27 19:54:03
[Download RAW message or body]
deweese 01/04/27 12:54:01
Modified: . build.bat build.sh
sources/org/apache/batik/ext/awt
MultipleGradientPaintContext.java
RadialGradientPaintContext.java
sources/org/apache/batik/ext/awt/image GraphicsUtil.java
sources/org/apache/batik/ext/awt/image/renderable
ColorMatrixRable.java ColorMatrixRable8Bit.java
ComponentTransferRable.java
ComponentTransferRable8Bit.java
ConvolveMatrixRable.java
ConvolveMatrixRable8Bit.java
DisplacementMapRable.java
DisplacementMapRable8Bit.java
GaussianBlurRable.java GaussianBlurRable8Bit.java
TurbulenceRable.java TurbulenceRable8Bit.java
sources/org/apache/batik/ext/awt/image/rendered
ColorMatrixRed.java
sources/org/apache/batik/ext/awt/image/spi
ImageTagRegistry.java JDKRegistryEntry.java
Removed: sources/org/apache/batik/ext/awt/image/rendered
ComponentTransferOp.java
Log:
1) Fixed a bug with Radial gradient when focus was out of the circle to
the left and above.
2) Added some anti-aliasing to Repeat mode of gradients. Doesn't really
solve the problem however since at low res it jumps over the anti-aliased
region. Truly fixing this would require fairly expensive "blending" of
the gradient at low res.
3) Fixed the ColorModel coercion bug from today.
4) Added FilterColorInterp interface to appropriate filters.
This means that the bridge can now support color-interpolation-filters.
5) Made ComponentTransfer a Rendered instead of op implementation.
6) ImageTagRegistry now uses the scheme pointed out by Christophe
which is The standard mechanism for adding services.
7) Added batik.util.Service which support #6. Should make it a cake
walk to do this for the bridge.
Revision Changes Path
1.7 +7 -8 xml-batik/build.bat
Index: build.bat
===================================================================
RCS file: /home/cvs/xml-batik/build.bat,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- build.bat 2001/03/08 03:21:41 1.6
+++ build.bat 2001/04/27 19:53:38 1.7
@@ -1,11 +1,11 @@
@echo off
-:: -----------------------------------------------------------------------------
+:: ----------------------------------------------------------------------------
:: build.bat - Win32 Build Script for Apache Batik
::
:: $Id$
-:: -----------------------------------------------------------------------------
+:: ----------------------------------------------------------------------------
-:: ----- Verify and Set Required Environment Variables -------------------------
+:: ----- Verify and Set Required Environment Variables ------------------------
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo You must set JAVA_HOME to point at your Java Development Kit installation
@@ -16,19 +16,18 @@
set ANT_HOME=.
:gotAntHome
-:: ----- Set Up The Runtime Classpath ------------------------------------------
+:: ----- Set Up The Runtime Classpath -----------------------------------------
set CP=%JAVA_HOME%\lib\tools.jar;%ANT_HOME%\lib\build\ant_1_3.jar;.\lib\build\parser.jar;.\lib\build\jaxp.jar
-:: ----- Execute The Requested Build -------------------------------------------
+:: ----- Execute The Requested Build ------------------------------------------
-%JAVA_HOME%\bin\java.exe %ANT_OPTS% -classpath %CP% org.apache.tools.ant.Main \
-Dant.home=%ANT_HOME% %1 %2 %3 %4 %5 %6 %7 %8 %9 +%JAVA_HOME%\bin\java.exe \
%ANT_OPTS% -classpath %CP% org.apache.tools.ant.Main -Dant.home=%ANT_HOME% %1 \
-Dargs="%2 %3 %4 %5 %6 %7 %8 %9"
-:: ----- Cleanup the environment -----------------------------------------------
+:: ----- Cleanup the environment ----------------------------------------------
:cleanup
set CP=
-
1.8 +4 -1 xml-batik/build.sh
Index: build.sh
===================================================================
RCS file: /home/cvs/xml-batik/build.sh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- build.sh 2001/03/28 18:30:45 1.7
+++ build.sh 2001/04/27 19:53:38 1.8
@@ -22,5 +22,8 @@
# ----- Execute The Requested Build -------------------------------------------
-$JAVA_HOME/bin/java $ANT_OPTS -classpath $CP org.apache.tools.ant.Main \
-Dant.home=$ANT_HOME "$@" +TARGET=$1;
+shift 1
+
+$JAVA_HOME/bin/java $ANT_OPTS -classpath $CP org.apache.tools.ant.Main \
-Dant.home=$ANT_HOME $TARGET -Dargs="$*"
1.5 +53 -1 \
xml-batik/sources/org/apache/batik/ext/awt/MultipleGradientPaintContext.java
Index: MultipleGradientPaintContext.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/MultipleGradientPaintContext.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MultipleGradientPaintContext.java 2001/03/08 12:39:41 1.4
+++ MultipleGradientPaintContext.java 2001/04/27 19:53:40 1.5
@@ -23,7 +23,7 @@
*
* @author Nicholas Talian, Vincent Hardy, Jim Graham, Jerry Evans
* @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
- * @version $Id: MultipleGradientPaintContext.java,v 1.4 2001/03/08 12:39:41 \
tkormann Exp $ + * @version $Id: MultipleGradientPaintContext.java,v 1.5 2001/04/27 \
19:53:40 deweese Exp $
*
*/
abstract class MultipleGradientPaintContext implements PaintContext {
@@ -665,6 +665,58 @@
if (position < 0) {
position = position + 1; //force it to be in the range 0-1
}
+
+ int w=0, c1=0, c2=0;
+ if (isSimpleLookup) {
+ position *= gradient.length;
+ int idx1 = (int)(position);
+ if (idx1+1 < gradient.length)
+ return gradient[idx1];
+
+ w = (int)((position-idx1)*(1<<16));
+ c1 = gradient[idx1];
+ c2 = gradient[0];
+ } else {
+ //for all the gradient interval arrays
+ for (int i = 0; i < gradientsLength; i++) {
+
+ if (position < fractions[i+1]) { //this is the array we want
+
+ float delta = position - fractions[i];
+
+ delta = ((delta / normalizedIntervals[i]) * GRADIENT_SIZE);
+ //this is the interval we want.
+ int index = (int)delta;
+ if ((index+1<gradients[i].length) ||
+ (i+1 < gradientsLength))
+ return gradients[i][index];
+
+ w = (int)((delta-index)*(1<<16));
+ c1 = gradients[i][index];
+ c2 = gradients[0][0];
+ break;
+ }
+ }
+ }
+
+ return
+ (((( ( (c1>> 8) &0xFF0000)+
+ ((((c2>>>24) )-((c1>>>24) ))*w))&0xFF0000)<< 8) |
+
+ ((( ( (c1 ) &0xFF0000)+
+ ((((c2>> 16)&0xFF)-((c1>> 16)&0xFF))*w))&0xFF0000) ) |
+
+ ((( ( (c1<< 8) &0xFF0000)+
+ ((((c2>> 8)&0xFF)-((c1>> 8)&0xFF))*w))&0xFF0000)>> 8) |
+
+ ((( ( (c1<< 16) &0xFF0000)+
+ ((((c2 )&0xFF)-((c1 )&0xFF))*w))&0xFF0000)>>16));
+
+ // return c1 +
+ // ((( ((((c2>>>24) )-((c1>>>24) ))*w)&0xFF0000)<< 8) |
+ // (( ((((c2>> 16)&0xFF)-((c1>> 16)&0xFF))*w)&0xFF0000) ) |
+ // (( ((((c2>> 8)&0xFF)-((c1>> 8)&0xFF))*w)&0xFF0000)>> 8) |
+ // (( ((((c2 )&0xFF)-((c1 )&0xFF))*w)&0xFF0000)>>16));
}
else { //cycleMethod == MultipleGradientPaint.REFLECT
1.3 +9 -17 \
xml-batik/sources/org/apache/batik/ext/awt/RadialGradientPaintContext.java
Index: RadialGradientPaintContext.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/RadialGradientPaintContext.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RadialGradientPaintContext.java 2001/02/16 18:39:49 1.2
+++ RadialGradientPaintContext.java 2001/04/27 19:53:40 1.3
@@ -21,7 +21,7 @@
*
* @author Nicholas Talian, Vincent Hardy, Jim Graham, Jerry Evans
* @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
- * @version $Id: RadialGradientPaintContext.java,v 1.2 2001/02/16 18:39:49 vhardy \
Exp $ + * @version $Id: RadialGradientPaintContext.java,v 1.3 2001/04/27 19:53:40 \
deweese Exp $
*
*/
final class RadialGradientPaintContext extends MultipleGradientPaintContext {
@@ -126,7 +126,8 @@
focusX = fx;
focusY = fy;
radius = r;
-
+
+
this.isSimpleFocus = (focusX == centerX) && (focusY == centerY);
this.isNonCyclic = (cycleMethod == RadialGradientPaint.NO_CYCLE);
@@ -139,22 +140,13 @@
double dist = Math.sqrt((dX * dX) + (dY * dY));
//test if distance from focus to center is greater than the radius
- if (dist > radius) { //clamp focus to radius
-
- if (dY == 0) { //avoid divide by zero
- focusY = centerY;
- focusX = centerX + (radius * SCALEBACK);
- }
- else {
- double angle = Math.atan2(dY, dX);
+ if (dist > radius* SCALEBACK) { //clamp focus to radius
+ double angle = Math.atan2(dY, dX);
- //x = r cos theta, y = r sin theta
- focusX = (float)Math.floor((SCALEBACK * radius *
- Math.cos(angle))) + centerX;
-
- focusY = (float)Math.floor((SCALEBACK * radius *
- Math.sin(angle))) + centerY;
- }
+ //x = r cos theta, y = r sin theta
+ focusX = (float)(SCALEBACK * radius * Math.cos(angle)) + centerX;
+
+ focusY = (float)(SCALEBACK * radius * Math.sin(angle)) + centerY;
}
//calculate the solution to be used in the case where X == focusX
1.14 +2 -2 \
xml-batik/sources/org/apache/batik/ext/awt/image/GraphicsUtil.java
Index: GraphicsUtil.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/GraphicsUtil.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- GraphicsUtil.java 2001/04/24 21:34:45 1.13
+++ GraphicsUtil.java 2001/04/27 19:53:43 1.14
@@ -70,7 +70,7 @@
* implementations.
*
* @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
- * @version $Id: GraphicsUtil.java,v 1.13 2001/04/24 21:34:45 deweese Exp $
+ * @version $Id: GraphicsUtil.java,v 1.14 2001/04/27 19:53:43 deweese Exp $
*/
public class GraphicsUtil {
@@ -178,7 +178,7 @@
// If we can't find out about our device assume
// it's not premultiplied (Just because this
// seems to work for us!).
- drawCM = coerceColorModel(drawCM, false);
+ drawCM = coerceColorModel(srcCM, false);
} else if (drawCM.hasAlpha() && g2dCM.hasAlpha() &&
(drawCM.isAlphaPremultiplied() !=
g2dCM .isAlphaPremultiplied())) {
1.2 +2 -2 \
xml-batik/sources/org/apache/batik/ext/awt/image/renderable/ColorMatrixRable.java
Index: ColorMatrixRable.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/ColorMatrixRable.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ColorMatrixRable.java 2001/01/24 05:39:30 1.1
+++ ColorMatrixRable.java 2001/04/27 19:53:45 1.2
@@ -13,9 +13,9 @@
* operation
*
* @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
- * @version $Id: ColorMatrixRable.java,v 1.1 2001/01/24 05:39:30 vhardy Exp $
+ * @version $Id: ColorMatrixRable.java,v 1.2 2001/04/27 19:53:45 deweese Exp $
*/
-public interface ColorMatrixRable extends Filter {
+public interface ColorMatrixRable extends FilterColorInterp {
/**
* Identifier used to refer to predefined matrices
*/
1.4 +3 -36 \
xml-batik/sources/org/apache/batik/ext/awt/image/renderable/ColorMatrixRable8Bit.java \
Index: ColorMatrixRable8Bit.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/ColorMatrixRable8Bit.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ColorMatrixRable8Bit.java 2001/04/24 21:34:47 1.3
+++ ColorMatrixRable8Bit.java 2001/04/27 19:53:46 1.4
@@ -8,8 +8,6 @@
package org.apache.batik.ext.awt.image.renderable;
-import org.apache.batik.ext.awt.image.GraphicsUtil;
-
import java.awt.image.RenderedImage;
import java.awt.image.renderable.RenderContext;
@@ -21,10 +19,10 @@
* operation
*
* @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
- * @version $Id: ColorMatrixRable8Bit.java,v 1.3 2001/04/24 21:34:47 deweese Exp $
+ * @version $Id: ColorMatrixRable8Bit.java,v 1.4 2001/04/27 19:53:46 deweese Exp $
*/
public class ColorMatrixRable8Bit
- extends AbstractRable
+ extends AbstractColorInterpRable
implements ColorMatrixRable {
/**
* Predefined luminanceToAlpha matrix
@@ -202,38 +200,7 @@
if(srcRI == null)
return null;
-
- CachableRed srcCR = GraphicsUtil.wrap(srcRI);
- srcCR = GraphicsUtil.convertToLsRGB(srcCR);
-
- /*final int srcMinX = srcCR.getMinX();
- final int srcMinY = srcCR.getMinY();
-
- //
- // Wrap source in buffered image
- //
- Shape aoi = rc.getAreaOfInterest();
- if(aoi == null)
- aoi = getBounds2D();
-
- ColorModel cm = srcCR.getColorModel();
- Raster srcRR = srcCR.getData();
- WritableRaster srcWR = GraphicsUtil.makeRasterWritable(srcRR, 0, 0);
-
- // Unpremultiply data if nessisary.
- cm = GraphicsUtil.coerceData(srcWR, cm, false);
-
- BandCombineOp op = new BandCombineOp(matrix, null);
- WritableRaster dstWR = op.filter(srcWR, srcWR);
-
- BufferedImage dstBI = new BufferedImage(cm,
- dstWR,
- cm.isAlphaPremultiplied(),
- null);
-
-
- return new \
ConcreteBufferedImageCachableRed(dstBI, srcMinX, srcMinY);*/
- return new ColorMatrixRed(matrix, srcCR);
+ return new ColorMatrixRed(convertSourceCS(srcRI), matrix);
}
}
1.3 +2 -2 \
xml-batik/sources/org/apache/batik/ext/awt/image/renderable/ComponentTransferRable.java
Index: ComponentTransferRable.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/ComponentTransferRable.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ComponentTransferRable.java 2001/03/26 21:27:31 1.2
+++ ComponentTransferRable.java 2001/04/27 19:53:46 1.3
@@ -15,9 +15,9 @@
* transfer operation.
*
* @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
- * @version $Id: ComponentTransferRable.java,v 1.2 2001/03/26 21:27:31 deweese Exp \
$ + * @version $Id: ComponentTransferRable.java,v 1.3 2001/04/27 19:53:46 deweese \
Exp $
*/
-public interface ComponentTransferRable extends Filter {
+public interface ComponentTransferRable extends FilterColorInterp {
/**
* Returns the source to be offset.
*/
1.3 +17 -49 \
xml-batik/sources/org/apache/batik/ext/awt/image/renderable/ComponentTransferRable8Bit.java
Index: ComponentTransferRable8Bit.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/ComponentTransferRable8Bit.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ComponentTransferRable8Bit.java 2001/03/26 21:27:31 1.2
+++ ComponentTransferRable8Bit.java 2001/04/27 19:53:47 1.3
@@ -13,16 +13,10 @@
import java.awt.Point;
import java.awt.RenderingHints;
-import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
-import java.awt.image.Raster;
-import java.awt.image.WritableRaster;
-import java.awt.image.ColorModel;
import java.awt.image.renderable.RenderContext;
-import org.apache.batik.ext.awt.image.rendered.CachableRed;
-import org.apache.batik.ext.awt.image.rendered.ComponentTransferOp;
-import org.apache.batik.ext.awt.image.rendered.BufferedImageCachableRed;
+import org.apache.batik.ext.awt.image.rendered.ComponentTransferRed;
import org.apache.batik.ext.awt.image.ComponentTransferFunction;
import org.apache.batik.ext.awt.image.TransferFunction;
@@ -37,11 +31,12 @@
* transfer operation.
*
* @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
- * @version $Id: ComponentTransferRable8Bit.java,v 1.2 2001/03/26 21:27:31 deweese \
Exp $ + * @version $Id: ComponentTransferRable8Bit.java,v 1.3 2001/04/27 19:53:47 \
deweese Exp $
*/
public class ComponentTransferRable8Bit
- extends AbstractRable
+ extends AbstractColorInterpRable
implements ComponentTransferRable {
+
public static final int ALPHA = 0;
public static final int RED = 1;
public static final int GREEN = 2;
@@ -62,10 +57,10 @@
txfFunc[] = new TransferFunction[4];
public ComponentTransferRable8Bit(Filter src,
- ComponentTransferFunction alphaFunction,
- ComponentTransferFunction redFunction,
- ComponentTransferFunction greenFunction,
- ComponentTransferFunction blueFunction){
+ ComponentTransferFunction alphaFunction,
+ ComponentTransferFunction redFunction,
+ ComponentTransferFunction greenFunction,
+ ComponentTransferFunction blueFunction){
super(src, null);
setAlphaFunction(alphaFunction);
setRedFunction(redFunction);
@@ -155,41 +150,10 @@
if(srcRI == null)
return null;
-
- CachableRed srcCR = GraphicsUtil.wrap(srcRI);
- srcCR = GraphicsUtil.convertToLsRGB(srcCR);
-
- final int srcMinX = srcCR.getMinX();
- final int srcMinY = srcCR.getMinY();
-
- //
- // Get transfer functions. These are computed lazily,
- // i.e., the first time they are requested
- //
- TransferFunction funcs[] = getTransferFunctions();
- //
- // Wrap source in buffered image
- //
- ColorModel cm = srcCR.getColorModel();
- Raster srcRR = srcCR.getData();
- WritableRaster srcWR = GraphicsUtil.makeRasterWritable(srcRR, 0, 0);
-
- // Unpremultiply data if nessisary.
- cm = GraphicsUtil.coerceData(srcWR, cm, false);
-
- BufferedImage srcBI = new BufferedImage(cm,
- srcWR,
- cm.isAlphaPremultiplied(),
- null);
-
- RenderingHints hints = rc.getRenderingHints();
- ComponentTransferOp op = new ComponentTransferOp(funcs,
- hints);
-
- BufferedImage dstBI = op.filter(srcBI, srcBI);
-
- return new BufferedImageCachableRed(dstBI, srcMinX, srcMinY);
+ return new ComponentTransferRed(convertSourceCS(srcRI),
+ getTransferFunctions(),
+ rc.getRenderingHints());
}
/**
@@ -203,7 +167,9 @@
//
TransferFunction txfFunc[] = new TransferFunction[4];
System.arraycopy(this.txfFunc, 0, txfFunc, 0, 4);
- ComponentTransferFunction functions[] = new ComponentTransferFunction[4];
+
+ ComponentTransferFunction functions[];
+ functions = new ComponentTransferFunction[4];
System.arraycopy(this.functions, 0, functions, 0, 4);
for(int i=0; i<4; i++){
@@ -223,7 +189,9 @@
/**
* Converts a ComponentTransferFunction to a TransferFunction
*/
- private static TransferFunction getTransferFunction(ComponentTransferFunction \
function){ + private static TransferFunction getTransferFunction
+ (ComponentTransferFunction function){
+
TransferFunction txfFunc = null;
if(function == null){
txfFunc = new IdentityTransfer();
1.3 +2 -2 \
xml-batik/sources/org/apache/batik/ext/awt/image/renderable/ConvolveMatrixRable.java \
Index: ConvolveMatrixRable.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/ConvolveMatrixRable.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ConvolveMatrixRable.java 2001/03/26 21:27:31 1.2
+++ ConvolveMatrixRable.java 2001/04/27 19:53:47 1.3
@@ -17,9 +17,9 @@
* Convolves an image with a convolution matrix.
*
* @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
- * @version $Id: ConvolveMatrixRable.java,v 1.2 2001/03/26 21:27:31 deweese Exp $
+ * @version $Id: ConvolveMatrixRable.java,v 1.3 2001/04/27 19:53:47 deweese Exp $
*/
-public interface ConvolveMatrixRable extends Filter {
+public interface ConvolveMatrixRable extends FilterColorInterp {
/**
* Returns the source to be Convolved
1.3 +3 -6 \
xml-batik/sources/org/apache/batik/ext/awt/image/renderable/ConvolveMatrixRable8Bit.java
Index: ConvolveMatrixRable8Bit.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/ConvolveMatrixRable8Bit.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ConvolveMatrixRable8Bit.java 2001/03/26 21:27:31 1.2
+++ ConvolveMatrixRable8Bit.java 2001/04/27 19:53:48 1.3
@@ -46,10 +46,10 @@
* Does not support edgeMode="wrap" - pending Tile code.
*
* @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
- * @version $Id: ConvolveMatrixRable8Bit.java,v 1.2 2001/03/26 21:27:31 deweese \
Exp $ + * @version $Id: ConvolveMatrixRable8Bit.java,v 1.3 2001/04/27 19:53:48 \
deweese Exp $
*/
public class ConvolveMatrixRable8Bit
- extends AbstractRable
+ extends AbstractColorInterpRable
implements ConvolveMatrixRable
{
@@ -263,10 +263,7 @@
// ("Padded Image", ri,
// new Rectangle(ri.getMinX()+22,ri.getMinY()+38,5,5));
- CachableRed cr;
- cr = GraphicsUtil.wrap(ri);
- cr = GraphicsUtil.convertToLsRGB(cr);
-
+ CachableRed cr = convertSourceCS(ri);
Shape devShape = srcAt.createTransformedShape(aoi);
Rectangle2D devRect = devShape.getBounds2D();
1.3 +2 -2 \
xml-batik/sources/org/apache/batik/ext/awt/image/renderable/DisplacementMapRable.java \
Index: DisplacementMapRable.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/DisplacementMapRable.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DisplacementMapRable.java 2001/03/26 21:27:32 1.2
+++ DisplacementMapRable.java 2001/04/27 19:53:49 1.3
@@ -17,9 +17,9 @@
* another image to spatially displace the input image
*
* @author <a href="mailto:sheng.pei@eng.sun.com>Sheng Pei</a>
- * @version $Id: DisplacementMapRable.java,v 1.2 2001/03/26 21:27:32 deweese Exp $
+ * @version $Id: DisplacementMapRable.java,v 1.3 2001/04/27 19:53:49 deweese Exp $
*/
-public interface DisplacementMapRable extends Filter {
+public interface DisplacementMapRable extends FilterColorInterp {
public static final int CHANNEL_R = 1;
public static final int CHANNEL_G = 2;
public static final int CHANNEL_B = 3;
1.6 +4 -6 \
xml-batik/sources/org/apache/batik/ext/awt/image/renderable/DisplacementMapRable8Bit.java
Index: DisplacementMapRable8Bit.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/DisplacementMapRable8Bit.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DisplacementMapRable8Bit.java 2001/04/24 21:34:47 1.5
+++ DisplacementMapRable8Bit.java 2001/04/27 19:53:49 1.6
@@ -38,10 +38,10 @@
* another image to spatially displace the input image
*
* @author <a href="mailto:sheng.pei@eng.sun.com>Sheng Pei</a>
- * @version $Id: DisplacementMapRable8Bit.java,v 1.5 2001/04/24 21:34:47 deweese \
Exp $ + * @version $Id: DisplacementMapRable8Bit.java,v 1.6 2001/04/27 19:53:49 \
deweese Exp $
*/
public class DisplacementMapRable8Bit
- extends AbstractRable
+ extends AbstractColorInterpRable
implements DisplacementMapRable{
/**
* Displacement scale factor
@@ -217,10 +217,8 @@
return null;
}
- displacedRed = GraphicsUtil.convertToLsRGB
- (GraphicsUtil.wrap(displacedRed));
- mapRed = GraphicsUtil.convertToLsRGB
- (GraphicsUtil.wrap(mapRed));
+ mapRed = convertSourceCS(mapRed);
+
//
// Build a BufferedImages from the two sources
//
1.2 +2 -2 \
xml-batik/sources/org/apache/batik/ext/awt/image/renderable/GaussianBlurRable.java
Index: GaussianBlurRable.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/GaussianBlurRable.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- GaussianBlurRable.java 2001/01/24 05:39:33 1.1
+++ GaussianBlurRable.java 2001/04/27 19:53:49 1.2
@@ -13,9 +13,9 @@
* defined by standard deviations along the x and y axis.
*
* @author <a href="mailto:vincent.hardy@eng.sun.com>Vincent Hardy</a>
- * @version $Id: GaussianBlurRable.java,v 1.1 2001/01/24 05:39:33 vhardy Exp $
+ * @version $Id: GaussianBlurRable.java,v 1.2 2001/04/27 19:53:49 deweese Exp $
*/
-public interface GaussianBlurRable extends Filter {
+public interface GaussianBlurRable extends FilterColorInterp {
/**
* Returns the source to be Blurred
*/
1.5 +3 -7 \
xml-batik/sources/org/apache/batik/ext/awt/image/renderable/GaussianBlurRable8Bit.java
Index: GaussianBlurRable8Bit.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/GaussianBlurRable8Bit.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- GaussianBlurRable8Bit.java 2001/03/26 21:27:32 1.4
+++ GaussianBlurRable8Bit.java 2001/04/27 19:53:50 1.5
@@ -36,10 +36,10 @@
* GaussianBlurRable implementation
*
* @author <a href="mailto:vincent.hardy@eng.sun.com>Vincent Hardy</a>
- * @version $Id: GaussianBlurRable8Bit.java,v 1.4 2001/03/26 21:27:32 deweese Exp \
$ + * @version $Id: GaussianBlurRable8Bit.java,v 1.5 2001/04/27 19:53:50 deweese Exp \
$
*/
public class GaussianBlurRable8Bit
- extends AbstractRable
+ extends AbstractColorInterpRable
implements GaussianBlurRable {
/**
* Deviation along the x-axis
@@ -260,11 +260,7 @@
if (ri == null)
return null;
- CachableRed cr;
- cr = GraphicsUtil.wrap(ri);
- // org.apache.batik.test.gvt.ImageDisplay.showImage("Wrap: ", cr);
- cr = GraphicsUtil.convertToLsRGB(cr);
- // org.apache.batik.test.gvt.ImageDisplay.showImage("Conv: ", cr);
+ CachableRed cr = convertSourceCS(ri);
// System.out.println("DevRect: " + devRect);
1.2 +2 -2 \
xml-batik/sources/org/apache/batik/ext/awt/image/renderable/TurbulenceRable.java
Index: TurbulenceRable.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/TurbulenceRable.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TurbulenceRable.java 2001/01/24 05:39:35 1.1
+++ TurbulenceRable.java 2001/04/27 19:53:51 1.2
@@ -14,9 +14,9 @@
* Creates a sourceless image from a turbulence function.
*
* @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
- * @version $Id: TurbulenceRable.java,v 1.1 2001/01/24 05:39:35 vhardy Exp $
+ * @version $Id: TurbulenceRable.java,v 1.2 2001/04/27 19:53:51 deweese Exp $
*/
-public interface TurbulenceRable extends Filter {
+public interface TurbulenceRable extends FilterColorInterp {
/**
* Sets the turbulence region
1.4 +9 -3 \
xml-batik/sources/org/apache/batik/ext/awt/image/renderable/TurbulenceRable8Bit.java \
Index: TurbulenceRable8Bit.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/TurbulenceRable8Bit.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TurbulenceRable8Bit.java 2001/03/26 21:27:33 1.3
+++ TurbulenceRable8Bit.java 2001/04/27 19:53:51 1.4
@@ -19,6 +19,8 @@
import java.awt.RenderingHints;
import java.awt.Shape;
+import java.awt.color.ColorSpace;
+
import java.awt.geom.Area;
import java.awt.geom.Rectangle2D;
import java.awt.geom.AffineTransform;
@@ -27,6 +29,7 @@
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
+import java.awt.image.DirectColorModel;
import java.awt.image.DataBuffer;
import java.awt.image.Raster;
import java.awt.image.RenderedImage;
@@ -40,10 +43,10 @@
* Creates a sourceless image from a turbulence function.
*
* @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
- * @version $Id: TurbulenceRable8Bit.java,v 1.3 2001/03/26 21:27:33 deweese Exp $
+ * @version $Id: TurbulenceRable8Bit.java,v 1.4 2001/04/27 19:53:51 deweese Exp $
*/
public class TurbulenceRable8Bit
- extends AbstractRable
+ extends AbstractColorInterpRable
implements TurbulenceRable {
/**
@@ -236,7 +239,10 @@
(rasterRect.height <= 0))
return null;
- ColorModel cm = GraphicsUtil.Linear_sRGB_Unpre;
+ ColorSpace cs = getOperationColorSpace();
+ ColorModel cm = new DirectColorModel
+ (cs, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
+ false, DataBuffer.TYPE_INT);
// Create a raster for the turbulence pattern
WritableRaster wr, twr;
1.3 +2 -3 \
xml-batik/sources/org/apache/batik/ext/awt/image/rendered/ColorMatrixRed.java
Index: ColorMatrixRed.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/rendered/ColorMatrixRed.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ColorMatrixRed.java 2001/02/01 13:45:49 1.2
+++ ColorMatrixRed.java 2001/04/27 19:53:58 1.3
@@ -22,7 +22,7 @@
/**
*
* @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
- * @version $Id: ColorMatrixRed.java,v 1.2 2001/02/01 13:45:49 tkormann Exp $
+ * @version $Id: ColorMatrixRed.java,v 1.3 2001/04/27 19:53:58 deweese Exp $
*/
public class ColorMatrixRed extends AbstractRed{
/**
@@ -69,8 +69,7 @@
return cm;
}
- public ColorMatrixRed(float[][] matrix,
- CachableRed src){
+ public ColorMatrixRed(CachableRed src, float[][] matrix){
setMatrix(matrix);
ColorModel cm = GraphicsUtil.Linear_sRGB_Unpre;
1.5 +24 -4 \
xml-batik/sources/org/apache/batik/ext/awt/image/spi/ImageTagRegistry.java
Index: ImageTagRegistry.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/spi/ImageTagRegistry.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ImageTagRegistry.java 2001/04/25 14:35:38 1.4
+++ ImageTagRegistry.java 2001/04/27 19:54:00 1.5
@@ -21,6 +21,7 @@
import org.apache.batik.ext.awt.image.renderable.Filter;
import org.apache.batik.ext.awt.color.ICCColorSpaceExt;
import org.apache.batik.util.ParsedURL;
+import org.apache.batik.util.Service;
import java.awt.Graphics2D;
import java.awt.Color;
@@ -32,6 +33,13 @@
import org.apache.batik.ext.awt.image.renderable.ProfileRable;
+/**
+ * This class handles the registered Image tag handlers. These are
+ * instances of RegisteryEntry in this package.
+ *
+ * @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
+ * @version $Id: ImageTagRegistry.java,v 1.5 2001/04/27 19:54:00 deweese Exp $
+ */
public class ImageTagRegistry {
List entries = new LinkedList();
@@ -197,15 +205,27 @@
li.add(newRE);
}
- static ImageTagRegistry registry = new ImageTagRegistry();
+ static ImageTagRegistry registry = null;
- static {
+
+
+ public synchronized static ImageTagRegistry getRegistry() {
+ if (registry != null)
+ return registry;
+
+ registry = new ImageTagRegistry();
+
registry.register(new PNGRegistryEntry());
registry.register(new JPEGRegistryEntry());
registry.register(new JDKRegistryEntry());
- }
+
+ Iterator iter = Service.providers(RegistryEntry.class);
+ while (iter.hasNext()) {
+ RegistryEntry re = (RegistryEntry)iter.next();
+ // System.out.println("RE: " + re);
+ registry.register(re);
+ }
- public static ImageTagRegistry getRegistry() {
return registry;
}
1.2 +10 -5 \
xml-batik/sources/org/apache/batik/ext/awt/image/spi/JDKRegistryEntry.java
Index: JDKRegistryEntry.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/spi/JDKRegistryEntry.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JDKRegistryEntry.java 2001/04/24 21:34:50 1.1
+++ JDKRegistryEntry.java 2001/04/27 19:54:00 1.2
@@ -43,7 +43,7 @@
public final static float PRIORITY =
1000*MagicNumberRegistryEntry.PRIORITY;
- JDKRegistryEntry() {
+ public JDKRegistryEntry() {
super ("JDK", PRIORITY, new String[0]);
}
@@ -126,6 +126,10 @@
// Clean up our registraction
mediaTracker.removeImage(img, myID);
+ if ((img.getWidth(null) == -1)||
+ (img.getHeight(null) == -1))
+ return null;
+
// Build the image to .
BufferedImage bi = null;
bi = new BufferedImage(img.getWidth(null),
@@ -141,8 +145,10 @@
public void run() {
Filter filt;
RenderedImage ri = loadImage(img);
-
- filt = new RedRable(GraphicsUtil.wrap(ri));
+ if (ri == null)
+ filt = ImageTagRegistry.getBrokenLinkImage();
+ else
+ filt = new RedRable(GraphicsUtil.wrap(ri));
dr.setSource(filt);
}
};
@@ -151,8 +157,7 @@
}
// Stuff for Image Loading.
- static Component mediaComponent = new Label() { };
+ static Component mediaComponent = new Label();
static MediaTracker mediaTracker = new MediaTracker(mediaComponent);
static int id = 0;
}
-
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic