c_w2dltf - Writes the second type of DLTF record to an associate DLTF

SYNTAX

#include "worgen.h"
#include "vll.h"
#include "dltf.h"
FUNCTION c_w2dltf (fd, type, key, slope, offset, startpt, endpt, lutnum, lutdata)

     long               *fd;
     char               *type;
     char               *key;
     double             *slope;
     double             *offset;
     long               *startpt;
     long               *endpt;
     long               *lutnum;
     unsigned char      *lutdata;

PARAMETERS

fd (input, integer)

File descriptor of an opened DLTF file. The file descriptor is set in c_ckdltf() and should not be altered.

type (input, character, length (3))

String containing the data type of the LUT(s). This can be either B or I2 for BYTE or I*2, respectively.

key (input, character, length (13))

DLTF entry name. Note that the length of the key is limited to twelve characters even though the file format allows sixteen. This is because LUT numbers are appended to the key value to form the names of the second type of DLTF records. Thus, the twelve characters with the maximum appended three characters plus one for the null become the sixteen character maximum allowed in the key field of label services.

slope (input, double)

Slope of the LUT. The slope of the LUT in the DLTF entry. This value is used in conjunction with the offset to expand LUTs saved as BYTE to their full I*2 range using inverse scaling and interpolation.

offset (output, double)

Offset of the LUT. The offset of the LUT in the DLTF entry. This value is used in conjunction with the slope to expand LUTs saved as BYTE to their full I*2 range using inverse scaling and interpolation.

startpt (input, integer)

Starting point of the LUT. This value corresponds to the first entry in the LUT data.

endpt (input, integer)

Ending point of the LUT. This value corresponds to the last entry in the LUT data.

lutnum (input, integer)

The LUT number within the DLTF entry. The number of the LUT within a DLTF entry to be saved. The values of lutnum range from 1 to 256 and are used to form a name for the LUT within a DLTF entry.

lutdata (input, unsigned character, length (variable))

Buffer that contains the data portion of the DLTF entry. The length of this field is dependent on the data type and range ((starting point ending point) + 1) of the LUT to be saved.

DESCRIPTION

The c_w2dltf() routine writes the second type of DLTF entry record to a DLTF. The function receives the necessary DLTF fields as parameters and stores them in an associate DLTF.

RETURN VALUE

c_w2dltf() returns

     E_SUCC (0)  --> successful completion 
     E_FAIL (-1) --> operation failed