Cleanup: Subdiv: Remove common_ prefix
[blender.git] / source / blender / sequencer / SEQ_effects.hh
blob68a175ab16bd3d436878bd2b08ffb634d9df5fe3
1 /* SPDX-FileCopyrightText: 2004 Blender Authors
3 * SPDX-License-Identifier: GPL-2.0-or-later */
5 #pragma once
7 #include "DNA_vec_types.h"
9 #include "BLI_math_vector_types.hh"
10 #include "BLI_vector.hh"
12 /** \file
13 * \ingroup sequencer
16 struct ImBuf;
17 struct Scene;
18 struct SeqRenderData;
19 struct Strip;
20 struct TextVars;
22 enum class StripEarlyOut {
23 NoInput = -1, /* No input needed. */
24 DoEffect = 0, /* No early out (do the effect). */
25 UseInput1 = 1, /* Output = input1. */
26 UseInput2 = 2, /* Output = input2. */
29 /* Wipe effect */
30 enum {
31 DO_SINGLE_WIPE,
32 DO_DOUBLE_WIPE,
33 /* DO_BOX_WIPE, */ /* UNUSED */
34 /* DO_CROSS_WIPE, */ /* UNUSED */
35 DO_IRIS_WIPE,
36 DO_CLOCK_WIPE,
39 struct SeqEffectHandle {
40 /* constructors & destructor */
41 /* init is _only_ called on first creation */
42 void (*init)(Strip *strip);
44 /* number of input strips needed
45 * (called directly after construction) */
46 int (*num_inputs)();
48 /* load is called first time after readblenfile in
49 * get_sequence_effect automatically */
50 void (*load)(Strip *seqconst);
52 /* duplicate */
53 void (*copy)(Strip *dst, const Strip *src, int flag);
55 /* destruct */
56 void (*free)(Strip *strip, bool do_id_user);
58 StripEarlyOut (*early_out)(const Strip *strip, float fac);
60 /* sets the default `fac` value */
61 void (*get_default_fac)(const Scene *scene,
62 const Strip *strip,
63 float timeline_frame,
64 float *fac);
66 /* execute the effect */
67 ImBuf *(*execute)(const SeqRenderData *context,
68 Strip *strip,
69 float timeline_frame,
70 float fac,
71 ImBuf *ibuf1,
72 ImBuf *ibuf2);
75 SeqEffectHandle SEQ_effect_handle_get(Strip *strip);
76 int SEQ_effect_get_num_inputs(int strip_type);
77 void SEQ_effect_text_font_unload(TextVars *data, bool do_id_user);
78 void SEQ_effect_text_font_load(TextVars *data, bool do_id_user);
79 bool SEQ_effects_can_render_text(const Strip *strip);
81 namespace blender::seq {
83 struct CharInfo {
84 int index = 0;
85 const char *str_ptr = nullptr;
86 int byte_length = 0;
87 float2 position{0.0f, 0.0f};
88 int advance_x = 0;
89 bool do_wrap = false;
92 struct LineInfo {
93 Vector<CharInfo> characters;
94 int width;
97 struct TextVarsRuntime {
98 Vector<LineInfo> lines;
100 rcti text_boundbox; /* Bound-box used for box drawing and selection. */
101 int line_height;
102 int font_descender;
103 int character_count;
104 int font;
105 bool editing_is_active; /* UI uses this to differentiate behavior. */
108 } // namespace blender::seq