diff options
author | Peter Schlaile <peter@schlaile.de> | 2011-05-16 21:14:47 +0400 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2011-05-16 21:14:47 +0400 |
commit | 70b832589a2bb90fbed2106f30d34d77f49d2010 (patch) | |
tree | 847e9fb95d4a8c153963de73c34ef3889a5ac014 /source/blender/blenkernel/intern/seqeffects.c | |
parent | b434e7f93337f65909c003ce865cc34f167c3973 (diff) |
[PATCH] == Sequencer ==
This patch adds adjustment layer tracks to the sequencer and does some cleaning
up of the code.
What's an adjustment layer?
Think of it as an effect track, which takes no explicit input, but alters
the output of everything down the layer stack.
So: you can add several stages of color correction with it.
And: you can even use it with metastrips to group several adjustments together.
Diffstat (limited to 'source/blender/blenkernel/intern/seqeffects.c')
-rw-r--r-- | source/blender/blenkernel/intern/seqeffects.c | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 6f49155c0fd..d2f05a8ca53 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -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) @@ -3256,6 +3333,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; |