diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-13 13:28:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-13 13:28:01 +0400 |
commit | 291c99c5d9fd25e69a17a150ee86d3261987cf34 (patch) | |
tree | e2749395b6ea4875c315fb6cf90b0ce8dd6c71e8 /source/blender | |
parent | ef76dfd591f2643a86bf0f92f282f95724ca2fa7 (diff) |
- saturation option for sequencer strips, runs before multiply and color balance.
- multiply of 0.0 wasnt being applied.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 29 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 9 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 7 | ||||
-rw-r--r-- | source/blender/makesrna/rna_cleanup/rna_properties.txt | 2 |
5 files changed, 42 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 1ab4e75ee06..69dd4b3a1b7 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1769,12 +1769,31 @@ static void input_preprocess(Scene *scene, Sequence *seq, TStripElem *se, int cf if(seq->flag & SEQ_FLIPX) { IMB_flipx(se->ibuf); } - if(seq->flag & SEQ_FLIPY) { - IMB_flipy(se->ibuf); - } - if(seq->mul == 0.0) { - seq->mul = 1.0; + if(seq->sat != 1.0f) { + /* inline for now, could become an imbuf function */ + int i; + char *rct= (char *)se->ibuf->rect; + float *rctf= se->ibuf->rect_float; + const float sat= seq->sat; + float hsv[3]; + + if(rct) { + float rgb[3]; + for (i = se->ibuf->x * se->ibuf->y; i > 0; i--, rct+=4) { + rgb_byte_to_float(rct, rgb); + rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); + hsv_to_rgb(hsv[0], hsv[1] * sat, hsv[2], rgb, rgb+1, rgb+2); + rgb_float_to_byte(rgb, rct); + } + } + + if(rctf) { + for (i = se->ibuf->x * se->ibuf->y; i > 0; i--, rctf+=4) { + rgb_to_hsv(rctf[0], rctf[1], rctf[2], hsv, hsv+1, hsv+2); + hsv_to_rgb(hsv[0], hsv[1] * sat, hsv[2], rctf, rctf+1, rctf+2); + } + } } mul = seq->mul; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 31627141235..4309163fe7a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10953,6 +10953,15 @@ static void do_versions(FileData *fd, Library *lib, Main *main) tex->saturation= 1.0f; } + for (scene= main->scene.first; scene; scene=scene->id.next) { + if(scene) { + Sequence *seq; + SEQ_BEGIN(scene->ed, seq) { + seq->sat= 1.0f; + } + SEQ_END + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 3ab7cb73d56..a5299ef081d 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -140,6 +140,7 @@ typedef struct Sequence { int startstill, endstill; int machine, depth; /*machine - the strip channel, depth - the depth in the sequence when dealing with metastrips */ int startdisp, enddisp; /*starting and ending points in the sequence*/ + float sat, pad; float mul, handsize; /* is sfra needed anymore? - it looks like its only used in one place */ int sfra; /* starting frame according to the timeline of the scene. */ diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 9e00dc26008..f46efb675ca 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -992,6 +992,13 @@ static void rna_def_filter_video(StructRNA *srna) RNA_def_property_ui_text(prop, "Multiply Colors", ""); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + prop= RNA_def_property(srna, "color_saturation", PROP_FLOAT, PROP_UNSIGNED); + RNA_def_property_float_sdna(prop, NULL, "sat"); + RNA_def_property_range(prop, 0.0f, 20.0f); + RNA_def_property_ui_range(prop, 0.0f, 2.0f, 3, 3); + RNA_def_property_ui_text(prop, "Saturation", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + prop= RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 1.0f, 30.0f); RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame"); diff --git a/source/blender/makesrna/rna_cleanup/rna_properties.txt b/source/blender/makesrna/rna_cleanup/rna_properties.txt index e7ad37b0d72..0c0b7e1070b 100644 --- a/source/blender/makesrna/rna_cleanup/rna_properties.txt +++ b/source/blender/makesrna/rna_cleanup/rna_properties.txt @@ -599,7 +599,7 @@ EditObjectActuator.time -> time: int Duration the new Object lives or the EditObjectActuator.track_object -> track_object: pointer Track to this Object EffectSequence.color_balance -> color_balance: pointer, (read-only) EffectSequence.crop -> crop: pointer, (read-only) -EffectSequence.multiply_colors -> multiply_colors: float +EffectSequence.multiply_colors -> color_multiply: float EffectSequence.proxy -> proxy: pointer, (read-only) EffectSequence.strobe -> strobe: float Only display every nth frame EffectSequence.transform -> transform: pointer, (read-only) |