1 /***************************************************************************
2 * This file is a part of CADS/UVS fits2jpeg conversion software *
3 * Copyright (C) 2012 by CADS/UV Software Team, *
4 * Indian Institute of Astrophysics *
5 * Bangalore 560034 *
6 * cads_AT_iiap.res.in *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22 ***************************************************************************/
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
28 /*Header Definitions*/
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <string.h>
32 #include <float.h>
33 #include <ctype.h>
34 #include <math.h>
35 #include <errno.h>
36 #include <libgen.h>
37 #include <dirent.h>
38 #include <unistd.h>
39 #include <fitsio2.h>
40 #include <jpeglib.h>
41 #include <sys/stat.h>
42 #include <sys/types.h>
44 #define PROGRAM "fits2jpeg"
45 #define r2d (90./atan2(1,0))
46 #define MAX_TEXT 1024
48 int my_getopt(int, char * const *, const char *);
49 int make_dir(char *, mode_t);
50 int make_tree(char *, mode_t);
51 void banner(void);
52 void usage(void);
53 void signals_handler(int);
54 void set_signals(void);
55 void printinfo(const char *);
56 void printwarn(const char *);
57 void printerro(const char *);
58 void read_fits(char *, long *, long *, float **);
59 void scale_pixels(int, unsigned int, float *, JSAMPLE **);
60 void resize_image(long *, long *, float, JSAMPLE **);
61 char *strdup(const char *);