Functions for run length encoding


Functions

int rlenc_from_file (char *infile, int nrows, int ncols, varfl **vals, int *nvals, int depth)
 Runlength-encodes a radar image from a file to an array.
int rlenc_from_mem (unsigned short *img, int nrows, int ncols, varfl **vals, int *nvals)
 This function encodes a radar image to BUFR runlength-code.
int rlenc_compress_line_new (int line, unsigned int *src, int ncols, varfl **dvals, int *nvals)
 Encodes one line of a radar image to BUFR runlength-code.

Function Documentation

int rlenc_from_file ( char *  infile,
int  nrows,
int  ncols,
varfl **  vals,
int *  nvals,
int  depth 
)

This function encodes a radar image file with depth bytes per pixel to BUFR runlength-code and stores the resulting values into an array vals by a call to bufr_val_to_array.

Currently depth can be one or two bytes per pixel. In case of two bytes per pixel data is read in "High byte - low byte order". So pixel values 256 257 32000 are represented by 0100 0101 7D00 hex.

Note:
In difference to the old rlenc function the initial length of vals must be given in the parameter nvals in order to prevent bufr_val_to_array from writing to an arbitrary position.
Parameters:
[in] infile File holding the radar image.
[in] ncols Number of columns of the image.
[in] nrows Number of rows of the image.
[in] depth Image depth in bytes
[in,out] vals Float-array holding the coded image.
[in,out] nvals Number of values in VALS.
Returns:
The return-value ist 1 on success, 0 on a fault.
See also:
rlenc_from_mem, rldec_to_file, rlenc_compress_line_new

Definition at line 374 of file rlenc.c.

int rlenc_from_mem ( unsigned short *  img,
int  nrows,
int  ncols,
varfl **  vals,
int *  nvals 
)

This function encodes a radar image in memory to BUFR runlength-code and stores the resulting values into an array vals by a call to bufr_val_to_array.

Note:
In difference to the old rlenc function the initial length of vals must given in the parameter nvals in order to prevent bufr_val_to_array from writing to an arbitrary position.
Parameters:
[in] img Array holding the uncompressed radar image.
[in] ncols Number of columns of the image.
[in] nrows Number of rows of the image.
[in,out] vals Float-array holding the coded image.
[in,out] nvals Number of values in vals.
Returns:
The return-value ist 1 on success, 0 on a fault.
See also:
rlenc_from_file, rldec_to_mem, rlenc_compress_line_new
Examples:
apisample.c.

Definition at line 588 of file rlenc.c.

int rlenc_compress_line_new ( int  line,
unsigned int *  src,
int  ncols,
varfl **  dvals,
int *  nvals 
)

This function encodes one line of a radar image to BUFR runlength-code and stores the resulting values to array dvals by a call to bufr_val_to_array.

Note:
In difference to the old rlenc_compress_line function the initial length of vals must given in the parameter nvals in order to prevent bufr_val_to_array from writing to an arbitrary position.
Parameters:
[in] line Line number.
[in] src Is where the uncompressed line is stored.
[in] ncols Number of pixels per line.
[in,out] dvals Float-array holding the coded image.
[in,out] nvals Number of values in VALS.
Returns:
The function returns 1 on success, 0 on a fault.
See also:
rldec_decompress_line

Definition at line 746 of file rlenc.c.


Generated on Tue Dec 18 16:52:45 2007 for OPERA BUFR software by  doxygen 1.5.4