jm.jigl
Class SignalOutputStream

java.lang.Object
  |
  +--jm.jigl.SignalOutputStream

public class SignalOutputStream
extends java.lang.Object

SignalOutputStream outputs signals to a file that JIGL can read. To accomadate other programs to display signals, JIGL also support the ".dat" extension. Normally JIGL will automatically detect what type to output (DiscreteSignal, RealSignal, ect.) However in order to output a DAT file, the filename passed to the constuctor MUST have a ".dat" extension. For example you might use the name -- myfile.dat

See Also:
jigl.signal.SignalOutputStream

Field Summary
protected  java.io.BufferedOutputStream data
          Data to dump
protected  int ndims
          Number of dimensions
protected  int X
          Height of the signal
 
Constructor Summary
SignalOutputStream()
          Default SignalOutputStream, does nothing
SignalOutputStream(SignalOutputStream stream)
          Creates an SignalOutputStream from another SignalOutputStream
SignalOutputStream(java.lang.String fn)
          Creates an SignalOutputStream from a filename
 
Method Summary
 void close()
          Closes the file
 int ndims()
          Returns the number of dimensions
 boolean open(java.lang.String fn)
          Opens a file
 void write(DiscreteSignal s)
          Writes a GraySignal to a file
 void write(RealSignal s)
          Writes a RealSignal to a file
 void write(Signal im)
          Writes a JIGL signal to a file
 int X()
          Returns the width
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected java.io.BufferedOutputStream data
Data to dump


ndims

protected int ndims
Number of dimensions


X

protected int X
Height of the signal

Constructor Detail

SignalOutputStream

public SignalOutputStream()
Default SignalOutputStream, does nothing


SignalOutputStream

public SignalOutputStream(java.lang.String fn)
                   throws java.io.IOException
Creates an SignalOutputStream from a filename

Parameters:
fn - filename

SignalOutputStream

public SignalOutputStream(SignalOutputStream stream)
Creates an SignalOutputStream from another SignalOutputStream

Method Detail

ndims

public int ndims()
Returns the number of dimensions


X

public int X()
Returns the width


open

public boolean open(java.lang.String fn)
             throws java.io.IOException
Opens a file

java.io.IOException

close

public void close()
           throws java.io.IOException
Closes the file

java.io.IOException

write

public void write(Signal im)
           throws UnknownSignalTypeException,
                  ColorModelNotSupportedException,
                  ColorModelUnknownException,
                  java.io.IOException
Writes a JIGL signal to a file

Parameters:
im - JIGL signal
UnknownSignalTypeException
ColorModelNotSupportedException
ColorModelUnknownException
java.io.IOException

write

public void write(DiscreteSignal s)
           throws java.io.IOException
Writes a GraySignal to a file

java.io.IOException

write

public void write(RealSignal s)
           throws java.io.IOException
Writes a RealSignal to a file

java.io.IOException