X-Git-Url: https://cads.iiap.res.in/gitview/?p=fits2jpeg.git;a=blobdiff_plain;f=src%2Fmessages.c;fp=src%2Fmessages.c;h=ed4063ef1d81ff02d9937d5c969eb25d3c51e93c;hp=0000000000000000000000000000000000000000;hb=43cf6bddbf02b21c68b405e267605b1b64cddd8d;hpb=e9b7faa7d8a84a6a7f0e1b65c8859b7405568890 diff --git a/src/messages.c b/src/messages.c new file mode 100644 index 0000000..ed4063e --- /dev/null +++ b/src/messages.c @@ -0,0 +1,99 @@ +/*************************************************************************** + * This file is a part of CADS/UVS fits2jpeg conversion software * + * Copyright (C) 2012 by CADS/UV Software Team, * + * Indian Institute of Astrophysics * + * Bangalore 560034 * + * cads_AT_iiap.res.in * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +/*Header Definitions*/ +#include "fits2jpeg.h" + +/*---------------------------------------------------------------------------*/ +void banner() +{ + printf("\n"); + printf(" %s %s\n", PROGRAM, VERSION); + printf(" Converts fits image files to jpeg\n"); + printf("-----------------------------------------------------------\n"); +} +/*---------------------------------------------------------------------------*/ +void usage() +{ + printf ("\n Usage: fits2jpeg [options] \n"); + printf (" Name of fits image file is mandatory.\n"); + printf (" Optional parameters are listed below: \n\n"); + printf (" -h help \n"); + printf (" Print this help message and exit \n\n"); + printf (" -s \n"); + printf (" scale for output image, where can be: \n"); + printf (" linear Linear scale, default \n"); + printf (" sqroot for square root scale \n"); + printf (" square for quadratic scale \n"); + printf (" cubic for cubic scale \n"); + printf (" log for log scale \n"); + printf (" normalize for linear histogram stretch \n"); + printf (" equalize for histogram equalization \n\n"); + printf (" -n \n"); + printf (" Negate the image \n\n"); + printf (" -q \n"); + printf (" quality factor. Defines the jpeg encoding quality \n"); + printf (" Valid range: 0-100, default value: 100 (max.quality)\n\n"); + printf (" -d \n"); + printf (" Write jpeg file to this specified directory. Will \n"); + printf (" create it if needed. Default is to write jpeg in the\n"); + printf (" same directory as fits image file \n\n"); + printf (" -r : \n"); + printf (" Clip output image to min-max range. Eg: \n"); + printf (" 0:100 Use only values in the range 0-100 \n"); + printf (" 100:0 Same as above, but negative image \n"); + printf (" :10 Clip everything above 10 \n"); + printf (" 10: Clip everything below 10 \n\n"); + printf (" -z \n"); + printf (" Resize/Scale output image by . Eg: \n"); + printf (" 0.5 Shrink output to half of input \n"); + printf (" 2.0 Magnify output to double the size \n"); + printf (" Allowed range: 0.01 to 4.0 \n"); + printf (" NOTE: Zooming will be carried out after all other \n"); + printf (" operations, before writing out jpeg image \n\n"); + printf (" Output will be written to .jpg. Wild card\n"); + printf (" entries allowed in ; For eg: *.fits, m31*.fits\n"); + printf (" ngc???.fits etc. \n"); + printf ("-----------------------------------------------------------\n"); + printf ("Copyright (c) 2012 The CADS Team, IIAp. [GPL v3.0 or later]\n"); + printf ("Report Bugs to: http://cads.iiap.res.in/bugzilla \n"); + printf ("Documentation : http://cads.iiap.res.in/software \n\n"); + exit(1); +} + +void printinfo(const char * msg) +{ + fprintf(stdout, "INFO : %s\n", msg); +} + +void printwarn(const char * msg) +{ + fprintf(stdout, "WARNING: %s\n", msg); +} + +void printerro(const char * msg) +{ + fprintf(stderr, "ERROR : %s\n", msg); + exit(EXIT_FAILURE); +} +