Blender V2.61 - r43446

DNA_sequence_types.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00033 #ifndef DNA_SEQUENCE_TYPES_H
00034 #define DNA_SEQUENCE_TYPES_H
00035 
00036 #include "DNA_defs.h"
00037 #include "DNA_listBase.h"
00038 #include "DNA_vec_types.h"
00039 
00040 struct Ipo;
00041 struct Scene;
00042 struct bSound;
00043 
00044 /* strlens; 80= FILE_MAXFILE, 160= FILE_MAXDIR */
00045 
00046 typedef struct StripElem {
00047     char name[80];
00048     int orig_width, orig_height;
00049 } StripElem;
00050 
00051 typedef struct StripCrop {
00052     int top;
00053     int bottom;
00054     int left;
00055     int right;
00056 } StripCrop;
00057 
00058 typedef struct StripTransform {
00059     int xofs;
00060     int yofs;
00061 } StripTransform;
00062 
00063 typedef struct StripColorBalance {
00064     float lift[3];
00065     float gamma[3];
00066     float gain[3];
00067     int flag;
00068     int pad;
00069     // float exposure;
00070     // float saturation;
00071 } StripColorBalance;
00072 
00073 typedef struct StripProxy {
00074     char dir[160];         // custom directory for index and proxy files
00075                            // (defaults to BL_proxy)
00076 
00077     char file[80];         // custom file
00078     struct anim *anim;     // custom proxy anim file
00079 
00080     short tc;              // time code in use
00081 
00082     short quality;         // proxy build quality
00083     short build_size_flags;// size flags (see below) of all proxies 
00084                            // to build
00085     short build_tc_flags;  // time code flags (see below) of all tc indices
00086                            // to build
00087 } StripProxy;
00088 
00089 typedef struct Strip {
00090     struct Strip *next, *prev;
00091     int rt, len, us, done;
00092     int startstill, endstill;
00093     StripElem *stripdata;
00094     char dir[160];
00095     StripProxy *proxy;
00096     StripCrop *crop;
00097     StripTransform *transform;
00098     StripColorBalance *color_balance;
00099 } Strip;
00100 
00101 
00102 typedef struct PluginSeq {
00103     char name[256];
00104     void *handle;
00105 
00106     char *pname;
00107 
00108     int vars, version;
00109 
00110     void *varstr;
00111     float *cfra;
00112 
00113     float data[32];
00114 
00115     void *instance_private_data;
00116     void **current_private_data;
00117 
00118     void (*doit)(void);
00119 
00120     void (*callback)(void);
00121 } PluginSeq;
00122 
00123 /* The sequence structure is the basic struct used by any strip. each of the strips uses a different sequence structure.*/
00124 /* WATCH IT: first part identical to ID (for use in ipo's) */
00125 
00126 typedef struct Sequence {
00127     struct Sequence *next, *prev;
00128     void *tmp; /* tmp var for copying, and tagging for linked selection */
00129     void *lib; /* needed (to be like ipo), else it will raise libdata warnings, this should never be used */
00130     char name[64]; /* SEQ_NAME_MAXSTR - name, set by default and needs to be unique, for RNA paths */
00131 
00132     int flag, type; /*flags bitmap (see below) and the type of sequence*/
00133     int len; /* the length of the contense of this strip - before handles are applied */
00134     int start, startofs, endofs;
00135     int startstill, endstill;
00136     int machine, depth; /*machine - the strip channel, depth - the depth in the sequence when dealing with metastrips */
00137     int startdisp, enddisp; /*starting and ending points in the sequence*/
00138     float sat;
00139     float mul, handsize;
00140                     /* is sfra needed anymore? - it looks like its only used in one place */
00141     int sfra;       /* starting frame according to the timeline of the scene. */
00142     int anim_preseek;
00143     int streamindex;   /* streamindex for movie or sound files with several streams */
00144 
00145     Strip *strip;
00146 
00147     struct Ipo *ipo  DNA_DEPRECATED;  /* old animation system, deprecated for 2.5 */
00148     struct Scene *scene;
00149     struct Object *scene_camera; /* override scene camera */
00150 
00151     struct anim *anim;
00152     float effect_fader;
00153     float speed_fader;
00154 
00155     PluginSeq *plugin;
00156 
00157     /* pointers for effects: */
00158     struct Sequence *seq1, *seq2, *seq3;
00159 
00160     ListBase seqbase;   /* list of strips for metastrips */
00161 
00162     struct bSound *sound;   /* the linked "bSound" object */
00163     void *scene_sound;
00164     float volume;
00165 
00166     float pitch, pan;   /* pitch (-0.1..10), pan -2..2 */
00167     int scenenr;          /* for scene selection */
00168     int multicam_source;  /* for multicam source selection */
00169     float strobe;
00170 
00171     void *effectdata;   /* Struct pointer for effect settings */
00172 
00173     int anim_startofs;    /* only use part of animation file */
00174     int anim_endofs;      /* is subtle different to startofs / endofs */
00175 
00176     int blend_mode;
00177     float blend_opacity;
00178 
00179 } Sequence;
00180 
00181 typedef struct MetaStack {
00182     struct MetaStack *next, *prev;
00183     ListBase *oldbasep;
00184     Sequence *parseq;
00185 } MetaStack;
00186 
00187 typedef struct Editing {
00188     ListBase *seqbasep; /* pointer to the current list of seq's being edited (can be within a meta strip) */
00189     ListBase seqbase;   /* pointer to the top-most seq's */
00190     ListBase metastack;
00191     
00192     /* Context vars, used to be static */
00193     Sequence *act_seq;
00194     char act_imagedir[256];
00195     char act_sounddir[256];
00196 
00197     int over_ofs, over_cfra;
00198     int over_flag, pad;
00199     rctf over_border;
00200 } Editing;
00201 
00202 /* ************* Effect Variable Structs ********* */
00203 typedef struct WipeVars {
00204     float edgeWidth,angle;
00205     short forward, wipetype;
00206 } WipeVars;
00207 
00208 typedef struct GlowVars {   
00209     float fMini;    /*  Minimum intensity to trigger a glow */
00210     float fClamp;
00211     float fBoost;   /*  Amount to multiply glow intensity */
00212     float dDist;    /*  Radius of glow blurring */
00213     int dQuality;
00214     int bNoComp;    /*  SHOW/HIDE glow buffer */
00215 } GlowVars;
00216 
00217 typedef struct TransformVars {
00218     float ScalexIni;
00219     float ScaleyIni;
00220     float xIni;
00221     float yIni;
00222     float rotIni;
00223     int percent;
00224     int interpolation;
00225     int uniform_scale; /* preserve aspect/ratio when scaling */
00226 } TransformVars;
00227 
00228 typedef struct SolidColorVars {
00229     float col[3];
00230     float pad;
00231 } SolidColorVars;
00232 
00233 typedef struct SpeedControlVars {
00234     float * frameMap;
00235     float globalSpeed;
00236     int flags;
00237     int length;
00238     int lastValidFrame;
00239 } SpeedControlVars;
00240 
00241 #define MAXSEQ          32
00242 
00243 #define SELECT 1
00244 
00245 /* Editor->over_flag */
00246 #define SEQ_EDIT_OVERLAY_SHOW           1
00247 #define SEQ_EDIT_OVERLAY_ABS            2
00248 
00249 #define SEQ_STRIP_OFSBOTTOM     0.2f
00250 #define SEQ_STRIP_OFSTOP        0.8f
00251 
00252 /* SpeedControlVars->flags */
00253 #define SEQ_SPEED_INTEGRATE      1
00254 #define SEQ_SPEED_BLEND          2
00255 #define SEQ_SPEED_COMPRESS_IPO_Y 4
00256 
00257 /* ***************** SEQUENCE ****************** */
00258 #define SEQ_NAME_MAXSTR         64
00259 
00260 /* seq->flag */
00261 #define SEQ_LEFTSEL                 (1<<1)
00262 #define SEQ_RIGHTSEL                (1<<2)
00263 #define SEQ_OVERLAP                 (1<<3)
00264 #define SEQ_FILTERY                 (1<<4)
00265 #define SEQ_MUTE                    (1<<5)
00266 #define SEQ_MAKE_PREMUL             (1<<6)
00267 #define SEQ_REVERSE_FRAMES          (1<<7)
00268 #define SEQ_IPO_FRAME_LOCKED        (1<<8)
00269 #define SEQ_EFFECT_NOT_LOADED       (1<<9)
00270 #define SEQ_FLAG_DELETE             (1<<10)
00271 #define SEQ_FLIPX                   (1<<11)
00272 #define SEQ_FLIPY                   (1<<12)
00273 #define SEQ_MAKE_FLOAT              (1<<13)
00274 #define SEQ_LOCK                    (1<<14)
00275 #define SEQ_USE_PROXY               (1<<15)
00276 #define SEQ_USE_TRANSFORM           (1<<16)
00277 #define SEQ_USE_CROP                (1<<17)
00278 #define SEQ_USE_COLOR_BALANCE       (1<<18)
00279 #define SEQ_USE_PROXY_CUSTOM_DIR    (1<<19)
00280 
00281 #define SEQ_USE_PROXY_CUSTOM_FILE   (1<<21)
00282 #define SEQ_USE_EFFECT_DEFAULT_FADE (1<<22)
00283 
00284 // flags for whether those properties are animated or not
00285 #define SEQ_AUDIO_VOLUME_ANIMATED   (1<<24)
00286 #define SEQ_AUDIO_PITCH_ANIMATED    (1<<25)
00287 #define SEQ_AUDIO_PAN_ANIMATED      (1<<26)
00288 #define SEQ_AUDIO_DRAW_WAVEFORM     (1<<27)
00289 
00290 #define SEQ_INVALID_EFFECT          (1<<31)
00291 
00292 /* convenience define for all selection flags */
00293 #define SEQ_ALLSEL  (SELECT+SEQ_LEFTSEL+SEQ_RIGHTSEL)
00294 
00295 /* deprecated, dont use a flag anymore*/
00296 /*#define SEQ_ACTIVE                            1048576*/
00297 
00298 #define SEQ_COLOR_BALANCE_INVERSE_GAIN 1
00299 #define SEQ_COLOR_BALANCE_INVERSE_GAMMA 2
00300 #define SEQ_COLOR_BALANCE_INVERSE_LIFT 4
00301 
00302 /* !!! has to be same as IMB_imbuf.h IMB_PROXY_... and IMB_TC_... */
00303 
00304 #define SEQ_PROXY_IMAGE_SIZE_25                 1
00305 #define SEQ_PROXY_IMAGE_SIZE_50                 2
00306 #define SEQ_PROXY_IMAGE_SIZE_75                 4
00307 #define SEQ_PROXY_IMAGE_SIZE_100                8
00308 
00309 #define SEQ_PROXY_TC_NONE                       0
00310 #define SEQ_PROXY_TC_RECORD_RUN                 1
00311 #define SEQ_PROXY_TC_FREE_RUN                   2
00312 #define SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN   4
00313 #define SEQ_PROXY_TC_RECORD_RUN_NO_GAPS         8
00314 #define SEQ_PROXY_TC_ALL                        15
00315 
00316 /* seq->type WATCH IT: SEQ_EFFECT BIT is used to determine if this is an effect strip!!! */
00317 #define SEQ_IMAGE       0
00318 #define SEQ_META        1
00319 #define SEQ_SCENE       2
00320 #define SEQ_MOVIE       3
00321 #define SEQ_RAM_SOUND       4
00322 #define SEQ_HD_SOUND            5
00323 #define SEQ_SOUND       4
00324 
00325 #define SEQ_EFFECT      8
00326 #define SEQ_CROSS       8
00327 #define SEQ_ADD         9
00328 #define SEQ_SUB         10
00329 #define SEQ_ALPHAOVER   11
00330 #define SEQ_ALPHAUNDER  12
00331 #define SEQ_GAMCROSS    13
00332 #define SEQ_MUL         14
00333 #define SEQ_OVERDROP    15
00334 #define SEQ_PLUGIN      24
00335 #define SEQ_WIPE        25
00336 #define SEQ_GLOW        26
00337 #define SEQ_TRANSFORM       27
00338 #define SEQ_COLOR               28
00339 #define SEQ_SPEED               29
00340 #define SEQ_MULTICAM            30
00341 #define SEQ_ADJUSTMENT          31
00342 #define SEQ_EFFECT_MAX          31
00343 
00344 #define STRIPELEM_FAILED       0
00345 #define STRIPELEM_OK           1
00346 
00347 #define STRIPELEM_PREVIEW_DONE  1
00348 
00349 #define SEQ_BLEND_REPLACE      0
00350 /* all other BLEND_MODEs are simple SEQ_EFFECT ids and therefore identical
00351  * to the table above. (Only those effects that handle _exactly_ two inputs,
00352  * otherwise, you can't really blend, right :) !)
00353  */
00354 
00355 
00356 #define SEQ_HAS_PATH(_seq) (ELEM5((_seq)->type, SEQ_MOVIE, SEQ_IMAGE, SEQ_SOUND, SEQ_RAM_SOUND, SEQ_HD_SOUND))
00357 
00358 #endif
00359