Files
2026-08-12 04:47:48 -04:00

99 lines
2.8 KiB
C++

/* SPDX-FileCopyrightText: 2024 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup sequencer
*/
#include "DNA_listBase.h"
#include "BLI_math_vector_types.hh"
#include "BLI_set.hh"
namespace blender {
struct Depsgraph;
struct ImBuf;
struct Mask;
struct RenderData;
struct Scene;
struct SeqTimelineChannel;
struct Strip;
namespace seq {
/* Recursion protection while rendering a single sequencer frame.
* If the same scene or strip is seen, recursion stops. */
struct SeqRenderState {
Set<Scene *> scenes_in_progress;
Set<Strip *> strips_in_progress;
};
/* Strip corner coordinates in screen pixel space. Note that they might not be
* axis aligned when rotation is present. */
struct StripScreenQuad {
float2 v0, v1, v2, v3;
bool is_empty() const
{
return v0 == v1 && v2 == v3 && v0 == v2;
}
};
/**
* Result of rendering a strip: the produced image,
* plus some auxiliary data.
*/
struct SeqResult {
bool is_valid() const
{
return image != nullptr;
}
ImBuf *image = nullptr;
/* How much the resulting image should be translated, in pixels. */
float2 translation = float2(0, 0);
bool is_opaque_before_transform = false;
};
SeqResult seq_render_give_ibuf_seqbase(const RenderData *context,
SeqRenderState *state,
float timeline_frame,
int chan_shown,
ListBaseT<SeqTimelineChannel> *channels,
ListBaseT<Strip> *seqbasep);
SeqResult seq_render_strip(const RenderData *context,
SeqRenderState *state,
Strip *strip,
float timeline_frame);
/* Renders Mask into an image suitable for sequencer:
* RGB channels contain mask intensity; alpha channel is opaque. */
ImBuf *seq_render_mask(Depsgraph *depsgraph,
int width,
int height,
const Mask *mask,
float frame_index,
bool make_float);
/* Converts image to sequencer color space, if needed. */
void ensure_ibuf_is_sequencer_space(const Scene *scene, ImBuf *ibuf, bool make_float);
void seq_imbuf_assign_spaces(const Scene *scene, ImBuf *ibuf);
StripScreenQuad get_strip_screen_quad(const RenderData *context, const Strip *strip);
void convert_multilayer_ibuf(ImBuf *ibuf);
bool seq_image_strip_is_multiview_render(const Scene *scene,
const Strip *strip,
int totfiles,
const char *filepath,
char *r_prefix,
const char *r_ext);
} // namespace seq
} // namespace blender