/*
 * SUMMARY:      InBasin.c - Check whether a pixel is in the basin or area
 * USAGE:        Part of DHSVM
 *
 * AUTHOR:       Bart Nijssen
 * ORG:          University of Washington, Department of Civil Engineering
 * E-MAIL:       nijssen@u.washington.edu
 * ORIG-DATE:    Apr-96
 * Last Change: Wed Jan 27 23:01:21 1999 by Bart Nijssen <nijssen@u.washington.edu>
 * DESCRIPTION:  Check whether a pixel is in the basin or area
 * DESCRIP-END.
 * FUNCTIONS:    InBasin()
 *               InArea()
 * COMMENTS:     
 */

#ifndef lint
static char vcid[] = "$Id: InBasin.c,v 1.2 2001/03/31 00:10:25 waichler Exp $";
#endif /* lint */

#include <stdio.h>
#include <stdlib.h>
#include "constants.h"
#include "settings.h"
#include "data.h"

/*****************************************************************************
  InBasin()
*****************************************************************************/
uchar InBasin(uchar MaskValue)
{
  return (uchar) (MaskValue != OUTSIDEBASIN);
}

/*****************************************************************************
  InArea()
*****************************************************************************/
uchar InArea(MAPSIZE *Map, COORD *Loc)
{
  if (Loc->N < 0 || Loc->N > (Map->NY-1))
    return FALSE;
  else if (Loc->E < 0 || Loc->E > (Map->NX-1))
    return FALSE;
  else
    return TRUE;
}

