diff options
Diffstat (limited to 'source/blender/blenkernel/intern/seqeffects.c')
-rw-r--r-- | source/blender/blenkernel/intern/seqeffects.c | 95 |
1 files changed, 91 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 6f49155c0fd..8c19b0c15c3 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -1582,7 +1582,7 @@ typedef struct WipeZone { static void precalc_wipe_zone(WipeZone *wipezone, WipeVars *wipe, int xo, int yo) { wipezone->flip = (wipe->angle < 0); - wipezone->angle = pow(fabsf(wipe->angle)/45.0f, log(xo)/log(2.0f)); + wipezone->angle = pow(fabsf(wipe->angle)/45.0f, log(xo)/M_LN2); wipezone->xo = xo; wipezone->yo = yo; wipezone->width = (int)(wipe->edgeWidth*((xo+yo)/2.0f)); @@ -2373,7 +2373,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height, /* Blancmange (bmange@airdmhor.gen.nz) */ k = -1.0f/(2.0f*(float)M_PI*blur*blur); - fval=0; + for (ix = 0;ix< halfWidth;ix++){ weight = (float)exp(k*(ix*ix)); filter[halfWidth - ix] = weight; @@ -2859,6 +2859,83 @@ static struct ImBuf * do_multicam( } /* ********************************************************************** + ADJUSTMENT + ********************************************************************** */ + +/* no effect inputs for adjustment, we use give_ibuf_seq */ +static int num_inputs_adjustment(void) +{ + return 0; +} + +static int early_out_adjustment(struct Sequence *UNUSED(seq), float UNUSED(facf0), float UNUSED(facf1)) +{ + return -1; +} + +static struct ImBuf * do_adjustment_impl(SeqRenderData context, Sequence * seq, + float cfra) +{ + Editing * ed; + ListBase * seqbasep; + struct ImBuf * i = 0; + + ed = context.scene->ed; + + seqbasep = seq_seqbase(&ed->seqbase, seq); + + if (seq->machine > 0) { + i = give_ibuf_seqbase(context, cfra, + seq->machine - 1, seqbasep); + } + + /* found nothing? so let's work the way up the metastrip stack, so + that it is possible to group a bunch of adjustment strips into + a metastrip and have that work on everything below the metastrip + */ + + if (!i) { + Sequence * meta; + + meta = seq_metastrip(&ed->seqbase, NULL, seq); + + if (meta) { + i = do_adjustment_impl(context, meta, cfra); + } + } + + return i; +} + +static struct ImBuf * do_adjustment( + SeqRenderData context, Sequence *seq, float cfra, + float UNUSED(facf0), float UNUSED(facf1), + struct ImBuf *UNUSED(ibuf1), struct ImBuf *UNUSED(ibuf2), + struct ImBuf *UNUSED(ibuf3)) +{ + struct ImBuf * i = 0; + struct ImBuf * out; + Editing * ed; + + ed = context.scene->ed; + + if (!ed) { + return NULL; + } + + i = do_adjustment_impl(context, seq, cfra); + + if (input_have_to_preprocess(context, seq, cfra)) { + out = IMB_dupImBuf(i); + IMB_freeImBuf(i); + } else { + out = i; + } + + return out; +} + +/* ********************************************************************** SPEED ********************************************************************** */ static void init_speed_effect(Sequence *seq) @@ -2944,10 +3021,15 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force) /* if not already done, load / initialize data */ get_sequence_effect(seq); - if (!(force || seq->len != v->length || !v->frameMap)) { + if ( (force == FALSE) && + (seq->len == v->length) && + (v->frameMap != NULL) + ) { return; } - if (!seq->seq1) { /* make coverity happy and check for (CID 598) + if ( (seq->seq1 == NULL) || + (seq->len < 1) + ) { /* make coverity happy and check for (CID 598) input strip ... */ return; } @@ -3256,6 +3338,11 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type) rval.early_out = early_out_multicam; rval.execute = do_multicam; break; + case SEQ_ADJUSTMENT: + rval.num_inputs = num_inputs_adjustment; + rval.early_out = early_out_adjustment; + rval.execute = do_adjustment; + break; } return rval; |