c_pxconv - Converts from one data type to another

SYNTAX

#include "worgen.h"
#include "pixman.h"
FUNCTION c_pxconv (ftyp, totyp, frombuf, tobuf, size)

     long               *ftyp;
     long               *totyp;
     unsigned char      *frombuf;
     unsigned char      *tobuf;
     long               *size;

PARAMETERS

ftyp (input, integer)

An integer representing the data type of the source buffer. Legal values include:

     = EBYTE(1):     unsigned byte data
     = EWORD(2):     signed two byte data
     = ELONG(3):     signed four byte data
     = EREAL(4):     four byte floating point data

totyp (input, integer)

An integer representing the data type of the destination buffer. Legal values are the same as above.

frombuf (input, 'ftyp')

The source buffer of the data to be converted; this data is of type ftyp.

tobuf (output, 'totyp')

The destination buffer of the converted data; this data will be of type totyp.

size (input, integer)

The number of pixels to be converted.

DESCRIPTION

The c_pxconv() call is used to convert size pixels of type ftyp to totyp. If the two data types are the same, c_pxcopy() is called.

RETURN VALUE

c_pxconv() returns

     E_SUCC  -->  successful completion
     TOOBIG  -->  exceeded upper limit of data type
     TOOSMALL-->  exceeded lower limit of data type