If a strip mask was used several times in the same frame, and it needed to do byte->float conversion (e.g. mask is produced by a byte-color strip, but then used in both a byte-color strip, and later on in a float-color strip), then that byte->float mask image conversion was introducing two inconsistencies: - It was making mask alpha channel affect the result, which was not happening with regular byte mask images, and - It was converting float mask to scene linear space, which was resulting in different image than with a byte mask. Fix those issues by ensuring that all VSE modifiers can take either byte or float mask as-is, without extra conversions. Previously, some of the modifiers were done in a way where they only handled "(byte image + byte mask) or (float image + float mask)" cases. Pull Request: https://projects.blender.org/blender/blender/pulls/131355
67 lines
2.2 KiB
C++
67 lines
2.2 KiB
C++
/* SPDX-FileCopyrightText: 2024 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#pragma once
|
|
|
|
/** \file
|
|
* \ingroup sequencer
|
|
*/
|
|
|
|
#include "BLI_math_vector_types.hh"
|
|
#include "BLI_vector.hh"
|
|
|
|
struct ImBuf;
|
|
struct LinkNode;
|
|
struct ListBase;
|
|
struct Scene;
|
|
struct SeqEffectHandle;
|
|
struct SeqRenderData;
|
|
struct Sequence;
|
|
|
|
/* mutable state for sequencer */
|
|
struct SeqRenderState {
|
|
LinkNode *scene_parents = nullptr;
|
|
};
|
|
|
|
/* Strip corner coordinates in screen pixel space. Note that they might not be
|
|
* axis aligned when rotation is present. */
|
|
struct StripScreenQuad {
|
|
blender::float2 v0, v1, v2, v3;
|
|
|
|
bool is_empty() const
|
|
{
|
|
return v0 == v1 && v2 == v3 && v0 == v2;
|
|
}
|
|
};
|
|
|
|
ImBuf *seq_render_give_ibuf_seqbase(const SeqRenderData *context,
|
|
float timeline_frame,
|
|
int chan_shown,
|
|
ListBase *channels,
|
|
ListBase *seqbasep);
|
|
ImBuf *seq_render_effect_execute_threaded(SeqEffectHandle *sh,
|
|
const SeqRenderData *context,
|
|
Sequence *seq,
|
|
float timeline_frame,
|
|
float fac,
|
|
ImBuf *ibuf1,
|
|
ImBuf *ibuf2);
|
|
void seq_imbuf_to_sequencer_space(const Scene *scene, ImBuf *ibuf, bool make_float);
|
|
blender::Vector<Sequence *> seq_get_shown_sequences(
|
|
const Scene *scene, ListBase *channels, ListBase *seqbase, int timeline_frame, int chanshown);
|
|
ImBuf *seq_render_strip(const SeqRenderData *context,
|
|
SeqRenderState *state,
|
|
Sequence *seq,
|
|
float timeline_frame);
|
|
|
|
/* Renders Mask into an image suitable for sequencer:
|
|
* RGB channels contain mask intensity; alpha channel is opaque. */
|
|
ImBuf *seq_render_mask(const SeqRenderData *context,
|
|
Mask *mask,
|
|
float frame_index,
|
|
bool make_float);
|
|
void seq_imbuf_assign_spaces(const Scene *scene, ImBuf *ibuf);
|
|
|
|
StripScreenQuad get_strip_screen_quad(const SeqRenderData *context, const Sequence *seq);
|