rebuild.graphics.tiff.tags
Class StripOffsetsTag

java.lang.Object
  extended by rebuild.graphics.tiff.Tag
      extended by rebuild.graphics.tiff.tags.StripOffsetsTag

public final class StripOffsetsTag
extends Tag

For each strip, the byte offset of that strip.

Since:
BBX 1.0.1

Field Summary
 
Fields inherited from class rebuild.graphics.tiff.Tag
count, data, dataType, value
 
Constructor Summary
StripOffsetsTag(int stripsPerImage, short planarConfig, short sampleCount)
          Create a new StripOffsets tag.
 
Method Summary
protected  boolean extraData(boolean big)
          This method figures out if any extra data is exists, this method can search the data type, extra data, value, and count.
 long getStripOffset(int strip)
          Get the strip offset for a particular strip.
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()
          Unused.
 void setCount(int count)
          Unused, use setCount(int, short, short) instead.
 void setCount(int stripsPerImage, short planarConfig, short sampleCount)
          Set the number of strip items.
 void setCount(long count)
          Unused, use setCount(int, short, short) instead.
 void setDataType(short dataType)
          Data type is determined by the value.
 void setStripOffset(int strip, long offset)
          Set the strip offset for a particular strip.
protected  void setupForBigTIFF(boolean set)
          Setup the tag for writing in a BigTIFF.
 void setValue(int value)
          Unused.
 void writeData(Writer wr)
          The extra data writer, if any extra data exists then this method will be called and (through internal methods) a offset to the data will be used in place of the value parameter.
 
Methods inherited from class rebuild.graphics.tiff.Tag
equals, getBigCount, getBigValue, getCount, getDataType, getExtraData, getIfExtraDataExists, getTagType, getValue, hashCode, setExtraData, setValue, toString, write, write, write, write, writeBig
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StripOffsetsTag

public StripOffsetsTag(int stripsPerImage,
                       short planarConfig,
                       short sampleCount)
Create a new StripOffsets tag.

Parameters:
stripsPerImage - The number of strips per image. Must be at least 1.
planarConfig - The planar config to determine the number of strip planes needed.
sampleCount - The number of samples per pixel.
Method Detail

getTagTypeValue

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

Returns:
The Tag's type.

setValue

public void setValue(int value)
Unused.

Overrides:
setValue in class Tag
Parameters:
value - The value that the tag should contains.
See Also:
getValue

setDataType

public void setDataType(short dataType)
Data type is determined by the value.

Overrides:
setDataType in class Tag
Parameters:
dataType - The data type to set.
See Also:
setDataType

setCount

public void setCount(int count)
Unused, use setCount(int, short, short) instead.

Overrides:
setCount in class Tag
Parameters:
count - The number of values contained in the tag.
See Also:
Tag#setCount(int)}

setCount

public void setCount(long count)
Unused, use setCount(int, short, short) instead.

Overrides:
setCount in class Tag
Parameters:
count - The number of values contained in the tag.
See Also:
Tag#setCount(long)}

setCount

public void setCount(int stripsPerImage,
                     short planarConfig,
                     short sampleCount)
Set the number of strip items.

Parameters:
stripsPerImage - The number of strips per image. Must be at least 1.
planarConfig - The planar config to determine the number of strip planes needed.
sampleCount - The number of samples per pixel.

writeData

public void writeData(Writer wr)
               throws java.io.IOException
The extra data writer, if any extra data exists then this method will be called and (through internal methods) a offset to the data will be used in place of the value parameter.

Specified by:
writeData in class Tag
Parameters:
wr - The writer used to write the extra data.
Throws:
java.io.IOException - If any IO exception occurs.

extraData

protected boolean extraData(boolean big)
This method figures out if any extra data is exists, this method can search the data type, extra data, value, and count. It is called whenever one of these types change.

Specified by:
extraData in class Tag
Parameters:
big - true if the tag is being written to a BigTIFF, false if otherwise.
Returns:
true if the tag contains extra data, false if otherwise.

setupForBigTIFF

protected void setupForBigTIFF(boolean set)
Setup the tag for writing in a BigTIFF.

Specified by:
setupForBigTIFF in class Tag
Parameters:
set - true if the tag should be preped for BigTIFF, false if otherwise.

hasDefault

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

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

isDefault

public boolean isDefault()
Unused.

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

getStripOffset

public long getStripOffset(int strip)
Get the strip offset for a particular strip.

Parameters:
strip - The strip to get the offset of.
Returns:
The offset for that strip.

setStripOffset

public void setStripOffset(int strip,
                           long offset)
Set the strip offset for a particular strip.

Parameters:
strip - The strip to set the offset for.
byteCount - The offset to set for that strip.