c_eopenr - Opens an image file for random access
SYNTAX
#include "las.h"
FUNCTION c_eopenr (fdesc, fname, nbands, sl, ss, nl, ns, acc, dtype, opt, nline)
int *fdesc;
char *fname;
long *nbands;
long *sl;
long *ss;
long *nl;
long *ns;
long *acc;
long *dtype;
long opt[];
long *nline;
PARAMETERS
fdesc (output, integer)
File descriptor to be used internally by the image I/O subroutines. The calling routine should
pass by reference an integer of the machine's word size. From C this is an int.
fname (input, character string, length(CMLEN))
Host name of the image file to be opened.
nbands (input/output, integer)
The number of bands for the file. If the file is being read and nbands = 0 (zero), the actual
number of bands will be returned in this parameter.
sl (input, integer)
The starting line for the image to be processed.
ss (input, integer)
The starting sample for the image to be processed.
nl (input/output, integer)
The number of lines. If the file is being read and nl = 0, the number of lines in the image file is
specified and returned.
ns (input/output, integer)
Specifies the number of samples. If the file is being read and ns = 0, the number of samples in
the image file is specified and returned.
acc (input, integer)
Specifies whether the file is to be opened for:
= IREAD (0): Read access
= IWRITE (1): Write access
= IUPDATE (2): Read/write access
dtype (input/output, integer)
Data type. Allowable data types are:
= EBYTE (1): unsigned byte data
= EWORD (2): signed two byte data
= ELONG (3): signed four byte data>
= EREAL (4): four byte floating point data
If acc = IREAD or IUPDATE, dtype specifies the data type of the file that the calling program would like to see. If this data type is not the same as that of the actual file, then upon reading, the data will be converted to this data type before being placed in the user's buffer. If dtype = 0 (zero), the actual data type of the image file is specified and returned.
If acc = IWRITE, dtype specifies the data type of the input. The default is the same for the
output if conversion is required (see opt).
opt (input, integer array)
This array is used for optional parameters not normally used by the applications. A typical
application should simply pass an array of 0's (zero's) for this parameter. However, if data conversion is needed on write, the first element of the opt
array should be filled with the appropriate data type to be written to
the file. The dtype parameter is used as the data type seen by the
application. When acc = IWRITE, the second element of the opt array is used if the program
must override the value of the LAS global $COMPFLG for image compression. The last element of the
opt array should be 0 (zero), indicating that no further options will
be needed by this program.
Allowable values for the image compression option are:
= COMPRES (5): Turn on image compression
= NO_COMPRES (6): Turn off image compression
nline (input, integer)
Specifies the maximum number of lines that will be read/written at one time.
DESCRIPTION
The c_eopenr() call is used to open an image file and initialize for reading or writing, for random
access, and data conversion. c_eopenr() also allows the user to window the file.
RETURN VALUE
c_eopenr() returns
E_SUCC (0) --> success
E_FAIL (-1) --> failure