"Fossies" - the Fresh Open Source Software Archive

Member "gnuastro-0.9/bin/crop/main.c" (2 Jan 2019, 1587 Bytes) of package /linux/privat/gnuastro-0.9.tar.lz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "main.c" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 0.8_vs_0.9.

    1 /*********************************************************************
    2 Crop - Crop a given size from one or multiple images.
    3 Crop is part of GNU Astronomy Utilities (Gnuastro) package.
    4 
    5 Original author:
    6      Mohammad Akhlaghi <mohammad@akhlaghi.org>
    7 Contributing author(s):
    8 Copyright (C) 2015-2019, Free Software Foundation, Inc.
    9 
   10 Gnuastro is free software: you can redistribute it and/or modify it
   11 under the terms of the GNU General Public License as published by the
   12 Free Software Foundation, either version 3 of the License, or (at your
   13 option) any later version.
   14 
   15 Gnuastro is distributed in the hope that it will be useful, but
   16 WITHOUT ANY WARRANTY; without even the implied warranty of
   17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   18 General Public License for more details.
   19 
   20 You should have received a copy of the GNU General Public License
   21 along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
   22 **********************************************************************/
   23 #include <config.h>
   24 
   25 #include <stdio.h>
   26 #include <stdlib.h>
   27 
   28 #include <gnuastro-internal/timing.h>
   29 
   30 #include "main.h"
   31 
   32 #include "ui.h"
   33 #include "crop.h"
   34 #include "onecrop.h"
   35 
   36 int
   37 main (int argc, char *argv[])
   38 {
   39   struct timeval t1;
   40   struct cropparams p={{{0},0},0};
   41 
   42   /* Set the starting time.*/
   43   time(&p.rawtime);
   44   gettimeofday(&t1, NULL);
   45 
   46   /* Read the input parameters. */
   47   ui_read_check_inputs_setup(argc, argv, &p);
   48 
   49   /* Run Image Crop */
   50   crop(&p);
   51 
   52   /* Free all non-freed allocations. */
   53   ui_free_report(&p, &t1);
   54 
   55   /* Return successfully.*/
   56   return EXIT_SUCCESS;
   57 }