int QccHYPRawRead2D(QccString
filename, QccIMGImageComponent *image_component, int bpp, int signed_data,
int endian);
int QccHYPRawWrite2D(QccString filename, const QccIMGImageComponent
*image_component, int bpp, int endian);
int QccHYPRawRead3D(QccString
filename, QccIMGImageCube *image_cube, int bpv, int signed_data, int format,
int endian);
int QccHYPRawWrite3D(QccString filename, const QccIMGImageCube
*image_cube, int bpv, int format, int endian);
For 2D files, it is assumed that the pixels are stored in row-major order; i.e., pixels are ordered such that rows are stored one after the other. The loop order for outer to inner is: row, column.
For 3D files, samples (voxels) are stored in one of the following orders:
Note that AVIRIS data is typically BIP, while TRWIS uses BIL. QccPack's ICB format for the QccIMGImageCube(3) structure uses BSQ.
Note that, internally, QccPack refers to spectral bands as "frames" as the QccIMGImageCube(3) structure originally was deployed for video data in which the third dimension represents temporal frames. Thus, routines often refer to num_frames as the size in the third dimension.
QccHYPWrite2D() writes values from image_component to the 2D raw file given by filename. QccHYPWrite3D() operates similarly, writing from the 3D image_cube.
In all of these routines, the parameters bpp (2D files) or bpv (3D files) specify the number of bits that each pixel or voxel value contains, respectively; these values must be between 1 and 32. If bpp or bpv is <= 8, then each sample is stored as the least significant bits in a single byte; otherwise, if bpp or bpv is <= 16, then each sample is stored as the least significant bits of two consecutive bytes; otherwise, if bpp or bpv is <= 32, then each sample is stored as the least significant bits of four consecutive bytes. signed_data indicates whether the sample values are signed or not; likewise, endian, which is one of QCCHYP_RAWENDIAN_BIG or QCCHYP_RAWENDIAN_LITTLE, indicates the endianness of the binary values. For 3D reading and writing, format must be one of QCCHYP_RAWFORMAT_BSQ, QCCHYP_RAWFORMAT_BIL, or QCCHYP_RAWFORMAT_BIP to indicate the scan order of the 3D file.