| synopsis || return value || arguments || prev || next |
virtual int open( jp2_family_src * src, bool return_if_incompatible)
Java: int Open( Jp2_family_src src, boolean return_if_incompatible)
[Declared in "../apps/compressed_io/jpx.h"]
This function is able to open both JP2 and JPX compatible data sources. Note that the most correct suffix to use for JPX files is actually ".jpf", not ".jpx", although the latter is not an unreasonable choice. If the data source is not compatible with either the JPX or JP2 specifications, an error will be generated through kdu_error, unless return_if_incompatible is true.
It is illegal to invoke this function on an object which has previously been opened, but not yet closed.
Three possible values, as follows:
The jp2_family_src object must already have been opened. It should generally support seeking, since non-seekable sources will cause errors to be generated unless the jpx_source is used in a manner which is consistent with linearly reading the data sources from beginning to end — such use is possible for appropriately organized files.
If false, an error will be generated through kdu_error if the data source is found to be incompatible with either the JPX or JP2 specifications. If true, incompatibility will not generate an error, but the function will return -1, leaving the application free to pass the src object to another file format reader (unless the src is not seekable, in which case it must be closed and re-opened before trying a different file format reader).
| top || synopsis || return value || arguments || prev || next |