1 18 package org.apache.batik.transcoder.image; 19 20 import java.util.HashMap ; 21 import java.util.Map ; 22 23 import org.apache.batik.transcoder.TranscoderInput; 24 25 31 public class PixelToMMTest extends AbstractImageTranscoderTest { 32 33 34 protected String inputURI; 35 36 37 protected String refImageURI; 38 39 40 protected Float px2mm; 41 42 49 public PixelToMMTest(String inputURI, 50 String refImageURI, 51 Float px2mm) { 52 this.inputURI = inputURI; 53 this.refImageURI = refImageURI; 54 this.px2mm = px2mm; 55 } 56 57 60 protected TranscoderInput createTranscoderInput() { 61 return new TranscoderInput(resolveURL(inputURI).toString()); 62 } 63 64 67 protected Map createTranscodingHints() { 68 Map hints = new HashMap (3); 69 hints.put(ImageTranscoder.KEY_PIXEL_UNIT_TO_MILLIMETER, px2mm); 70 return hints; 71 } 72 73 76 protected byte [] getReferenceImageData() { 77 return createBufferedImageData(resolveURL(refImageURI)); 78 } 79 } 80 | Popular Tags |