2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software Foundation,
14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17 * All rights reserved.
20 /** \file \ingroup DNA
23 #ifndef __DNA_CAMERA_TYPES_H__
24 #define __DNA_CAMERA_TYPES_H__
27 #include "DNA_gpu_types.h"
28 #include "DNA_movieclip_types.h"
29 #include "DNA_image_types.h"
40 /* ------------------------------------------- */
42 typedef struct CameraStereoSettings {
43 float interocular_distance;
44 float convergence_distance;
45 short convergence_mode;
49 /* Cut-off angle at which interocular distance start to fade down. */
50 float pole_merge_angle_from;
51 /* Cut-off angle at which interocular distance stops to fade down. */
52 float pole_merge_angle_to;
53 } CameraStereoSettings;
55 /* Background Picture */
56 typedef struct CameraBGImage {
57 struct CameraBGImage *next, *prev;
60 struct ImageUser iuser;
61 struct MovieClip *clip;
62 struct MovieClipUser cuser;
63 float offset[2], scale, rotation;
69 typedef struct Camera_Runtime {
70 /* For draw manager. */
71 float drw_corners[2][4][2];
74 float drw_focusmat[4][4];
75 float drw_normalmat[4][4];
78 typedef struct Camera {
80 /** Animation data (must be immediately after id for utilities to use it). */
83 /** CAM_PERSP, CAM_ORTHO or CAM_PANO. */
85 /** Draw type extra. */
89 float clipsta, clipend;
90 float lens, ortho_scale, drawsize;
91 float sensor_x, sensor_y;
94 /* yafray: dof params */
95 /* qdn: yafray var 'YF_dofdist' now enabled for defocus composite node as well.
96 * The name was not changed so that no other files need to be modified */
99 /** Old animation system, deprecated for 2.5. */
100 struct Ipo *ipo DNA_DEPRECATED;
102 struct Object *dof_ob;
103 struct GPUDOFSettings gpu_dof;
105 /* CameraBGImage reference images */
106 struct ListBase bg_images;
111 /* Stereo settings */
112 struct CameraStereoSettings stereo;
114 /** Runtime data (keep last). */
115 Camera_Runtime runtime;
118 /* **************** CAMERA ********************* */
129 CAM_DTX_CENTER = (1 << 0),
130 CAM_DTX_CENTER_DIAG = (1 << 1),
131 CAM_DTX_THIRDS = (1 << 2),
132 CAM_DTX_GOLDEN = (1 << 3),
133 CAM_DTX_GOLDEN_TRI_A = (1 << 4),
134 CAM_DTX_GOLDEN_TRI_B = (1 << 5),
135 CAM_DTX_HARMONY_TRI_A = (1 << 6),
136 CAM_DTX_HARMONY_TRI_B = (1 << 7),
141 CAM_SHOWLIMITS = (1 << 0),
142 CAM_SHOWMIST = (1 << 1),
143 CAM_SHOWPASSEPARTOUT = (1 << 2),
144 CAM_SHOW_SAFE_MARGINS = (1 << 3),
145 CAM_SHOWNAME = (1 << 4),
146 CAM_ANGLETOGGLE = (1 << 5),
147 CAM_DS_EXPAND = (1 << 6),
148 #ifdef DNA_DEPRECATED
149 CAM_PANORAMA = (1 << 7), /* deprecated */
151 CAM_SHOWSENSOR = (1 << 8),
152 CAM_SHOW_SAFE_CENTER = (1 << 9),
153 CAM_SHOW_BG_IMAGE = (1 << 10),
158 CAMERA_SENSOR_FIT_AUTO = 0,
159 CAMERA_SENSOR_FIT_HOR = 1,
160 CAMERA_SENSOR_FIT_VERT = 2,
163 #define DEFAULT_SENSOR_WIDTH 36.0f
164 #define DEFAULT_SENSOR_HEIGHT 24.0f
166 /* stereo->convergence_mode */
169 CAM_S3D_PARALLEL = 1,
175 CAM_S3D_PIVOT_LEFT = 0,
176 CAM_S3D_PIVOT_RIGHT = 1,
177 CAM_S3D_PIVOT_CENTER = 2,
182 CAM_S3D_SPHERICAL = (1 << 0),
183 CAM_S3D_POLE_MERGE = (1 << 1),
186 /* CameraBGImage->flag */
187 /* may want to use 1 for select ? */
189 CAM_BGIMG_FLAG_EXPANDED = (1 << 1),
190 CAM_BGIMG_FLAG_CAMERACLIP = (1 << 2),
191 CAM_BGIMG_FLAG_DISABLED = (1 << 3),
192 CAM_BGIMG_FLAG_FOREGROUND = (1 << 4),
194 /* Camera framing options */
195 CAM_BGIMG_FLAG_CAMERA_ASPECT = (1 << 5), /* don't stretch to fit the camera view */
196 CAM_BGIMG_FLAG_CAMERA_CROP = (1 << 6), /* crop out the image */
198 /* Axis flip options */
199 CAM_BGIMG_FLAG_FLIP_X = (1 << 7),
200 CAM_BGIMG_FLAG_FLIP_Y = (1 << 8),
203 #define CAM_BGIMG_FLAG_EXPANDED (CAM_BGIMG_FLAG_EXPANDED | CAM_BGIMG_FLAG_CAMERACLIP)
205 /* CameraBGImage->source */
206 /* may want to use 1 for select ?*/
208 CAM_BGIMG_SOURCE_IMAGE = 0,
209 CAM_BGIMG_SOURCE_MOVIE = 1,