Merge branch 'blender-v4.0-release'

This commit is contained in:
Campbell Barton 2023-10-23 12:22:52 +11:00
commit a60de8a940
4 changed files with 16 additions and 3 deletions

View File

@ -2256,6 +2256,7 @@ class SEQUENCER_PT_adjust_color(SequencerButtonsPanel, Panel):
col = layout.column()
col.prop(strip, "color_saturation", text="Saturation")
col.prop(strip, "color_multiply", text="Multiply")
col.prop(strip, "multiply_alpha")
col.prop(strip, "use_float", text="Convert to Float")

View File

@ -613,7 +613,7 @@ enum {
SEQ_AUTO_PLAYBACK_RATE = (1 << 17),
SEQ_SINGLE_FRAME_CONTENT = (1 << 18),
SEQ_SHOW_RETIMING = (1 << 19),
SEQ_FLAG_UNUSED_21 = (1 << 21), /* cleared */
SEQ_MULTIPLY_ALPHA = (1 << 21),
SEQ_USE_EFFECT_DEFAULT_FADE = (1 << 22),
SEQ_USE_LINEAR_MODIFIERS = (1 << 23),

View File

@ -2625,6 +2625,11 @@ static void rna_def_filter_video(StructRNA *srna)
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "multiply_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_MULTIPLY_ALPHA);
RNA_def_property_ui_text(prop, "Multiply Alpha", "Multiply alpha along with color channels");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "color_saturation", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, nullptr, "sat");
RNA_def_property_range(prop, 0.0f, 20.0f);

View File

@ -571,7 +571,7 @@ static void sequencer_preprocess_transform_crop(
}
}
static void multibuf(ImBuf *ibuf, const float fmul)
static void multibuf(ImBuf *ibuf, const float fmul, const bool multiply_alpha)
{
uchar *rt;
float *rt_float;
@ -588,6 +588,9 @@ static void multibuf(ImBuf *ibuf, const float fmul)
rt[0] = min_ii((imul * rt[0]) >> 8, 255);
rt[1] = min_ii((imul * rt[1]) >> 8, 255);
rt[2] = min_ii((imul * rt[2]) >> 8, 255);
if (multiply_alpha) {
rt[3] = min_ii((imul * rt[3]) >> 8, 255);
}
rt += 4;
}
@ -598,6 +601,9 @@ static void multibuf(ImBuf *ibuf, const float fmul)
rt_float[0] *= fmul;
rt_float[1] *= fmul;
rt_float[2] *= fmul;
if (multiply_alpha) {
rt_float[3] *= fmul;
}
rt_float += 4;
}
@ -669,7 +675,8 @@ static ImBuf *input_preprocess(const SeqRenderData *context,
}
if (mul != 1.0f) {
multibuf(preprocessed_ibuf, mul);
const bool multiply_alpha = (seq->flag & SEQ_MULTIPLY_ALPHA);
multibuf(preprocessed_ibuf, mul, multiply_alpha);
}
if (seq->modifiers.first) {