rebuild.graphics
Class TIFFEncoder

java.lang.Object
  extended by rebuild.graphics.ImageEncoder
      extended by rebuild.graphics.TIFFEncoder

public class TIFFEncoder
extends ImageEncoder

A Tagged Image File Format (TIFF) encoder.

Currently only the Baseline TIFF is supported for writing (with the exception of alpha). Any tags that modify the image format are not supported even if the variables are there. Only one image, non-compressed, RGB/A, 8bits per sample is supported.

Since:
BBX 1.0.1

Field Summary
 
Fields inherited from class rebuild.graphics.ImageEncoder
compressionLevel, dataBytes, encodeAlpha, height, image, scaleX, scaleY, width, xOffset, yOffset
 
Constructor Summary
TIFFEncoder()
          Class constructor
TIFFEncoder(Bitmap image)
          Class constructor specifying Bitmap to encode, with no alpha channel encoding.
TIFFEncoder(Bitmap image, boolean encodeAlpha)
          Class constructor specifying Bitmap to encode, with no alpha channel encoding.
 
Method Summary
 IFD getIFD()
          Get this TIFF encoder's TIFFTags.IFD so that new tags can be added or removed.
 java.lang.String getMime()
          Get the MIME type of the image encoder.
 boolean getWritingBigTIFF()
          Get if the TIFFEncoder should write a BigTIFF.
protected  byte[] inEncode(boolean encodeAlpha)
          Creates an array of bytes that is the TIFF equivalent of the current image, specifying whether to encode alpha or not.
 void setCompressionLevel(int level)
          Set the compression level to use.
 void setWritingBigTIFF(boolean bTiff)
          Set if the TIFFEncoder should write a BigTIFF.
 
Methods inherited from class rebuild.graphics.ImageEncoder
encode, encode, getARGBByte, getARGBInt, getCompressionLevel, getEncodeAlpha, getIndex, getIndex, setEncodeAlpha, setImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TIFFEncoder

public TIFFEncoder()
Class constructor


TIFFEncoder

public TIFFEncoder(Bitmap image)
Class constructor specifying Bitmap to encode, with no alpha channel encoding.

Parameters:
image - A Java Image object which uses the DirectColorModel.

TIFFEncoder

public TIFFEncoder(Bitmap image,
                   boolean encodeAlpha)
Class constructor specifying Bitmap to encode, with no alpha channel encoding.

Parameters:
image - A Java Image object which uses the DirectColorModel.
encodeAlpha - boolean false = no alpha, true = encode alpha
Method Detail

getMime

public java.lang.String getMime()
Get the MIME type of the image encoder.

Specified by:
getMime in class ImageEncoder
Returns:
The MIME type of the image encoder.

getIFD

public IFD getIFD()
Get this TIFF encoder's TIFFTags.IFD so that new tags can be added or removed.

Returns:

getWritingBigTIFF

public final boolean getWritingBigTIFF()
Get if the TIFFEncoder should write a BigTIFF.

Returns:
true if the encoder will write a BigTIFF, false if otherwise.

setWritingBigTIFF

public final void setWritingBigTIFF(boolean bTiff)
Set if the TIFFEncoder should write a BigTIFF.

Parameters:
bTiff - true if the encoder should write a BigTIFF, false if otherwise.

setCompressionLevel

public void setCompressionLevel(int level)
Set the compression level to use.

Overrides:
setCompressionLevel in class ImageEncoder
Parameters:
The - compression level to set.

inEncode

protected byte[] inEncode(boolean encodeAlpha)
                   throws java.io.IOException
Creates an array of bytes that is the TIFF equivalent of the current image, specifying whether to encode alpha or not.

Specified by:
inEncode in class ImageEncoder
Parameters:
encodeAlpha - boolean false = no alpha, true = encode alpha
Returns:
an array of bytes, or null if there was a problem
Throws:
java.io.IOException - If an error occurs.