CR2RE Pipeline Reference Manual 1.6.2
hdrl_image.h
1/* $Id: hdrl_image.h,v 1.18 2013-10-23 09:42:14 jtaylor Exp $
2 *
3 * This file is part of the HDRL
4 * Copyright (C) 2013 European Southern Observatory
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21/*
22 * $Author: jtaylor $
23 * $Date: 2013-10-23 09:42:14 $
24 * $Revision: 1.18 $
25 * $Name: not supported by cvs2svn $
26 */
27
28#ifndef HDRL_IMAGE_H
29#define HDRL_IMAGE_H
30
31/*-----------------------------------------------------------------------------
32 New types
33 -----------------------------------------------------------------------------*/
34
35typedef struct _hdrl_image_ hdrl_image;
36
37/*-----------------------------------------------------------------------------
38 Includes
39 -----------------------------------------------------------------------------*/
40
41#include "hdrl_image_math.h"
42#include "hdrl_utils.h"
43#include "hdrl_buffer.h"
44#include "hdrl_types.h"
45
46#include <cpl.h>
47
48CPL_BEGIN_DECLS
49
50/*-----------------------------------------------------------------------------
51 Functions
52 -----------------------------------------------------------------------------*/
53
54hdrl_image * hdrl_image_new(cpl_size nx, cpl_size ny);
55
56hdrl_image * hdrl_image_create(const cpl_image * image,
57 const cpl_image * error);
58
59hdrl_image * hdrl_image_duplicate(const hdrl_image * himg);
60
61void hdrl_image_delete(hdrl_image * himg);
62
63cpl_image * hdrl_image_get_image(hdrl_image * himg);
64const cpl_image * hdrl_image_get_image_const(const hdrl_image * himg);
65
66cpl_image * hdrl_image_get_error(hdrl_image * himg);
67const cpl_image * hdrl_image_get_error_const(const hdrl_image * himg);
68
69cpl_mask * hdrl_image_get_mask(hdrl_image * himg);
70const cpl_mask * hdrl_image_get_mask_const(const hdrl_image * himg);
71
72hdrl_value hdrl_image_get_pixel(const hdrl_image * self,
73 cpl_size xpos, cpl_size ypos,
74 int * pis_rejected);
75
76cpl_error_code hdrl_image_set_pixel(hdrl_image * self,
77 cpl_size xpos, cpl_size ypos,
78 hdrl_value value);
79
80cpl_size hdrl_image_get_size_x(const hdrl_image * self) ;
81cpl_size hdrl_image_get_size_y(const hdrl_image * self) ;
82
83hdrl_image * hdrl_image_extract(const hdrl_image *,
84 cpl_size, cpl_size, cpl_size, cpl_size) ;
85
86cpl_error_code hdrl_image_reject(hdrl_image * self,
87 cpl_size xpos, cpl_size ypos);
88cpl_error_code hdrl_image_reject_value(hdrl_image * self, cpl_value mode);
89cpl_error_code hdrl_image_reject_from_mask(hdrl_image * self,
90 const cpl_mask * map);
91int hdrl_image_is_rejected(hdrl_image * self, cpl_size xpos, cpl_size ypos);
92cpl_size hdrl_image_count_rejected(const hdrl_image * self);
93cpl_error_code hdrl_image_accept(hdrl_image * self,
94 cpl_size xpos, cpl_size ypos);
95cpl_error_code hdrl_image_accept_all(hdrl_image * self);
96
97cpl_error_code hdrl_image_turn(hdrl_image * self, int rot);
98
99cpl_error_code hdrl_image_copy(hdrl_image * dst, const hdrl_image * src,
100 cpl_size xpos, cpl_size ypos);
101
102cpl_error_code hdrl_image_insert(hdrl_image * self,
103 const cpl_image * image,
104 const cpl_image * error,
105 cpl_size xpos, cpl_size ypos);
106
107cpl_error_code hdrl_image_dump_structure(const hdrl_image *, FILE *) ;
108
109cpl_error_code hdrl_image_dump_window(const hdrl_image *,
110 cpl_size, cpl_size, cpl_size, cpl_size, FILE *) ;
111
112/*-----------------------------------------------------------------------------
113 Experimental declarations - can be used, but no guarantees on api stability
114 -----------------------------------------------------------------------------*/
115#if defined HDRL_USE_EXPERIMENTAL || defined HDRL_USE_PRIVATE
116hdrl_image *
117hdrl_image_new_from_buffer(cpl_size nx, cpl_size ny, hdrl_buffer * buf);
118#endif
119
120/*-----------------------------------------------------------------------------
121 Private declarations - must not be used outside of hdrl
122 -----------------------------------------------------------------------------*/
123#ifdef HDRL_USE_PRIVATE
124hdrl_image * hdrl_image_wrap(cpl_image *, cpl_image *, hdrl_free *,
125 cpl_boolean);
126void hdrl_image_unwrap(hdrl_image * himg);
127#endif
128
129CPL_END_DECLS
130
131#endif
hdrl_value hdrl_image_get_pixel(const hdrl_image *self, cpl_size xpos, cpl_size ypos, int *pis_rejected)
get pixel values of hdrl_image
Definition: hdrl_image.c:559
int hdrl_image_is_rejected(hdrl_image *self, cpl_size xpos, cpl_size ypos)
return if pixel is marked bad
Definition: hdrl_image.c:445
cpl_error_code hdrl_image_set_pixel(hdrl_image *self, cpl_size xpos, cpl_size ypos, hdrl_value value)
set pixel values of hdrl_image
Definition: hdrl_image.c:594
cpl_error_code hdrl_image_reject_value(hdrl_image *self, cpl_value mode)
Reject pixels with the specified special value(s)
Definition: hdrl_image.c:477
cpl_error_code hdrl_image_reject_from_mask(hdrl_image *self, const cpl_mask *map)
set bpm of hdrl_image
Definition: hdrl_image.c:407
cpl_error_code hdrl_image_turn(hdrl_image *self, int rot)
Rotate an image by a multiple of 90 degrees clockwise.
Definition: hdrl_image.c:663
hdrl_image * hdrl_image_duplicate(const hdrl_image *himg)
copy hdrl_image
Definition: hdrl_image.c:391
cpl_error_code hdrl_image_copy(hdrl_image *dst, const hdrl_image *src, cpl_size xpos, cpl_size ypos)
Copy one image into another.
Definition: hdrl_image.c:686
cpl_mask * hdrl_image_get_mask(hdrl_image *himg)
get cpl bad pixel mask from image
Definition: hdrl_image.c:157
hdrl_image * hdrl_image_extract(const hdrl_image *, cpl_size, cpl_size, cpl_size, cpl_size)
extract copy of window from image
Definition: hdrl_image.c:625
cpl_error_code hdrl_image_dump_window(const hdrl_image *, cpl_size, cpl_size, cpl_size, cpl_size, FILE *)
Dump pixel values in a HDRL image.
Definition: hdrl_image.c:793
cpl_image * hdrl_image_get_error(hdrl_image *himg)
get error as cpl image
Definition: hdrl_image.c:131
cpl_size hdrl_image_get_size_y(const hdrl_image *self)
return size of Y dimension of image
Definition: hdrl_image.c:540
const cpl_mask * hdrl_image_get_mask_const(const hdrl_image *himg)
get cpl bad pixel mask from image
Definition: hdrl_image.c:175
cpl_size hdrl_image_get_size_x(const hdrl_image *self)
return size of X dimension of image
Definition: hdrl_image.c:525
const cpl_image * hdrl_image_get_error_const(const hdrl_image *himg)
get error as cpl image
Definition: hdrl_image.c:144
cpl_error_code hdrl_image_insert(hdrl_image *self, const cpl_image *image, const cpl_image *error, cpl_size xpos, cpl_size ypos)
Copy cpl images into an hdrl image.
Definition: hdrl_image.c:715
cpl_size hdrl_image_count_rejected(const hdrl_image *self)
return number of rejected pixels
Definition: hdrl_image.c:461
hdrl_image * hdrl_image_create(const cpl_image *image, const cpl_image *error)
create a new hdrl_image from to existing images by copying them
Definition: hdrl_image.c:295
cpl_image * hdrl_image_get_image(hdrl_image *himg)
get data as cpl image
Definition: hdrl_image.c:105
cpl_error_code hdrl_image_reject(hdrl_image *self, cpl_size xpos, cpl_size ypos)
mark pixel as bad
Definition: hdrl_image.c:427
const cpl_image * hdrl_image_get_image_const(const hdrl_image *himg)
get data as cpl image
Definition: hdrl_image.c:118
CPL_BEGIN_DECLS hdrl_image * hdrl_image_new(cpl_size nx, cpl_size ny)
create new zero filled hdrl image
Definition: hdrl_image.c:311
cpl_error_code hdrl_image_dump_structure(const hdrl_image *, FILE *)
Dump structural information of a HDRL image.
Definition: hdrl_image.c:767
cpl_error_code hdrl_image_accept(hdrl_image *self, cpl_size xpos, cpl_size ypos)
mark pixel as good
Definition: hdrl_image.c:493
void hdrl_image_delete(hdrl_image *himg)
delete hdrl_image
Definition: hdrl_image.c:379
cpl_error_code hdrl_image_accept_all(hdrl_image *self)
Accept all pixels in an image.
Definition: hdrl_image.c:508