c_check_window - Validate an image window using a DDR structure

SYNTAX

#include "las.h"
#include "util.h"

int c_check_window

(
     struct DDR         *ddr,
     double             inwind[],
     long               vlwind[]
)

PARAMETERS

ddr (input, DDR)

Pointer to a DDR structure. The number of lines and number of samples are used from the structure.

inwind (input, double, length (4))

Defines the input window that is to be checked. The four elements of the window are SL, SS, NL and NS.

vlwind (output, long, length (4))

Defines the output window with window values that have been checked and are valid.

DESCRIPTION

The c_check_window() routine is used to check an input window. 

If an input window is (0 0 0 0), meaning it is not specified, then the starting
line and starting sample are set to 1 and number of lines and samples are
set to the input DDR. It also checks the starting line and starting sample
to make sure it is positive. 

This routine also makes sure the starting line is not greater than the number 
of lines and the starting sample is not greater than the number of samples.  
If the starting lines and number of lines or the starting sample and number of 
samples places the window outside of the image, then the starting line 
(or sample) is reset to 1 and the number of lines (or samples) is reset to the 
number of lines (or samples) input ddr.

RETURN VALUE

c_check_window() returns

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

The routine c_wndchk() does the same window validation as c_check_window except that it uses an existing DDR file instead of a DDR structure.