CR2RE Pipeline Reference Manual 1.6.7
hdrl_mode.h
1/*
2 * hdrl_mode.h
3 *
4 * Created on: Mar 1, 2021
5 * Author: agabasch
6 */
7
8/*
9 * This file is part of the HDRL
10 * Copyright (C) 2021 European Southern Observatory
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 */
26
27#ifndef HDRL_MODE_H
28#define HDRL_MODE_H
29
30
31/*-----------------------------------------------------------------------------
32 Include
33 -----------------------------------------------------------------------------*/
34
35#include "hdrl_mode_defs.h"
36#include "hdrl_parameter.h"
37#include <cpl.h>
38
39CPL_BEGIN_DECLS
40
41
42/*-----------------------------------------------------------------------------
43 Define
44 -----------------------------------------------------------------------------*/
45
46
47/*-----------------------------------------------------------------------------
48 Functions prototypes
49 -----------------------------------------------------------------------------*/
50
51cpl_parameterlist * hdrl_mode_parameter_create_parlist(
52 const char * base_context,
53 const char * prefix,
54 const hdrl_parameter * defaults);
55
56cpl_error_code hdrl_mode_parameter_parse_parlist(
57 const cpl_parameterlist * parlist,
58 const char * prefix,
59 double * histo_min,
60 double * histo_max,
61 double * bin_size,
62 hdrl_mode_type * method,
63 cpl_size * error_niter);
64
65
66cpl_error_code hdrl_mode_clip_image(
67 const cpl_image * source,
68 const double histo_min,
69 const double histo_max,
70 const double bin_size,
71 const hdrl_mode_type method,
72 const cpl_size error_niter,
73 double * mode,
74 double * mode_error,
75 cpl_size * naccepted);
76
77cpl_error_code hdrl_mode_clip(
78 cpl_vector * vec,
79 const double histo_min,
80 const double histo_max,
81 const double bin_size,
82 const hdrl_mode_type method,
83 const cpl_size error_niter,
84 double * mode,
85 double * mode_error,
86 cpl_size * naccepted);
87
88/*-----------------------------------------------------------------------------
89 Private declarations - must not be used outside of hdrl
90 -----------------------------------------------------------------------------*/
91#ifdef HDRL_USE_PRIVATE
92
93cpl_error_code
94hdrl_mode_bootstrap(
95 const cpl_vector * vec,
96 const double histo_min,
97 const double histo_max,
98 const double bin_size,
99 const hdrl_mode_type method,
100 const cpl_size error_niter,
101 double * mode_error);
102
103
104#endif
105
106CPL_END_DECLS
107
108#endif /* HDRL_MODE_H */
109