com.bruxton.sidx
Class Acquisition

java.lang.Object
  extended by com.bruxton.sidx.Acquisition

public class Acquisition
extends java.lang.Object

Responsible for managing the acquisition. Each instance of Camera owns one instance of the class. The user of SIDX should not create the object. It should be obtained by using getAcquisition function of Camera object.


Method Summary
 void abort()
          Terminate the acquisition requested before it completes.
 void beginContinuous()
          Prepare for the continuous mode acquisition and the oldest unretrieved frames will be returned in sequence.
 void beginFocus()
          Prepare for the continuous mode acquisition and the most recent frame available in the buffer will be returned.
 void beginScript(java.lang.String script)
          Prepare the acquisition for using script.
 void beginSequence(int frames_per_sequence)
          Prepare for the acquisition of a sequence of frames.
 void end()
          Clean up the acquisition.
 void finish()
          Finish the acquisition requested.
 int framesAvailable()
          Report the number of frames acquired.
 int getNextImages(int frame_count, int roi, Frame[] frames)
          Read the next frames from the acquisition buffer.
 int getSize()
          Return the size in bytes of a single frame.
 int getX()
          Return the x dimension in pixels of the frame.
 int getY()
          Return the y dimension in pixels of the frame.
 void start()
          Start the acquisition requested.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

beginSequence

public void beginSequence(int frames_per_sequence)
                   throws Exception
Prepare for the acquisition of a sequence of frames.

Parameters:
frames_per_sequence - the number of frames to acquire between each call to start and finish.
Throws:
Exception

end

public void end()
Clean up the acquisition. This should be the last call to make after all the other functions in the class. There should not be any changes in settings between the begin acquisition calls (i.e. beginSequence, beginScript, beginContinuous and beginFocus) and this function.

Throws:
Exception

beginScript

public void beginScript(java.lang.String script)
                 throws Exception
Prepare the acquisition for using script. Acquisition using script can only operate in sequential mode. Depending on the type of the camera, this feature may/may not be supported.

Parameters:
script - the script as String.
Throws:
Exception

beginContinuous

public void beginContinuous()
                     throws Exception
Prepare for the continuous mode acquisition and the oldest unretrieved frames will be returned in sequence. The application will be able to retrieve every frame the camera acquired. Depending on the type of the camera, this feature may/may not be supported. Once the continous readout started by calling start, it will not stop until finish or abort is called.

Throws:
Exception

beginFocus

public void beginFocus()
                throws Exception
Prepare for the continuous mode acquisition and the most recent frame available in the buffer will be returned. Depending on the type of the camera, this feature may/may not be supported. Once the continous readout started by calling start, it will not stop until finish or abort is called.

Throws:
Exception

framesAvailable

public int framesAvailable()
                    throws Exception
Report the number of frames acquired. The frames retrieved by using getNextImages are dropped out as being available.

Returns:
the acquired and not read frame count.
Throws:
Exception

getSize

public int getSize()
            throws Exception
Return the size in bytes of a single frame. All frames acquired in a sequence are the same size. With size information from the function, the application can allocate the memory and retrieve the frame (or portion of the frame depending on if a ROI is specified) from the acquisition buffer.

Returns:
the size in bytes of a single frame.
Throws:
Exception

getX

public int getX()
         throws Exception
Return the x dimension in pixels of the frame.

Returns:
the x dimension in pixels of the frame.
Throws:
Exception

getY

public int getY()
         throws Exception
Return the y dimension in pixels of the frame.

Returns:
the y dimension in pixels of the frame.
Throws:
Exception

getNextImages

public int getNextImages(int frame_count,
                         int roi,
                         Frame[] frames)
                  throws Exception
Read the next frames from the acquisition buffer. In the sequential acquisition mode (started by beginSequence), the function returns the frames in sequence out of the sequence of frames acquired. In the continuous mode (started by beginContinuous), the function returns the oldest unretrieved frames in sequence. In the focus mode (started by beginFocus), the function returns the latest unretrieved frame.

Parameters:
frame_count - the index of the frame to retrieve.
roi - the index of the roi within the frame to retrieve starting from zero.
frames - return the data for the requested frames.
Returns:
the actual returned frame count.
Throws:
Exception

start

public void start()
           throws Exception
Start the acquisition requested. If the acquisition settings do not have to be changed, the acquisition of multiple sequences can happen between beginSequence or beginScript or beginFocus or beginContinuous and end.

Throws:
Exception

finish

public void finish()
Finish the acquisition requested. The function should be called after a normal completion of an acquisition.

Throws:
Exception

abort

public void abort()
Terminate the acquisition requested before it completes.

Throws:
Exception