CR2RE Pipeline Reference Manual 1.6.7
hdrl_iter.h
1/*
2 * This file is part of the HDRL
3 * Copyright (C) 2013 European Southern Observatory
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef HDRL_ITER_H
21#define HDRL_ITER_H
22
23/*-----------------------------------------------------------------------------
24 Includes
25 -----------------------------------------------------------------------------*/
26
27#include "hdrl_types.h"
28#include <cpl.h>
29
30CPL_BEGIN_DECLS
31
32/*-----------------------------------------------------------------------------
33 Define
34 -----------------------------------------------------------------------------*/
35
36/*-----------------------------------------------------------------------------
37 Functions prototypes
38 -----------------------------------------------------------------------------*/
39
40/*-----------------------------------------------------------------------------
41 Experimental declarations - can be used, but no guarantees on api stability
42 -----------------------------------------------------------------------------*/
43#if defined HDRL_USE_EXPERIMENTAL || defined HDRL_USE_PRIVATE
46typedef struct _hdrl_iter_ hdrl_iter;
47typedef enum {
48 /* next returns a imagelist */
49 HDRL_ITER_IMAGELIST = 1<<0,
50 /* next returns a image */
51 HDRL_ITER_IMAGE = 1<<1,
52 /* next returns an initialized input buffer */
53 HDRL_ITER_INPUT = 1<<2,
54 /* next returns an uninitialized output buffer */
55 HDRL_ITER_OUTPUT = 1<<3,
56 /* iterator owns its next output and will deallocate it */
57 HDRL_ITER_OWNS_DATA = 1<<4,
58 /* iterating over const data, views make have NULL bpms */
59 HDRL_ITER_CONST = 1<<5,
60 /* multi-iterator may return empty results */
61 HDRL_ITER_ALLOW_EMPTY = 1<<6,
62} hdrl_iter_flags;
63
64void * hdrl_iter_next(hdrl_iter * it);
65cpl_size hdrl_iter_length(hdrl_iter * it);
66void hdrl_iter_reset(hdrl_iter * it);
67void hdrl_iter_delete(hdrl_iter * it);
68
70#endif
71
72/*-----------------------------------------------------------------------------
73 Private declarations - must not be used outside of hdrl
74------------------------------------------------------------------------------*/
75
76#ifdef HDRL_USE_PRIVATE
79typedef void * (hdrl_iter_next_f)(hdrl_iter * it);
80typedef void (hdrl_iter_reset_f)(hdrl_iter * it);
81typedef cpl_size (hdrl_iter_length_f)(hdrl_iter * it);
82
83hdrl_iter *
84hdrl_iter_init(hdrl_iter_next_f * next,
85 hdrl_iter_reset_f * reset,
86 hdrl_iter_length_f * length,
87 hdrl_free * destructor,
88 hdrl_iter_flags flags,
89 void * state);
90
91void * hdrl_iter_state(const hdrl_iter * it);
92
93cpl_boolean hdrl_iter_check(hdrl_iter * it, hdrl_iter_flags flags);
94
96#endif
97
98CPL_END_DECLS
99
100#endif