00001 /* $Id: xsh_hist.h,v 1.3 2011/12/02 14:15:28 amodigli Exp $ 00002 * 00003 * This file is part of the irplib package 00004 * Copyright (C) 2002, 2003 European Southern Observatory 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA 00019 */ 00020 00021 /* 00022 * $Author: amodigli $ 00023 * $Date: 2011/12/02 14:15:28 $ 00024 * $Revision: 1.3 $ 00025 * $Name: HEAD $ 00026 */ 00027 00028 #ifndef XSH_HIST_H 00029 #define XSH_HIST_H 00030 00031 #include <cpl.h> 00032 00033 typedef struct _xsh_hist_ xsh_hist; 00034 00035 /* Creation/Destruction functions */ 00036 00037 xsh_hist * 00038 xsh_hist_new(void); 00039 00040 void 00041 xsh_hist_delete(xsh_hist *); 00042 00043 /* Initialisation function */ 00044 00045 cpl_error_code 00046 xsh_hist_init(xsh_hist *, 00047 unsigned long , 00048 double , 00049 double ); 00050 00051 /* Accessor functions */ 00052 00053 unsigned long 00054 xsh_hist_get_value(const xsh_hist *, 00055 const unsigned long); 00056 00057 unsigned long 00058 xsh_hist_get_nbins(const xsh_hist *); 00059 00060 double 00061 xsh_hist_get_bin_size(const xsh_hist *); 00062 00063 double 00064 xsh_hist_get_range(const xsh_hist *); 00065 00066 double 00067 xsh_hist_get_start(const xsh_hist *); 00068 00069 /* Histogram computing function */ 00070 00071 cpl_error_code 00072 xsh_hist_fill(xsh_hist *, 00073 const cpl_image *); 00074 00075 /* Statistics functions */ 00076 00077 unsigned long 00078 xsh_hist_get_max(const xsh_hist *, 00079 unsigned long *); 00080 00081 /* Casting function */ 00082 00083 cpl_table * 00084 xsh_hist_cast_table(const xsh_hist *); 00085 00086 /* Functions for operations on histograms */ 00087 00088 cpl_error_code 00089 xsh_hist_collapse(xsh_hist *, 00090 unsigned long); 00091 00092 #endif /* IRPLIB_HIST_H */ 00093