net.aerith.misao.image.io
Class Sbig

java.lang.Object
  |
  +--net.aerith.misao.image.io.Format
        |
        +--net.aerith.misao.image.io.Sbig

public class Sbig
extends Format

The Sbig is a class to read and save SBIG file. It is just an access interface to SBIG file.


Inner Class Summary
protected  class Sbig.Header
          The Header is a set of the hash table of SBIG header keys and the flag whether if the image is compressed or not.
 
Field Summary
protected static int READ_DIFFERENCE
          The number which represents the next one byte show the difference of the pixel value.
protected static int READ_VALUE
          The number which represents the next two bytes show the pixel value.
 
Fields inherited from class net.aerith.misao.image.io.Format
url
 
Constructor Summary
Sbig(java.net.URL url)
          Constructs a Sbig with URL.
 
Method Summary
 java.lang.String getName()
          Gets the name of the image format.
 MonoImage read()
          Reads SBIG file and creates image buffer.
private  Sbig.Header readHeader(java.io.DataInput input)
          Reads header of SBIG file and creates a hash table.
 void save(MonoImage image)
          Saves image buffer into a SBIG file.
 
Methods inherited from class net.aerith.misao.image.io.Format
create, create, getTruncatedFilename, isFits, setURL
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

READ_VALUE

protected static final int READ_VALUE
The number which represents the next two bytes show the pixel value.

READ_DIFFERENCE

protected static final int READ_DIFFERENCE
The number which represents the next one byte show the difference of the pixel value.
Constructor Detail

Sbig

public Sbig(java.net.URL url)
Constructs a Sbig with URL.
Parameters:
url - the URL of the SBIG file.
Method Detail

getName

public java.lang.String getName()
Gets the name of the image format.
Overrides:
getName in class Format
Returns:
the name of the image format.

read

public MonoImage read()
               throws java.io.IOException,
                      UnsupportedBufferTypeException,
                      UnsupportedFileTypeException
Reads SBIG file and creates image buffer. The url of the SBIG file must be set previously.
Overrides:
read in class Format
Returns:
the monochrome image buffer.
Throws:
java.io.IOException - if I/O error occurs.
UnsupportedBufferTypeException - if the data type is unsupported.
UnsupportedFileTypeException - if the file type is unsupported.

readHeader

private Sbig.Header readHeader(java.io.DataInput input)
                        throws java.io.IOException
Reads header of SBIG file and creates a hash table.
Parameters:
input - the stream for data input.
Returns:
a hash table of SBIG header keys.
Throws:
java.io.IOException - if I/O error occurs.

save

public void save(MonoImage image)
          throws java.io.IOException,
                 UnsupportedBufferTypeException,
                 UnsupportedFileTypeException
Saves image buffer into a SBIG file. The url of the SBIG file must be set previously.
Overrides:
save in class Format
Parameters:
image - the monochrome image buffer to save.
Throws:
java.io.IOException - if I/O error occurs.
UnsupportedBufferTypeException - if the data type is unsupported.
UnsupportedFileTypeException - if the file type is unsupported.