Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
calibration.h
Go to the documentation of this file.
1 /* Copyright (c) 2014-2016 "Omnidome" by cr8tr
2  * Dome Mapping Projection Software (http://omnido.me).
3  * Omnidome was created by Michael Winkelmann aka Wilston Oreo (@WilstonOreo)
4  *
5  * This file is part of Omnidome.
6  *
7  * Omnidome is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU Affero General Public License for more details.
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OMNIC_CALIBRATION_H_
20 #define OMNIC_CALIBRATION_H_
21 
22 /// Error codes
24  OMNIC_OK = 0,
27 };
28 
29 /// Calibrated pixel as UVW texture coordinates
30 typedef struct omnic_uvw_pixel {
31  float u,v,w; // Texture coordinates
32  float b; // Blend mask value
33 };
34 
35 /// Correction for a single color channel
36 typedef struct omnic_channelcorrection {
37  /// Gamma correction from -1.0 to 1.0
38  float gamma;
39 
40  /// Brightness correction from -1.0 to 1.0
41  float brightness;
42 
43  /// Contrast correction from -1.0 to 1.0
44  float contrast;
45 
46  /// Correction multiplier from 0.0 to 1.0
47  float multiplier;
48 };
49 
50 /// Color correction for red, green and blue channel
51 typedef struct omnic_colorcorrection {
52  /// Color correction for red channel
54 
55  /// Color correction for green channel
57 
58  /// Color correction for blue channel
60 
61  /// Overall color correction for all three channels
63 };
64 
65 /// Rectangle struct
66 typedef struct omnic_rect {
67  /// Offset in X direction
68  int32_t offset_x;
69 
70  /// Offset in Y direction
71  int32_t offset_y;
72 
73  /// Width of rectangle
74  uint32_t width;
75 
76  /// Height of rectangle
77  uint32_t height;
78 };
79 
80 
81 /**@brief A calibration for a single projector
82  **/
84  /// Screen info flags. First bit: virtual screen
85  uint32_t screen_info;
86 
87  /// Rectangle representing the screen geometry
89 
90  /// Rectangle representing the content placement inside the screen
92 
93  /// Three channel color correction
95 
96  /// Buffer width
97  uint32_t buffer_width;
98 
99  /// Buffer Height
100  uint32_t buffer_height;
101 
102  /// Buffer with calibrated pixels
103  omni_uvw_pixel* buffer;
104 
105  /// Brightness correction buffer width
107 
108  /// Brightness correction buffer height
110 
111  /// Buffer with brightness corrected pixels
113 };
114 
115 /// Calibration for several projectors
116 typedef struct omnic_calibration {
117  /// Header string
118  char header[80];
119 
120  /**@brief Calibration content type
121  **@detail 0 = UV coords, 1 = UVW coords
122  **/
123  uint32_t content_type;
124 
125  /// Number of projectors
126  uint32_t num_projectors;
127 
128  /// List of calibrated projectors
130 };
131 
132 /// Read calibration from file
133 omnic_error_code omnic_read(FILE*,omni_calibration*);
134 
135 /// Read calibration from file with name
136 omnic_error_code omnic_read(const char*,omni_calibration*);
137 
138 /// Write calibration to file
139 omnic_error_code omnic_write(FILE*,omni_calibration*);
140 
141 /// Write calibration to file with name
142 omnic_error_code omnic_write(const char*,omni_calibration*);
143 
144 /// Free memory of calibration
145 void omnic_free(omni_calibration*);
146 
147 #endif /* OMNIC_CALIBRATION_H_ */
float v
Definition: calibration.h:31
float multiplier
Correction multiplier from 0.0 to 1.0.
Definition: calibration.h:47
Definition: calibration.h:26
uint32_t brightness_correction_width
Brightness correction buffer width.
Definition: calibration.h:106
uint32_t buffer_height
Buffer Height.
Definition: calibration.h:100
uint32_t brightness_correction_height
Brightness correction buffer height.
Definition: calibration.h:109
Calibrated pixel as UVW texture coordinates.
Definition: calibration.h:30
omnic_rect content_geometry
Rectangle representing the content placement inside the screen.
Definition: calibration.h:91
uint32_t screen_info
Screen info flags. First bit: virtual screen.
Definition: calibration.h:85
float gamma
Gamma correction from -1.0 to 1.0.
Definition: calibration.h:38
omnic_colorcorrection all
Overall color correction for all three channels.
Definition: calibration.h:62
Rectangle struct.
Definition: calibration.h:66
uint32_t num_projectors
Number of projectors.
Definition: calibration.h:126
omnic_channelcorrection * brightness_correction
Buffer with brightness corrected pixels.
Definition: calibration.h:112
omnic_calibrated_projector * projectors
List of calibrated projectors.
Definition: calibration.h:129
int32_t offset_y
Offset in Y direction.
Definition: calibration.h:71
Definition: calibration.h:24
float w
Definition: calibration.h:31
Color correction for red, green and blue channel.
Definition: calibration.h:51
omnic_error_code omnic_read(FILE *, omni_calibration *)
Read calibration from file.
uint32_t width
Width of rectangle.
Definition: calibration.h:74
omnic_error_code omnic_write(FILE *, omni_calibration *)
Write calibration to file.
omnic_colorcorrection green
Color correction for green channel.
Definition: calibration.h:56
omni_uvw_pixel * buffer
Buffer with calibrated pixels.
Definition: calibration.h:103
float b
Definition: calibration.h:32
uint32_t height
Height of rectangle.
Definition: calibration.h:77
Calibration for several projectors.
Definition: calibration.h:116
omnic_error_code
Error codes.
Definition: calibration.h:23
float u
Definition: calibration.h:31
Correction for a single color channel.
Definition: calibration.h:36
omnic_rect screen_geometry
Rectangle representing the screen geometry.
Definition: calibration.h:88
omnic_colorcorrection colorcorrection
Three channel color correction.
Definition: calibration.h:94
float brightness
Brightness correction from -1.0 to 1.0.
Definition: calibration.h:41
int32_t offset_x
Offset in X direction.
Definition: calibration.h:68
A calibration for a single projector.
Definition: calibration.h:83
uint32_t buffer_width
Buffer width.
Definition: calibration.h:97
uint32_t content_type
Calibration content type 0 = UV coords, 1 = UVW coords.
Definition: calibration.h:123
omnic_colorcorrection red
Color correction for red channel.
Definition: calibration.h:53
Definition: calibration.h:25
char header[80]
Header string.
Definition: calibration.h:118
void omnic_free(omni_calibration *)
Free memory of calibration.
omnic_colorcorrection blue
Color correction for blue channel.
Definition: calibration.h:59
float contrast
Contrast correction from -1.0 to 1.0.
Definition: calibration.h:44