rebuild.graphics.tiff.tags
Class CompressionTag

java.lang.Object
  extended by rebuild.graphics.tiff.Tag
      extended by rebuild.graphics.tiff.tags.ShortTag
          extended by rebuild.graphics.tiff.tags.CompressionTag

public final class CompressionTag
extends ShortTag

Compression scheme used on the image data.

Since:
BBX 1.0.1

Field Summary
static short CCITT_FAX3
          CCITT Group 3 fax encoding
static short CCITT_FAX4
          CCITT Group 4 fax encoding
static short CCITT_RLE
          CCITT Group 3 1-Dimensional Modified Huffman run length encoding.
static short DEFLATE_ADOBE
          Adobe's Deflate algorithm.
static short JPEG_NEW
          The current JPEG compression.
static short JPEG_OLD
          The original, not that great, JPEG compression.
static short LZW
          LZW compression.
static short NO_COMPRESSION
          No compression, but pack data into bytes as tightly as possible, leaving no unused bits (except at the end of a row).
static short PACKBITS
          PackBits compression, aka Macintosh RLE.
 
Fields inherited from class rebuild.graphics.tiff.Tag
count, data, dataType, value
 
Constructor Summary
CompressionTag()
          Create a new Compression tag.
CompressionTag(short compression)
          Create a new Compression tag.
 
Method Summary
 short getCompression()
          Get the current compression value.
static short getTagTypeValue()
          Get the Tag's type.
 boolean hasDefault()
          Get if this Tag can have a default value, often defined by a parameter-less constructor.
 boolean isDefault()
          Get if this Tag's current value is the default value.
 void setCount(int count)
          There is always only 1 element.
 void setValue(int compression)
          Set the compression value to use.
 
Methods inherited from class rebuild.graphics.tiff.tags.ShortTag
extraData, getShort, setDataType, setExtraData, setShort, setupForBigTIFF, writeData
 
Methods inherited from class rebuild.graphics.tiff.Tag
equals, getBigCount, getBigValue, getCount, getDataType, getExtraData, getIfExtraDataExists, getTagType, getValue, hashCode, setCount, setValue, toString, write, write, write, write, writeBig
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_COMPRESSION

public static final short NO_COMPRESSION
No compression, but pack data into bytes as tightly as possible, leaving no unused bits (except at the end of a row).

See Also:
Constant Field Values

CCITT_RLE

public static final short CCITT_RLE
CCITT Group 3 1-Dimensional Modified Huffman run length encoding.

See Also:
Constant Field Values

CCITT_FAX3

public static final short CCITT_FAX3
CCITT Group 3 fax encoding

See Also:
Constant Field Values

CCITT_FAX4

public static final short CCITT_FAX4
CCITT Group 4 fax encoding

See Also:
Constant Field Values

LZW

public static final short LZW
LZW compression.

See Also:
Constant Field Values

JPEG_OLD

public static final short JPEG_OLD
The original, not that great, JPEG compression.

See Also:
Constant Field Values

JPEG_NEW

public static final short JPEG_NEW
The current JPEG compression.

See Also:
Constant Field Values

DEFLATE_ADOBE

public static final short DEFLATE_ADOBE
Adobe's Deflate algorithm.

See Also:
Constant Field Values

PACKBITS

public static final short PACKBITS
PackBits compression, aka Macintosh RLE.

See Also:
Constant Field Values
Constructor Detail

CompressionTag

public CompressionTag()
Create a new Compression tag.


CompressionTag

public CompressionTag(short compression)
Create a new Compression tag.

Parameters:
compression - The compression value to use.
Method Detail

getTagTypeValue

public static short getTagTypeValue()
Get the Tag's type.

Returns:
The Tag's type.

setCount

public void setCount(int count)
There is always only 1 element.

Overrides:
setCount in class ShortTag
Parameters:
count - The number of Writer.SHORT contained in the tag. If the number is bigger than the current count then it will add 0 Writer.SHORT, else it will remove the Writer.SHORT.
See Also:
setCount

setValue

public void setValue(int compression)
Set the compression value to use.

Overrides:
setValue in class Tag
Parameters:
compression - The compression to use.
See Also:
getValue

getCompression

public short getCompression()
Get the current compression value.

Returns:
The compression that this tag is set to.

hasDefault

public boolean hasDefault()
Get if this Tag can have a default value, often defined by a parameter-less constructor.

Overrides:
hasDefault in class ShortTag
Returns:
true if the Tag has a default value, false if otherwise. Default is false.

isDefault

public boolean isDefault()
Get if this Tag's current value is the default value. This is ignored if Tag.hasDefault() returns false.

Overrides:
isDefault in class ShortTag
Returns:
true if the Tag's value is the default value, false if otherwise.