2024-02-21 20:16:44 +01:00
|
|
|
/* SPDX-FileCopyrightText: 2024 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2020-11-05 13:33:27 +01:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
|
* \ingroup sequencer
|
|
|
|
|
*/
|
|
|
|
|
|
2024-09-11 12:42:03 +02:00
|
|
|
#include "BLI_math_vector_types.hh"
|
2024-02-05 11:37:42 +02:00
|
|
|
#include "BLI_vector.hh"
|
|
|
|
|
|
2020-11-05 13:33:27 +01:00
|
|
|
struct ImBuf;
|
2023-11-14 09:51:41 +01:00
|
|
|
struct LinkNode;
|
2020-11-06 10:29:00 +11:00
|
|
|
struct ListBase;
|
2025-01-07 12:39:13 +01:00
|
|
|
struct Mask;
|
2020-11-05 13:33:27 +01:00
|
|
|
struct Scene;
|
2025-03-06 13:04:39 +01:00
|
|
|
struct RenderData;
|
2025-01-06 14:19:24 +01:00
|
|
|
struct Strip;
|
2020-11-05 13:33:27 +01:00
|
|
|
|
2025-03-06 06:22:14 +01:00
|
|
|
namespace blender::seq {
|
|
|
|
|
|
2025-05-14 12:59:46 +02:00
|
|
|
/* Mutable state while rendering one sequencer frame. */
|
2023-11-14 09:51:41 +01:00
|
|
|
struct SeqRenderState {
|
2024-02-05 11:37:42 +02:00
|
|
|
LinkNode *scene_parents = nullptr;
|
2023-11-14 09:51:41 +01:00
|
|
|
};
|
2020-11-05 13:33:27 +01:00
|
|
|
|
2024-09-11 12:42:03 +02:00
|
|
|
/* Strip corner coordinates in screen pixel space. Note that they might not be
|
|
|
|
|
* axis aligned when rotation is present. */
|
|
|
|
|
struct StripScreenQuad {
|
2025-03-06 06:22:14 +01:00
|
|
|
float2 v0, v1, v2, v3;
|
2024-09-11 12:42:03 +02:00
|
|
|
|
|
|
|
|
bool is_empty() const
|
|
|
|
|
{
|
|
|
|
|
return v0 == v1 && v2 == v3 && v0 == v2;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-03-06 13:04:39 +01:00
|
|
|
ImBuf *seq_render_give_ibuf_seqbase(const RenderData *context,
|
2023-11-14 09:51:41 +01:00
|
|
|
float timeline_frame,
|
|
|
|
|
int chan_shown,
|
|
|
|
|
ListBase *channels,
|
|
|
|
|
ListBase *seqbasep);
|
2024-02-05 11:37:42 +02:00
|
|
|
void seq_imbuf_to_sequencer_space(const Scene *scene, ImBuf *ibuf, bool make_float);
|
2025-05-01 00:22:04 +02:00
|
|
|
blender::Vector<Strip *> seq_shown_strips_get(
|
2024-02-05 11:37:42 +02:00
|
|
|
const Scene *scene, ListBase *channels, ListBase *seqbase, int timeline_frame, int chanshown);
|
2025-03-06 13:04:39 +01:00
|
|
|
ImBuf *seq_render_strip(const RenderData *context,
|
2023-11-14 09:51:41 +01:00
|
|
|
SeqRenderState *state,
|
2025-01-07 14:09:45 +01:00
|
|
|
Strip *strip,
|
2023-11-14 09:51:41 +01:00
|
|
|
float timeline_frame);
|
2024-12-06 18:43:52 +01:00
|
|
|
|
|
|
|
|
/* Renders Mask into an image suitable for sequencer:
|
|
|
|
|
* RGB channels contain mask intensity; alpha channel is opaque. */
|
2025-03-06 13:04:39 +01:00
|
|
|
ImBuf *seq_render_mask(const RenderData *context, Mask *mask, float frame_index, bool make_float);
|
2024-02-05 11:37:42 +02:00
|
|
|
void seq_imbuf_assign_spaces(const Scene *scene, ImBuf *ibuf);
|
2024-09-11 12:42:03 +02:00
|
|
|
|
2025-03-06 13:04:39 +01:00
|
|
|
StripScreenQuad get_strip_screen_quad(const RenderData *context, const Strip *strip);
|
2025-03-06 06:22:14 +01:00
|
|
|
|
|
|
|
|
} // namespace blender::seq
|