| synopsis || return value || prev || next |

kdu_compressed_video_source::open_image

Java: Kdu_compressed_video_source::Open_image

virtual int open_image( )

Java: int Open_image( )

[Declared in "../apps/compressed_io/kdu_video_io.h"]

Go to class description.


Synopsis

Call this function to open the next video image in sequence, providing access to its underlying JPEG2000 code-stream. The sequence of images opened by this function depends upon whether the video is interlaced or progressive, and also on any previous calls to set_field_mode. For progressive video, the function opens each frame in sequence. If the field mode was set to 0 or 1, the function also opens each frame of an interlaced video in sequence, supplying only the first or second field, respectively, of each frame. If the video is interlaced and the field mode was set to 2, the function opens each field of each frame in turn, so that the frame index advances only on every second call to this function.

After calling this function, the present object may be passed into kdu_codestream::create for parsing and, optionally, decompression of the image's code-stream. Once the kdu_codestream object is done (destroyed or re-created), the close_image function may be called to prepare the object for opening a subsequent image.


Return Value

The frame index associated with the open image, or -1 if no further images can be opened. Note that the frame index advances only once every two calls to this function, if the video is interlaced and the field mode (see set_field_mode) is 2. Note also, that seek_to_frame might be able to re-position the frame pointer before opening an image.


| top || synopsis || return value || prev || next |