1 18 package org.apache.batik.svggen; 19 20 import java.awt.Rectangle ; 21 import java.awt.RenderingHints ; 22 import java.awt.geom.Point2D ; 23 import java.awt.geom.Rectangle2D ; 24 import java.awt.image.BufferedImage ; 25 import java.awt.image.BufferedImageOp ; 26 import java.awt.image.ColorModel ; 27 28 class NullOp implements BufferedImageOp { 29 public BufferedImage filter(BufferedImage src, BufferedImage dest){ 30 java.awt.Graphics2D g = dest.createGraphics(); 31 g.drawImage(src, 0, 0, null); 32 g.dispose(); 33 return dest; 34 } 35 36 public Rectangle2D getBounds2D(BufferedImage src){ 37 return new Rectangle (0, 0, src.getWidth(), src.getHeight()); 38 } 39 40 41 44 public BufferedImage createCompatibleDestImage (BufferedImage src, 45 ColorModel destCM){ 46 BufferedImage dest = null; 47 if(destCM==null) 48 destCM = src.getColorModel(); 49 50 dest = new BufferedImage (destCM, destCM.createCompatibleWritableRaster(src.getWidth(), src.getHeight()), 51 destCM.isAlphaPremultiplied(), null); 52 53 return dest; 54 } 55 56 61 public Point2D getPoint2D (Point2D srcPt, Point2D destPt){ 62 if(destPt==null) 64 destPt = new Point2D.Double (); 65 destPt.setLocation(srcPt.getX(), srcPt.getY()); 66 return destPt; 67 } 68 69 73 public RenderingHints getRenderingHints(){ 74 return null; 75 } 76 } 77 78 | Popular Tags |