1 18 package org.apache.batik.ext.awt.image.codec.tiff; 19 20 import org.apache.batik.ext.awt.image.codec.ImageDecodeParam; 21 22 71 public class TIFFDecodeParam implements ImageDecodeParam { 72 73 private boolean decodePaletteAsShorts = false; 74 private Long ifdOffset = null; 75 private boolean convertJPEGYCbCrToRGB = true; 76 77 78 public TIFFDecodeParam() { 79 } 80 81 85 public void setDecodePaletteAsShorts(boolean decodePaletteAsShorts) { 86 this.decodePaletteAsShorts = decodePaletteAsShorts; 87 } 88 89 93 public boolean getDecodePaletteAsShorts() { 94 return decodePaletteAsShorts; 95 } 96 97 106 public byte decode16BitsTo8Bits(int s) { 107 return (byte)((s >> 8) & 0xffff); 108 } 109 110 115 public byte decodeSigned16BitsTo8Bits(short s) { 116 return (byte)((s + Short.MIN_VALUE) >> 8); 117 } 118 119 130 public void setIFDOffset(long offset) { 131 ifdOffset = new Long (offset); 132 } 133 134 138 public Long getIFDOffset() { 139 return ifdOffset; 140 } 141 142 147 public void setJPEGDecompressYCbCrToRGB(boolean convertJPEGYCbCrToRGB) { 148 this.convertJPEGYCbCrToRGB = convertJPEGYCbCrToRGB; 149 } 150 151 154 public boolean getJPEGDecompressYCbCrToRGB() { 155 return convertJPEGYCbCrToRGB; 156 } 157 } 158 | Popular Tags |