/********************************************************************\
|*	Copyright © 1998-99 RasSimTech Ltd.		                    	*|
|*	Printed in the United States of America.                       	*|
|*	All rights reserved.                                           	*|
|*	                                                               	*|
|*	This product or document is protected by copyright and         	*|
|*	distributed under licenses restricting its use,                	*|
|*	copyrightand distribution under licenses restricting           	*|
|*	its use, copying, distribution and decompilation.              	*|
|*	                                                               	*|
|*	No part of this product or document may be reproduced in       	*|
|*	any form by any means without prior written authorization of   	*|
|*	RasSimTech Ltd.							                     	*|
|*	                                                               	*|
\********************************************************************/

#define PROGRAM_NAME		"AVDS2BMP"

#include <stdio.h>
#include <stdlib.h>

#include <atl.h>


int
main(int argc,char*argv[])
{
	double long_00, lat_00, long_0c, lat_0c, long_r0, lat_r0, long_rc, lat_rc;
	double long_min, long_max, lat_min, lat_max;
	int iFlags= ATL_COLOR8;	


	if ( argc != 6 ) {
		fprintf(stderr,"\n usage: %s long_min long_max lat_min lat_max Outfilename \n",argv[0]);
		return(-1);
	}

	long_min = atof(argv[1]);
	long_max = atof(argv[2]);
	lat_min  = atof(argv[3]);
	lat_max  = atof(argv[4]);

	fprintf(stderr,"long_min = %f \n",long_min);
	fprintf(stderr,"long_max = %f \n",long_max);
	fprintf(stderr,"lat_min = %f \n",lat_min);
	fprintf(stderr,"lat_max = %f \n",lat_max);

	long_00 = long_min;
	lat_00  = lat_min;
	long_0c = long_max;
	lat_0c  = lat_min;
	long_r0 = long_min;
	lat_r0  = lat_max;
	long_rc = long_max;
	lat_rc  = lat_max;

	printf("\n*** Processing Bitmap ***\n\n");
 
	if (atl_rasterfile(long_00, lat_00, long_0c, lat_0c,
	  long_r0, lat_r0, long_rc, lat_rc, argv[5], iFlags) == -1)  {
		fprintf(stderr, "%s: errors encountered while Processing Bitmap\n", PROGRAM_NAME);
		return(-1);
	}
	return(0);
}

