c_pxdiv - Divides one input array by another input array

SYNTAX

#include "worgen.h"

FUNCTION c_pxdiv (ns, in1, in2, out, scale, offset, dtype, errval)

     long                  *ns;
     unsigned char         *in1;
     unsigned char         *in2;
     unsigned char         *out;
     float                 *scale;
     float                 *offset;
     long                  *dtype;
     long                  *errval;

PARAMETERS

ns (input, integer)

The number of the samples to be processed.

in1 (input, 'dtype')

An array of pixel values to be divided (numerator).

in2 (input, 'dtype')

An array of divisor pixel values (denominator).

out (output, 'dtype')

An array created by dividing, scaling, and offsetting the two input arrays.

     out = (in1 / in2) x scale  +  offset

scale (input, real)

The scale factor to be applied after division.

offset (input, real)

The offset to be applied after division.

dtype (input, integer)

An integer value that represents the type of data of the input and output arrays. Legal values include:

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

errval (input, 'dtype')

An integer value to be placed in the output array at all locations where a divide by zero was attempted.

DESCRIPTION

The c_pxdiv() call is used to create an output array by dividing, scaling, and offsetting ns pixel values of two input pixel arrays in1 and in2 of type dtype.

RETURN VALUE

c_pxdiv() returns

     E_SUCC  -->  successful completion
     TOOBIG  -->  exceeded upper limit of data type
     TOOSMALL-->  exceeded lower limit of data type
     TYPERR  -->  invalid data type specified
     DIVZERO -->  divide by zero