2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
27 /** \file DNA_sequence_types.h
32 * Structs for use by the 'Sequencer' (Video Editor)
35 * - #Sequence: video/effect/audio data you can select and manipulate in the sequencer.
36 * - #Sequence.machine: Strange name for the channel.
37 * - #Strip: The data referenced by the #Sequence
38 * - Meta Strip (SEQ_TYPE_META): Support for nesting Sequences.
41 #ifndef __DNA_SEQUENCE_TYPES_H__
42 #define __DNA_SEQUENCE_TYPES_H__
45 #include "DNA_color_types.h"
46 #include "DNA_listBase.h"
47 #include "DNA_vec_types.h"
54 /* strlens; 256= FILE_MAXFILE, 768= FILE_MAXDIR */
56 typedef struct StripAnim {
57 struct StripAnim *next, *prev;
61 typedef struct StripElem {
63 int orig_width, orig_height;
66 typedef struct StripCrop {
73 typedef struct StripTransform {
78 typedef struct StripColorBalance {
88 typedef struct StripProxy {
89 char dir[768]; // custom directory for index and proxy files
90 // (defaults to BL_proxy)
92 char file[256]; // custom file
93 struct anim *anim; // custom proxy anim file
95 short tc; // time code in use
97 short quality; // proxy build quality
98 short build_size_flags; // size flags (see below) of all proxies
100 short build_tc_flags; // time code flags (see below) of all tc indices
107 typedef struct Strip {
108 struct Strip *next, *prev;
110 int startstill, endstill;
111 StripElem *stripdata; /* only used as an array in IMAGE sequences(!),
112 * and as a 1-element array in MOVIE sequences,
113 * NULL for all other strip-types */
117 StripTransform *transform;
118 StripColorBalance *color_balance DNA_DEPRECATED;
120 /* color management */
121 ColorManagedColorspaceSettings colorspace_settings;
125 * The sequence structure is the basic struct used by any strip.
126 * each of the strips uses a different sequence structure.
128 * \warning The first part identical to ID (for use in ipo's)
129 * the commend above is historic, probably we can drop the ID compatibility,
130 * but take care making this change.
132 * \warning This is really a 'Strip' in the UI!, name is highly confusing.
134 typedef struct Sequence {
135 struct Sequence *next, *prev;
136 void *tmp; /* tmp var for copying, and tagging for linked selection */
137 void *lib; /* needed (to be like ipo), else it will raise libdata warnings, this should never be used */
138 char name[64]; /* SEQ_NAME_MAXSTR - name, set by default and needs to be unique, for RNA paths */
140 int flag, type; /*flags bitmap (see below) and the type of sequence*/
141 int len; /* the length of the contents of this strip - before handles are applied */
142 int start; /* start frame of contents of strip in absolute frame coordinates. For metastrips start of first strip startdisp */
143 int startofs, endofs; /* frames after the first frame where display starts, frames before the last frame where display ends */
144 int startstill, endstill; /* frames that use the first frame before data begins, frames that use the last frame after data ends */
145 int machine, depth; /*machine - the strip channel, depth - the depth in the sequence when dealing with metastrips */
146 int startdisp, enddisp; /* starting and ending points of the strip in the sequence*/
151 short streamindex; /* streamindex for movie or sound files with several streams */
152 int multicam_source; /* for multicam source selection */
153 int clip_flag; /* MOVIECLIP render flags */
157 struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
159 /* these ID vars should never be NULL but can be when linked libs fail to load, so check on access */
161 struct Object *scene_camera; /* override scene camera */
162 struct MovieClip *clip; /* for MOVIECLIP strips */
163 struct Mask *mask; /* for MASK strips */
164 ListBase anims; /* for MOVIE strips */
169 /* pointers for effects: */
170 struct Sequence *seq1, *seq2, *seq3;
172 ListBase seqbase; /* list of strips for metastrips */
174 struct bSound *sound; /* the linked "bSound" object */
178 float pitch, pan; /* pitch (-0.1..10), pan -2..2 */
181 void *effectdata; /* Struct pointer for effect settings */
183 int anim_startofs; /* only use part of animation file */
184 int anim_endofs; /* is subtle different to startofs / endofs */
190 /* is sfra needed anymore? - it looks like its only used in one place */
191 int sfra; /* starting frame according to the timeline of the scene. */
198 struct Stereo3dFormat *stereo3d_format;
200 struct IDProperty *prop;
206 typedef struct MetaStack {
207 struct MetaStack *next, *prev;
210 /* the startdisp/enddisp when entering the meta */
214 typedef struct Editing {
215 ListBase *seqbasep; /* pointer to the current list of seq's being edited (can be within a meta strip) */
216 ListBase seqbase; /* pointer to the top-most seq's */
219 /* Context vars, used to be static */
221 char act_imagedir[1024]; /* 1024 = FILE_MAX */
222 char act_sounddir[1024]; /* 1024 = FILE_MAX */
223 char proxy_dir[1024]; /* 1024 = FILE_MAX */
225 int over_ofs, over_cfra;
226 int over_flag, proxy_storage;
230 /* ************* Effect Variable Structs ********* */
231 typedef struct WipeVars {
232 float edgeWidth, angle;
233 short forward, wipetype;
236 typedef struct GlowVars {
237 float fMini; /* Minimum intensity to trigger a glow */
239 float fBoost; /* Amount to multiply glow intensity */
240 float dDist; /* Radius of glow blurring */
242 int bNoComp; /* SHOW/HIDE glow buffer */
245 typedef struct TransformVars {
253 int uniform_scale; /* preserve aspect/ratio when scaling */
256 typedef struct SolidColorVars {
261 typedef struct SpeedControlVars {
269 typedef struct GaussianBlurVars {
274 typedef struct TextVars {
286 SEQ_TEXT_SHADOW = (1 << 0),
291 SEQ_TEXT_ALIGN_X_LEFT = 0,
292 SEQ_TEXT_ALIGN_X_CENTER = 1,
293 SEQ_TEXT_ALIGN_X_RIGHT = 2,
296 /* TextVars.align_y */
298 SEQ_TEXT_ALIGN_Y_TOP = 0,
299 SEQ_TEXT_ALIGN_Y_CENTER = 1,
300 SEQ_TEXT_ALIGN_Y_BOTTOM = 2,
303 /* ***************** Sequence modifiers ****************** */
305 typedef struct SequenceModifierData {
306 struct SequenceModifierData *next, *prev;
308 char name[64]; /* MAX_NAME */
310 /* mask input, either sequence or mask ID */
314 struct Sequence *mask_sequence;
315 struct Mask *mask_id;
317 } SequenceModifierData;
319 typedef struct ColorBalanceModifierData {
320 SequenceModifierData modifier;
322 StripColorBalance color_balance;
323 float color_multiply;
324 } ColorBalanceModifierData;
326 typedef struct CurvesModifierData {
327 SequenceModifierData modifier;
329 struct CurveMapping curve_mapping;
330 } CurvesModifierData;
332 typedef struct HueCorrectModifierData {
333 SequenceModifierData modifier;
335 struct CurveMapping curve_mapping;
336 } HueCorrectModifierData;
338 typedef struct BrightContrastModifierData {
339 SequenceModifierData modifier;
343 } BrightContrastModifierData;
345 typedef struct SequencerMaskModifierData {
346 SequenceModifierData modifier;
347 } SequencerMaskModifierData;
349 typedef struct WhiteBalanceModifierData {
350 SequenceModifierData modifier;
352 float white_value[3];
354 } WhiteBalanceModifierData;
356 typedef struct SequencerTonemapModifierData {
357 SequenceModifierData modifier;
359 float key, offset, gamma;
360 float intensity, contrast, adaptation, correction;
362 } SequencerTonemapModifierData;
365 SEQ_TONEMAP_RH_SIMPLE = 0,
366 SEQ_TONEMAP_RD_PHOTORECEPTOR = 1,
369 /* ***************** Scopes ****************** */
371 typedef struct SequencerScopes {
372 struct ImBuf *reference_ibuf;
374 struct ImBuf *zebra_ibuf;
375 struct ImBuf *waveform_ibuf;
376 struct ImBuf *sep_waveform_ibuf;
377 struct ImBuf *vector_ibuf;
378 struct ImBuf *histogram_ibuf;
385 /* Editor->over_flag */
386 #define SEQ_EDIT_OVERLAY_SHOW 1
387 #define SEQ_EDIT_OVERLAY_ABS 2
389 #define SEQ_STRIP_OFSBOTTOM 0.2f
390 #define SEQ_STRIP_OFSTOP 0.8f
392 /* Editor->proxy_storage */
393 /* store proxies in project directory */
394 #define SEQ_EDIT_PROXY_DIR_STORAGE 1
396 /* SpeedControlVars->flags */
397 #define SEQ_SPEED_INTEGRATE 1
398 /* #define SEQ_SPEED_BLEND 2 */ /* DEPRECATED */
399 #define SEQ_SPEED_COMPRESS_IPO_Y 4
401 /* ***************** SEQUENCE ****************** */
402 #define SEQ_NAME_MAXSTR 64
406 SEQ_LEFTSEL = (1 << 1),
407 SEQ_RIGHTSEL = (1 << 2),
408 SEQ_OVERLAP = (1 << 3),
409 SEQ_FILTERY = (1 << 4),
411 #ifdef DNA_DEPRECATED
412 SEQ_MAKE_PREMUL = (1 << 6), /* deprecated, used for compatibility code only */
414 SEQ_REVERSE_FRAMES = (1 << 7),
415 SEQ_IPO_FRAME_LOCKED = (1 << 8),
416 SEQ_EFFECT_NOT_LOADED = (1 << 9),
417 SEQ_FLAG_DELETE = (1 << 10),
418 SEQ_FLIPX = (1 << 11),
419 SEQ_FLIPY = (1 << 12),
420 SEQ_MAKE_FLOAT = (1 << 13),
421 SEQ_LOCK = (1 << 14),
422 SEQ_USE_PROXY = (1 << 15),
423 SEQ_USE_TRANSFORM = (1 << 16),
424 SEQ_USE_CROP = (1 << 17),
425 /* SEQ_USE_COLOR_BALANCE = (1 << 18), */ /* DEPRECATED */
426 /* SEQ_USE_PROXY_CUSTOM_DIR = (1 << 19), */ /* DEPRECATED */
428 /* SEQ_USE_PROXY_CUSTOM_FILE = (1 << 21), */ /* DEPRECATED */
429 SEQ_USE_EFFECT_DEFAULT_FADE = (1 << 22),
430 SEQ_USE_LINEAR_MODIFIERS = (1 << 23),
432 /* flags for whether those properties are animated or not */
433 SEQ_AUDIO_VOLUME_ANIMATED = (1 << 24),
434 SEQ_AUDIO_PITCH_ANIMATED = (1 << 25),
435 SEQ_AUDIO_PAN_ANIMATED = (1 << 26),
436 SEQ_AUDIO_DRAW_WAVEFORM = (1 << 27),
438 /* don't include Grease Pencil in OpenGL previews of Scene strips */
439 SEQ_SCENE_NO_GPENCIL = (1 << 28),
440 SEQ_USE_VIEWS = (1 << 29),
442 /* access scene strips directly (like a metastrip) */
443 SEQ_SCENE_STRIPS = (1 << 30),
445 SEQ_INVALID_EFFECT = (1 << 31),
448 /* StripProxy->storage */
450 SEQ_STORAGE_PROXY_CUSTOM_FILE = (1 << 1), /* store proxy in custom directory */
451 SEQ_STORAGE_PROXY_CUSTOM_DIR = (1 << 2), /* store proxy in custom file */
454 /* convenience define for all selection flags */
455 #define SEQ_ALLSEL (SELECT + SEQ_LEFTSEL + SEQ_RIGHTSEL)
457 /* deprecated, don't use a flag anymore*/
458 /*#define SEQ_ACTIVE 1048576*/
460 #define SEQ_COLOR_BALANCE_INVERSE_GAIN 1
461 #define SEQ_COLOR_BALANCE_INVERSE_GAMMA 2
462 #define SEQ_COLOR_BALANCE_INVERSE_LIFT 4
464 /* !!! has to be same as IMB_imbuf.h IMB_PROXY_... and IMB_TC_... */
466 #define SEQ_PROXY_IMAGE_SIZE_25 1
467 #define SEQ_PROXY_IMAGE_SIZE_50 2
468 #define SEQ_PROXY_IMAGE_SIZE_75 4
469 #define SEQ_PROXY_IMAGE_SIZE_100 8
471 #define SEQ_PROXY_TC_NONE 0
472 #define SEQ_PROXY_TC_RECORD_RUN 1
473 #define SEQ_PROXY_TC_FREE_RUN 2
474 #define SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN 4
475 #define SEQ_PROXY_TC_RECORD_RUN_NO_GAPS 8
476 #define SEQ_PROXY_TC_ALL 15
478 /* SeqProxy->build_flags */
480 SEQ_PROXY_SKIP_EXISTING = 1,
483 /* seq->alpha_mode */
485 SEQ_ALPHA_STRAIGHT = 0,
489 /* seq->type WATCH IT: SEQ_TYPE_EFFECT BIT is used to determine if this is an effect strip!!! */
495 SEQ_TYPE_SOUND_RAM = 4,
496 SEQ_TYPE_SOUND_HD = 5,
497 SEQ_TYPE_MOVIECLIP = 6,
504 SEQ_TYPE_ALPHAOVER = 11,
505 SEQ_TYPE_ALPHAUNDER = 12,
506 SEQ_TYPE_GAMCROSS = 13,
508 SEQ_TYPE_OVERDROP = 15,
509 /* SEQ_TYPE_PLUGIN = 24, */ /* Deprecated */
512 SEQ_TYPE_TRANSFORM = 27,
515 SEQ_TYPE_MULTICAM = 30,
516 SEQ_TYPE_ADJUSTMENT = 31,
517 SEQ_TYPE_GAUSSIAN_BLUR = 40,
523 #define SEQ_MOVIECLIP_RENDER_UNDISTORTED (1 << 0)
524 #define SEQ_MOVIECLIP_RENDER_STABILIZED (1 << 1)
526 #define SEQ_BLEND_REPLACE 0
527 /* all other BLEND_MODEs are simple SEQ_TYPE_EFFECT ids and therefore identical
528 * to the table above. (Only those effects that handle _exactly_ two inputs,
529 * otherwise, you can't really blend, right :) !)
533 #define SEQ_HAS_PATH(_seq) (ELEM((_seq)->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD))
537 /* SequenceModifierData->type */
539 seqModifierType_ColorBalance = 1,
540 seqModifierType_Curves = 2,
541 seqModifierType_HueCorrect = 3,
542 seqModifierType_BrightContrast = 4,
543 seqModifierType_Mask = 5,
544 seqModifierType_WhiteBalance = 6,
545 seqModifierType_Tonemap = 7,
547 NUM_SEQUENCE_MODIFIER_TYPES
550 /* SequenceModifierData->flag */
552 SEQUENCE_MODIFIER_MUTE = (1 << 0),
553 SEQUENCE_MODIFIER_EXPANDED = (1 << 1),
557 SEQUENCE_MASK_INPUT_STRIP = 0,
558 SEQUENCE_MASK_INPUT_ID = 1
562 /* Mask animation will be remapped relative to the strip start frame. */
563 SEQUENCE_MASK_TIME_RELATIVE = 0,
564 /* Global (scene) frame number will be used to access the mask. */
565 SEQUENCE_MASK_TIME_ABSOLUTE = 1,
568 #endif /* __DNA_SEQUENCE_TYPES_H__ */