#include "las.h" #include "util.h"int c_check_window
( struct DDR *ddr, double inwind[], long vlwind[] )
Pointer to a DDR structure. The number of lines and number of samples are used from the structure.
Defines the input window that is to be checked. The four elements of the window are SL, SS, NL and NS.
Defines the output window with window values that have been checked and are valid.
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 failedThe 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.