64 BAND_TYPE_ENCODED = 16,
65 BAND_TYPE_ENCODED_RUNLENGTHS,
75 BANDFILE_ERROR_OKAY = 0,
76 BANDFILE_ERROR_OPEN_FAILED,
77 BANDFILE_ERROR_READ_FAILED,
78 BANDFILE_ERROR_UNKNOWN_HEADER,
79 BANDFILE_ERROR_CREATE_FAILED,
80 BANDFILE_ERROR_WRITE_FAILED,
81 BANDFILE_ERROR_END_OF_DATA,
84 typedef int BANDFILE_ERROR;
95 int ReadFileHeader(
BANDFILE *bandfile);
97 int ReadFrameHeader(
BANDFILE *bandfile);
99 int ReadChannelHeader(
BANDFILE *bandfile);
101 int ReadWaveletHeader(
BANDFILE *bandfile);
103 int ReadBandHeader(
BANDFILE *bandfile);
122 int WriteFrameHeader(
BANDFILE *bandfile,
int frame);
124 int WriteChannelHeader(
BANDFILE *bandfile,
int channel);
126 int WriteWaveletHeader(
BANDFILE *bandfile,
int wavelet);
128 int WriteBandHeader(
BANDFILE *bandfile,
int band,
int type,
int width,
int height,
size_t size);
130 int WriteBandData(
BANDFILE *bandfile,
void *data,
size_t size);
132 int CloseBandFile(
BANDFILE *bandfile);
uint16_t channel
Most recent channel index.
Definition: bandfile.h:28
uint16_t max_band_height
Maximum height of a band in the band file.
Definition: bandfile.h:38
uint16_t height
Height of the most recent band.
Definition: bandfile.h:35
uint16_t type
Data type of the most recent band.
Definition: bandfile.h:31
int FindNextBand(BANDFILE *bandfile)
Find the next band in the band file.
Definition: bandfile.c:144
BAND_TYPE
Data type of the data for a band in the band file.
Definition: bandfile.h:58
uint32_t max_band_size
Maximum size of the bands in the band file.
Definition: bandfile.h:40
Declaration of the band file data structure.
Definition: bandfile.h:24
uint8_t file_header_flag
Has the file header been written?
Definition: bandfile.h:43
uint8_t band_header_flag
Has the band header been written?
Definition: bandfile.h:47
struct _bandfile BANDFILE
Declaration of the band file data structure.
int OpenBandFile(BANDFILE *bandfile, const char *pathname)
Open the band file for reading band data.
Definition: bandfile.c:122
FILE * file
Current open band file.
Definition: bandfile.h:26
uint8_t wavelet_header_flag
Has the wavelet header been written?
Definition: bandfile.h:46
int CreateBandFile(BANDFILE *bandfile, const char *pathname)
Create a band file for storing band data.
Definition: bandfile.c:320
uint32_t size
Size of the most recent band (in bytes)
Definition: bandfile.h:32
uint16_t band
Most recent band index.
Definition: bandfile.h:30
uint8_t padding[3]
Pad the structure to a multiple of four bytes.
Definition: bandfile.h:49
uint16_t width
Width of the most recent band.
Definition: bandfile.h:34
int WriteWaveletBand(BANDFILE *bandfile, int frame, int channel, int wavelet, int band, int type, int width, int height, void *data, size_t size)
Write the band data to the band file.
Definition: bandfile.c:339
int ReadBandData(BANDFILE *bandfile, void *data, size_t size)
Read the data for the next band from the band file.
Definition: bandfile.c:304
uint32_t frame
Most recent frame number.
Definition: bandfile.h:27
uint8_t frame_header_flag
Has the frame header been written?
Definition: bandfile.h:44
uint16_t wavelet
Most recent wavelet index.
Definition: bandfile.h:29
uint8_t channel_header_flag
Has the channel header been written?
Definition: bandfile.h:45
uint16_t max_band_width
Maximum width of a band in the band file.
Definition: bandfile.h:37