The IDLffMJPEG2000::Commit method shuts down the background processing thread and closes the MJ2 file that is being written. Although the MJ2 file does exist on disk, it cannot be accessed until this method successfully returns.

Note: The same IDLffMJPEG2000 object cannot be used to both write and read an MJ2 file. You can write a file with one object (where WRITE=1), but you must create a separate object (where WRITE=0, the default) in order to play the new MJ2 file.

The Wait argument provides time for the processing thread to finish compressing any images queued in the write frame buffer. The Commit call will return when the frame buffer is empty or when the wait period expires.

Tip: The FRAMES_IN_BUFFER property can be used to determine the current number of frames in the frame buffer.

When writing frames on a component-by-component basis or tile-by-tile basis, the frame must be completed prior to calling Commit. If the last frame being written is not complete (does not have all the needed components and or tiles to make a complete frame) when Commit is called, the method will throw an error and the file will not be closed. This method will throw an error if the commit fails. A CATCH statement can be used to trap these errors.

Syntax


Result = Obj->[IDLffMJPEG2000::]Commit(Wait)

Return Value


The return value indicates the state of the MJ2 file when it was committed to disk:

0

Failure. The file is not usable.

1

Success. The file has been created with all available frames in the frame buffer.

2

Wait period expired before the frame buffer was empty. The file has been created but may not contain all the frames passed in via the IDLffMJPEG2000::SetData method.

Arguments


Wait

A long, positive value specifying the number of milliseconds to wait for the frame buffer to become empty. For example, set the Wait argument to 10,000 in order to wait up to 10 seconds for the background processing thread to finish compressing all the remaining frames in the frame buffer before the Commit method is called. Regardless of the Wait argument, the Commit method will return as soon as the frame buffer is empty. If the wait period expires before all of the frames in the frame buffer can be compressed, the return value will be 2.

Keywords


None

Version History


6.3

Introduced