1 18 package org.apache.batik.ext.awt.image.renderable; 19 20 import java.awt.image.RenderedImage ; 21 import java.awt.image.renderable.RenderContext ; 22 23 import org.apache.batik.ext.awt.color.ICCColorSpaceExt; 24 import org.apache.batik.ext.awt.image.GraphicsUtil; 25 import org.apache.batik.ext.awt.image.rendered.CachableRed; 26 import org.apache.batik.ext.awt.image.rendered.ProfileRed; 27 28 35 public class ProfileRable extends AbstractRable{ 36 37 private ICCColorSpaceExt colorSpace; 38 39 43 public ProfileRable(Filter src, ICCColorSpaceExt colorSpace){ 44 super(src); 45 this.colorSpace = colorSpace; 46 } 47 48 51 public void setSource(Filter src){ 52 init(src, null); 53 } 54 55 58 public Filter getSource(){ 59 return (Filter)getSources().get(0); 60 } 61 62 65 public void setColorSpace(ICCColorSpaceExt colorSpace){ 66 touch(); 67 this.colorSpace = colorSpace; 68 } 69 70 73 public ICCColorSpaceExt getColorSpace(){ 74 return colorSpace; 75 } 76 77 public RenderedImage createRendering(RenderContext rc) { 78 RenderedImage srcRI = getSource().createRendering(rc); 82 83 if(srcRI == null) 84 return null; 85 86 CachableRed srcCR = GraphicsUtil.wrap(srcRI); 87 return new ProfileRed(srcCR, colorSpace); 88 } 89 } 90 | Popular Tags |