You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by cj...@apache.org on 2001/05/11 15:05:08 UTC
cvs commit: xml-batik/sources/org/apache/batik/ext/awt/image GraphicsUtil.java
cjolif 01/05/11 06:05:08
Modified: sources/org/apache/batik/ext/awt/image GraphicsUtil.java
Log:
remove useless import statements
Revision Changes Path
1.17 +23 -28 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.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- GraphicsUtil.java 2001/05/02 14:56:23 1.16
+++ GraphicsUtil.java 2001/05/11 13:05:06 1.17
@@ -42,11 +42,6 @@
import java.awt.image.renderable.RenderContext;
import java.awt.image.renderable.RenderableImage;
-import org.apache.batik.gvt.GraphicsNodeRenderContext;
-import org.apache.batik.gvt.GraphicsNode;
-import org.apache.batik.gvt.CompositeGraphicsNode;
-import org.apache.batik.gvt.filter.GraphicsNodeRable;
-
import org.apache.batik.ext.awt.RenderingHintsKeyExt;
import org.apache.batik.ext.awt.image.PadMode;
import org.apache.batik.ext.awt.image.renderable.Filter;
@@ -70,7 +65,7 @@
* implementations.
*
* @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
- * @version $Id: GraphicsUtil.java,v 1.16 2001/05/02 14:56:23 deweese Exp $
+ * @version $Id: GraphicsUtil.java,v 1.17 2001/05/11 13:05:06 cjolif Exp $
*/
public class GraphicsUtil {
@@ -119,9 +114,9 @@
// System.out.println("testing Translate");
int dx = tr.getDeltaX();
int dy = tr.getDeltaY();
- if (at == null)
+ if (at == null)
at = AffineTransform.getTranslateInstance(dx, dy);
- else
+ else
at.translate(dx, dy);
cr = tr.getSource();
continue;
@@ -134,7 +129,7 @@
at = g2dAt;
else
at.preConcatenate(g2dAt);
-
+
if (false) {
System.out.println("CR: " + cr);
System.out.println("CRR: " + cr.getBounds());
@@ -151,7 +146,7 @@
cr = new TranslateRed(cr, xloc, yloc);
}
}
-
+
ColorSpace g2dCS = getDestinationColorSpace(g2d);
if (g2dCS == null)
// Assume device is sRGB
@@ -198,14 +193,14 @@
Rectangle crR = cr.getBounds();
Shape clip = g2d.getClip();
- try {
+ try {
Rectangle clipR;
if (clip == null) {
clip = crR;
clipR = crR;
} else {
clipR = clip.getBounds();
-
+
if (clipR.intersects(crR) == false)
return; // Nothing to draw...
clipR = clipR.intersection(crR);
@@ -265,7 +260,7 @@
big2d.dispose();
CachableRed cCr;
- cCr = new BufferedImageCachableRed(bi, clipR.x,
+ cCr = new BufferedImageCachableRed(bi, clipR.x,
clipR.y);
cr = new MultiplyAlphaRed (cr, cCr);
}
@@ -314,7 +309,7 @@
int endX = clipR.x+clipR.width-1;
int endY = clipR.y+clipR.height-1;
-
+
if (false) {
System.out.println("clipR: " + clipR + " TG: [" +
xt0 +"," +
@@ -339,7 +334,7 @@
tR.x = xloc;
tR.y = yloc;
Rectangle2D.intersect(crR, tR, iR);
-
+
WritableRaster twr;
twr = wr.createWritableChild(0, 0,
iR.width, iR.height,
@@ -450,19 +445,19 @@
* BufferedImage.createGraphics that arranges for bi to be stored
* in a Rendering hint in the returned Graphics2D.
* This allows for accurate determination of the 'devices' size,
- * and colorspace.
+ * and colorspace.
* @param bi The BufferedImage that the returned Graphics should
* draw into.
* @return A Graphics2D that draws into BufferedImage with <tt>bi</tt>
* stored in a rendering hint.
*/
- public static Graphics2D createGraphics(BufferedImage bi,
+ public static Graphics2D createGraphics(BufferedImage bi,
RenderingHints hints) {
Graphics2D g2d = bi.createGraphics();
if (hints != null)
g2d.addRenderingHints(hints);
- g2d.setRenderingHint(RenderingHintsKeyExt.KEY_BUFFERED_IMAGE,
+ g2d.setRenderingHint(RenderingHintsKeyExt.KEY_BUFFERED_IMAGE,
new WeakReference(bi));
g2d.clip(new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
return g2d;
@@ -471,7 +466,7 @@
public static Graphics2D createGraphics(BufferedImage bi) {
Graphics2D g2d = bi.createGraphics();
- g2d.setRenderingHint(RenderingHintsKeyExt.KEY_BUFFERED_IMAGE,
+ g2d.setRenderingHint(RenderingHintsKeyExt.KEY_BUFFERED_IMAGE,
new WeakReference(bi));
g2d.clip(new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
return g2d;
@@ -1051,8 +1046,8 @@
return coerceColorModel(cm, newAlphaPreMult);
}
+
-
/**
@@ -1132,7 +1127,7 @@
int [] oPix = new int[bands*w];
int out = (w*bands)-1; // The 2 skips alpha channel
while(out >= 0) {
- // Fill alpha channel with 255's
+ // Fill alpha channel with 255's
oPix[out] = 255;
out -= bands;
}
@@ -1170,7 +1165,7 @@
switch (bands) {
case 4:
while(in >= 0) {
- a = pixel[in];
+ a = pixel[in];
if (a == 255)
in -= 4;
else {
@@ -1184,7 +1179,7 @@
break;
default:
while(in >= 0) {
- a = pixel[in];
+ a = pixel[in];
if (a == 255)
in -= bands;
else {
@@ -1210,7 +1205,7 @@
case 4:
while(in >= 0) {
a = pixel[in];
- if ((a <= 0) || (a >= 255))
+ if ((a <= 0) || (a >= 255))
in -= 4;
else {
in--;
@@ -1224,7 +1219,7 @@
default:
while(in >= 0) {
a = pixel[in];
- if ((a <= 0) || (a >= 255))
+ if ((a <= 0) || (a >= 255))
in -= bands;
else {
in--;
@@ -1433,7 +1428,7 @@
= (db.getOffset() +
csm.getOffset(wr.getMinX()-wr.getSampleModelTranslateX(),
wr.getMinY()-wr.getSampleModelTranslateY()));
-
+
int a=0;
int aOff = bandOff[bandOff.length-1];
@@ -1447,7 +1442,7 @@
while (sp < end) {
a = pixels[sp+aOff]&0xFF;
if (a==0) {
- for (b=0; b<bands; b++)
+ for (b=0; b<bands; b++)
pixels[sp+bandOff[b]] = (byte)0xFF;
} else if (a<255) {
int aFP = (0x00FF0000/a);
@@ -1478,7 +1473,7 @@
= (db.getOffset() +
csm.getOffset(wr.getMinX()-wr.getSampleModelTranslateX(),
wr.getMinY()-wr.getSampleModelTranslateY()));
-
+
int a=0;
int aOff = bandOff[bandOff.length-1];
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org