- saturation option for sequencer strips, runs before multiply and color balance.

- multiply of 0.0 wasnt being applied.
This commit is contained in:
2010-07-13 09:28:01 +00:00
parent ef76dfd591
commit 291c99c5d9
6 changed files with 43 additions and 6 deletions

View File

@@ -745,6 +745,7 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel):
col = layout.column()
col.label(text="Colors:")
col.prop(strip, "color_saturation", text="Saturation")
col.prop(strip, "multiply_colors", text="Multiply")
col.prop(strip, "premultiply")
col.prop(strip, "convert_float")

View File

@@ -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;

View File

@@ -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! */

View File

@@ -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. */

View File

@@ -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");

View File

@@ -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)