Files
test/source/blender/sequencer/intern/render.hh
Aras Pranckevicius 78972f8559 Fix #127192: VSE Tonemap now works as expected on strips that don't cover whole screen
When doing average/min/max luminance calculations for tonemapping, ignore
pixels that are outside of the strip rectangle. Due to how VSE innards work,
when a strip is positioned to not cover the whole screen, "the rest" is filled
with transparent black. For tonemapping, this was dragging average calculated
luminance way down.

Images of the issue in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/127207
2024-09-11 12:42:03 +02:00

64 lines
2.1 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);
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);