1 18 19 package org.apache.batik.ext.awt.image.codec; 20 21 import java.awt.image.ColorModel ; 22 import java.awt.image.Raster ; 23 24 28 public class SingleTileRenderedImage extends SimpleRenderedImage { 29 30 Raster ras; 31 32 40 public SingleTileRenderedImage(Raster ras, ColorModel colorModel) { 41 this.ras = ras; 42 43 this.tileGridXOffset = this.minX = ras.getMinX(); 44 this.tileGridYOffset = this.minY = ras.getMinY(); 45 this.tileWidth = this.width = ras.getWidth(); 46 this.tileHeight = this.height = ras.getHeight(); 47 this.sampleModel = ras.getSampleModel(); 48 this.colorModel = colorModel; 49 } 50 51 54 public Raster getTile(int tileX, int tileY) { 55 if (tileX != 0 || tileY != 0) { 56 throw new IllegalArgumentException (PropertyUtil.getString("SingleTileRenderedImage0")); 57 } 58 return ras; 59 } 60 } 61 | Popular Tags |