High-Level Data Reduction Library: hdrl_image.h Source File

High-Level Data Reduction Library 1.6.0 High-Level data reduction routines for ESO pipelines

Loading...
Searching...
No Matches
hdrl_image.h
Go to the documentation of this file.
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
35 typedef 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
54 hdrl_image * hdrl_image_new(cpl_size nx, cpl_size ny);
55
56 hdrl_image * hdrl_image_create(const cpl_image * image,
57 const cpl_image * error);
58
59 hdrl_image * hdrl_image_duplicate(const hdrl_image * himg);
60
61 void hdrl_image_delete(hdrl_image * himg);
62
63cpl_image * hdrl_image_get_image(hdrl_image * himg);
64 const cpl_image * hdrl_image_get_image_const(const hdrl_image * himg);
65
66cpl_image * hdrl_image_get_error(hdrl_image * himg);
67 const cpl_image * hdrl_image_get_error_const(const hdrl_image * himg);
68
69cpl_mask * hdrl_image_get_mask(hdrl_image * himg);
70 const cpl_mask * hdrl_image_get_mask_const(const hdrl_image * himg);
71
72 hdrl_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
83 hdrl_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);
91 int 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
116 hdrl_image *
117 hdrl_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
124 hdrl_image * hdrl_image_wrap(cpl_image *, cpl_image *, hdrl_free *,
125 cpl_boolean);
126 void hdrl_image_unwrap(hdrl_image * himg);
127#endif
128
129CPL_END_DECLS
130
131#endif
hdrl_image_math.h
hdrl_types.h
hdrl_free
void() hdrl_free(void *)
Definition hdrl_types.h:39
hdrl_buffer.h
hdrl_utils.h
hdrl_image_get_pixel
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
hdrl_image_is_rejected
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
hdrl_image_set_pixel
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
hdrl_image_reject_value
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
hdrl_image_reject_from_mask
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
hdrl_image_unwrap
void hdrl_image_unwrap(hdrl_image *himg)
Definition hdrl_image.c:228
hdrl_image_turn
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_duplicate
hdrl_image * hdrl_image_duplicate(const hdrl_image *himg)
copy hdrl_image
Definition hdrl_image.c:391
hdrl_image_copy
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
hdrl_image_get_mask
cpl_mask * hdrl_image_get_mask(hdrl_image *himg)
get cpl bad pixel mask from image
Definition hdrl_image.c:157
hdrl_image_extract
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
hdrl_image_dump_window
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
hdrl_image_get_error
cpl_image * hdrl_image_get_error(hdrl_image *himg)
get error as cpl image
Definition hdrl_image.c:131
hdrl_image_get_size_y
cpl_size hdrl_image_get_size_y(const hdrl_image *self)
return size of Y dimension of image
Definition hdrl_image.c:540
hdrl_image_get_mask_const
const cpl_mask * hdrl_image_get_mask_const(const hdrl_image *himg)
get cpl bad pixel mask from image
Definition hdrl_image.c:175
hdrl_image_get_size_x
cpl_size hdrl_image_get_size_x(const hdrl_image *self)
return size of X dimension of image
Definition hdrl_image.c:525
hdrl_image_get_error_const
const cpl_image * hdrl_image_get_error_const(const hdrl_image *himg)
get error as cpl image
Definition hdrl_image.c:144
hdrl_image_insert
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
hdrl_image_count_rejected
cpl_size hdrl_image_count_rejected(const hdrl_image *self)
return number of rejected pixels
Definition hdrl_image.c:461
hdrl_image_create
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
hdrl_image_get_image
cpl_image * hdrl_image_get_image(hdrl_image *himg)
get data as cpl image
Definition hdrl_image.c:105
hdrl_image_reject
cpl_error_code hdrl_image_reject(hdrl_image *self, cpl_size xpos, cpl_size ypos)
mark pixel as bad
Definition hdrl_image.c:427
hdrl_image_get_image_const
const cpl_image * hdrl_image_get_image_const(const hdrl_image *himg)
get data as cpl image
Definition hdrl_image.c:118
hdrl_image_new_from_buffer
hdrl_image * hdrl_image_new_from_buffer(cpl_size nx, cpl_size ny, hdrl_buffer *buf)
Definition hdrl_image.c:326
hdrl_image_new
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
hdrl_image_dump_structure
cpl_error_code hdrl_image_dump_structure(const hdrl_image *, FILE *)
Dump structural information of a HDRL image.
Definition hdrl_image.c:767
hdrl_image_accept
cpl_error_code hdrl_image_accept(hdrl_image *self, cpl_size xpos, cpl_size ypos)
mark pixel as good
Definition hdrl_image.c:493
hdrl_image_delete
void hdrl_image_delete(hdrl_image *himg)
delete hdrl_image
Definition hdrl_image.c:379
hdrl_image_wrap
hdrl_image * hdrl_image_wrap(cpl_image *img, cpl_image *err, hdrl_free *destructor, cpl_boolean sync_mask)
Definition hdrl_image.c:192
hdrl_image_accept_all
cpl_error_code hdrl_image_accept_all(hdrl_image *self)
Accept all pixels in an image.
Definition hdrl_image.c:508
_hdrl_image_
Definition hdrl_image_defs.h:40
_hdrl_image_::image
cpl_image * image
Definition hdrl_image_defs.h:41
_hdrl_image_::error
cpl_image * error
Definition hdrl_image_defs.h:42
hdrl_value
Definition hdrl_types.h:77