Routines (alphabetical) > Object Classes > File Format Object Classes > IDLffMJPEG2000::Init

# IDLffMJPEG2000::Init

Syntax | Return Value | Arguments | Keywords | Version History

The IDLffMJPEG::Init method initializes an IDLffMJPEG2000 object. When WRITE is not set or set equal to 0 (the default), the newly created Motion JPEG2000 object can be used to read (decode) frame data from a Motion JPEG2000 (MJ2) frame file. When WRITE is set or equal to one, the object can be used to create (encode) frame data to a Motion JPEG2000 file.

Note: When reading an MJ2 file that contains tiled data, you must set the PERSISTENT keyword to true in order to access tiles of data from an MJ2 file.

## Syntax

Obj = OBJ_NEW( 'IDLffMJPEG2000', Filename [, /PERSISTENT][, PROPERTY=value] )

or

Result = Obj->[IDLffMJPEG2000::]Init( Filename [, /PERSISTENT] [, PROPERTY=value] ) (In a lifecycle method only.)

## Return Value

When this method is called indirectly, as part of the call to the OBJ_NEW function, the return value is an object reference to the newly-created object.

When called directly within a subclass Init method, the return value is 1 if initialization was successful, or zero otherwise.

## Arguments

### Filename

A string value that specifies the full path and name of the file associated with the MJ2 file being read or written, based on the WRITE property value as follows:

WRITE = 0 | The file is opened for reading and cannot be modified.
WRITE = 1 | The file is opened for writing. If an existing filename is given, the file contents will be overwritten without prompting.

Motion JPEG2000 files typically have a .`mj2` extension, which is recognized by Motion JPEG2000 players. However, this object does not restrict or set the file extension, so it will reflect the value set in this Filename argument.

## Keywords

In addition to the following keyword, any property listed under IDLffMJPEG2000 Properties that contains the word “Yes” in the “Init” column of the properties table can be initialized during object creation using this method. To initialize the value of a property, specify the property name as a keyword set equal to the appropriate property value.

### PERSISTENT

A Boolean value that specifies whether or not data can be accessed more than a single time as follows:

0 | Do not persist data. Minimize memory usage and limit certain types of data access to a single time. The default.
1 | Persist data. Allow access to data multiple times and do not minimize memory usage. You must set PERSISTENT to 1 if you want to access tiles from an MJ2 file.

The default value is 0.

## Version History

6.3 | Introduced