96 ListBaseT<SeqTimelineChannel> *channels,
97 ListBaseT<Strip> *seqbasep,
131 if (!make_float &&
STREQ(from_colorspace, to_colorspace)) {
151 if (from_colorspace ==
nullptr || from_colorspace[0] ==
'\0') {
195 Depsgraph *depsgraph,
203 r_context->
bmain = bmain;
205 r_context->
scene = scene;
206 r_context->
rectx = rectx;
207 r_context->
recty = recty;
231 if (frame_index == -1 || se ==
nullptr) {
235 se += frame_index + strip->anim_startofs;
242 Scene *scene = context->scene;
243 const int x = context->rectx;
244 const int y = context->recty;
245 const float2 offset{
x * 0.5f,
y * 0.5f};
364 mul *= strip->blend_opacity / 100.0f;
371 if (strip->sat != 1.0f) {
375 if (strip->modifiers.first_) {
390 if (is_proxy_image) {
421 const float image_scale_factor,
422 const float preview_scale_factor)
436 const float rotation =
transform->rotation;
450 float2(in_size) / 2.0f +
float2((out_size - in_size) / 2));
453 return center_in_canvas * user_transforms * resize * center_image;
458 float crop_scale_factor,
462 const int left = c->
left * crop_scale_factor;
463 const int right = c->
right * crop_scale_factor;
464 const int top = c->
top * crop_scale_factor;
465 const int bottom = c->
bottom * crop_scale_factor;
475 const float crop_scale_factor)
485 const float2 center(context->rectx * 0.5f, context->recty * 0.5f);
487 float2(context->scene->r.xasp / context->scene->r.yasp, 1.0f);
488 const auto to_screen = [&](
const float2 point) {
495 if (
math::cross(actual_quad.
v1 - actual_quad.
v0, actual_quad.
v3 - actual_quad.
v0) == 0.0f) {
510 float x1 =
float(context->rectx);
511 float y1 =
float(context->recty);
512 float x_aspect = context->scene->r.xasp / context->scene->r.yasp;
513 if (x_aspect != 1.0f) {
514 float xmid = (x0 + x1) * 0.5f;
515 x0 = xmid - (xmid - x0) * x_aspect;
516 x1 = xmid + (x1 - xmid) * x_aspect;
536 if (sx > 2.0f && sy > 2.0f) {
539 if (sx < 0.5f && sy < 0.5f) {
545 if (sx == 1.0f && sy == 1.0f &&
roundf(px) == px &&
roundf(py) == py &&
rot == 0.0f) {
556 const bool scale_crop_values,
557 const float preview_scale_factor)
562 const float crop_scale_factor = scale_crop_values ? preview_scale_factor : 1.0f;
591 out->color_mode =
in->color_mode;
603 "Sequencer only supports 4 channel images");
608 const int imul = int(256.0f * fmul);
609 for ([[maybe_unused]]
const int64_t i : range) {
610 ptr[0] =
min_ii((imul * ptr[0]) >> 8, 255);
611 ptr[1] =
min_ii((imul * ptr[1]) >> 8, 255);
612 ptr[2] =
min_ii((imul * ptr[2]) >> 8, 255);
613 if (multiply_alpha) {
614 ptr[3] =
min_ii((imul * ptr[3]) >> 8, 255);
623 float *ptr = float_data + range.
first() * 4;
624 for ([[maybe_unused]]
const int64_t i : range) {
628 if (multiply_alpha) {
640 float timeline_frame,
642 const bool is_proxy_image)
650 Scene *scene = context->scene;
663 if (strip->sat != 1.0f) {
672 if (!
result.image->float_data()) {
676 if (
result.image->byte_data()) {
681 float mul = strip->mul;
683 mul *= strip->blend_opacity / 100.0f;
692 if (multiply_alpha && mul < 1.0f) {
699 const float image_scale_factor = do_scale_to_render_size ? preview_scale_factor : 1.0f;
701 if (strip->modifiers.first_) {
706 int2(context->rectx, context->recty),
708 preview_scale_factor);
710 scene, strip,
int2(0),
int2(0), image_scale_factor, preview_scale_factor);
713 *context, *
state, *strip, matrix, matrix_comp, timeline_frame,
result);
718 context->rectx !=
result.image->x ||
719 context->recty !=
result.image->y ||
720 (strip->is_effect() && image_scale_factor != 1.0f) ||
724 const float3x3 matrix = do_transform ?
728 int2(context->rectx, context->recty),
730 preview_scale_factor) *
735 result.is_opaque_before_transform = !
result.image->can_contain_alpha() &&
741 do_scale_to_render_size ? 1.0f : preview_scale_factor);
746 const int x = context->rectx;
747 const int y = context->recty;
756 !do_scale_to_render_size,
757 preview_scale_factor);
758 if (!
result.is_opaque_before_transform) {
765 result.image = transformed_ibuf;
787 float timeline_frame,
789 const bool is_proxy_image)
792 if (input.
image->
x != context->rectx || input.
image->
y != context->recty ||
795 use_preprocess =
true;
799 const bool is_effect_with_inputs = strip->is_effect_with_inputs() ||
801 if (!is_proxy_image && !is_effect_with_inputs) {
808 if (!use_preprocess) {
818 float timeline_frame)
822 Scene *scene = context->scene;
825 Strip *input[2] = {strip->input1, strip->input2};
843 for (
int i = 0; i < 2; i++) {
847 scene, strip, timeline_frame, i);
852 target_frame = std::floor(target_frame);
860 context->render !=
nullptr);
870 if (ibuf[0].is_valid() && (ibuf[1].is_valid() || strip->effect_num_inputs_get() == 1)) {
871 out = sh.
execute(context,
state, strip, timeline_frame, fac, ibuf[0], ibuf[1]);
886 for (
int i = 0; i < 2; i++) {
890 if (!
out.is_valid()) {
905 if (ibuf ==
nullptr) {
924 const RenderData *context,
Strip *strip,
const char *filepath,
const char *prefix,
int view_id)
926 ImBuf *ibuf =
nullptr;
933 if (prefix[0] ==
'\0') {
939 *context->scene, filepath, view_id, filepath_view,
sizeof(filepath_view),
nullptr))
946 if (ibuf ==
nullptr) {
961 const char *filepath,
979 const char *ext =
nullptr;
981 return r_prefix[0] !=
'\0';
986 if (context->ignore_missing_media) {
989 if (context->scene ==
nullptr || context->scene->ed ==
nullptr ||
996 float col[4] = {0.85f, 0.0f, 0.75f, 1.0f};
1004 bool *r_is_proxy_image)
1010 ImBuf *ibuf =
nullptr;
1013 if (s_elem ==
nullptr) {
1022 if (ibuf !=
nullptr) {
1023 *r_is_proxy_image =
true;
1029 context->scene, strip, filepath, prefix);
1031 if (do_multiview_render) {
1036 for (
int view_id = 0; view_id < totfiles; view_id++) {
1040 if (ibufs_arr[0] ==
nullptr) {
1052 ibuf = ibufs_arr[context->view_id];
1053 for (
ImBuf *ib : ibufs_arr) {
1064 if (ibuf ==
nullptr) {
1081 if (proxy->
anim ==
nullptr) {
1088 if (proxy->
anim ==
nullptr) {
1094 strip->anim_startofs;
1103 float timeline_frame,
1105 bool *r_is_proxy_image)
1107 ImBuf *ibuf =
nullptr;
1120 ibuf = reader.
decode_frame(frame_index + strip->anim_startofs, psize);
1123 if (ibuf !=
nullptr) {
1124 *r_is_proxy_image =
true;
1129 if (ibuf ==
nullptr) {
1132 if (ibuf ==
nullptr) {
1146 float timeline_frame,
1147 bool *r_is_proxy_image)
1151 ImBuf *ibuf =
nullptr;
1152 const bool use_multiview = (strip->flag &
SEQ_USE_VIEWS) != 0 &&
1154 const int totfiles = use_multiview ?
1160 strip->anim_startofs;
1165 float source_fps = 0.0f;
1168 bool do_multiview_render =
false;
1169 if (use_multiview && totfiles > 0) {
1174 readers[0].uses_multiview_filepath();
1179 bool all_readers_open = bool(readers[0]);
1180 for (
int view_id = 1; view_id < totfiles && all_readers_open; view_id++) {
1182 cache_scene, *context->scene, *strip, view_id, frame_index));
1183 all_readers_open = bool(readers.
last());
1185 if (!all_readers_open) {
1187 do_multiview_render =
false;
1192 if (do_multiview_render) {
1200 context, strip, timeline_frame, reader, r_is_proxy_image);
1201 if (ibuf_view_id == 0) {
1208 if (ibuf_arr[0] ==
nullptr) {
1220 ibuf = ibuf_arr[context->view_id];
1221 for (
ImBuf *ib : ibuf_arr) {
1233 reader = std::move(readers[0]);
1242 if (ibuf ==
nullptr) {
1244 context, strip->
data->stripdata->orig_width, strip->
data->stripdata->orig_height);
1247 if (*r_is_proxy_image ==
false) {
1248 if (source_fps != 0.0f) {
1249 strip->
data->stripdata->orig_fps = source_fps;
1251 strip->
data->stripdata->orig_width = ibuf->
x;
1252 strip->
data->stripdata->orig_height = ibuf->
y;
1260 ImBuf *ibuf =
nullptr;
1261 float tloc[2], tscale, tangle;
1276 bool *r_is_proxy_image)
1280 ImBuf *ibuf =
nullptr;
1289 frame_index + strip->anim_startofs + strip->clip->start_frame);
1319 *r_is_proxy_image =
true;
1323 if (ibuf ==
nullptr) {
1342 Mask *mask_temp = id_cast<Mask *>(
1350 depsgraph,
mask->sfra + frame_index);
1364 const float x_inv = 1.0f /
float(width);
1365 const float y_inv = 1.0f /
float(height);
1366 const float x_px_ofs = x_inv * 0.5f;
1367 const float y_px_ofs = y_inv * 0.5f;
1371 const int64_t pixel_offset = y_range.
first() * width * 4;
1372 float *ptr_float = dst_float + pixel_offset;
1373 uchar *ptr_byte = dst_byte + pixel_offset;
1376 coord.y =
y * y_inv + y_px_ofs;
1377 for (
int x = 0;
x < width;
x++) {
1378 coord.x =
x * x_inv + x_px_ofs;
1381 ptr_float[0] = ptr_float[1] = ptr_float[2] = value;
1382 ptr_float[3] = 1.0f;
1385 ptr_byte[0] = ptr_byte[1] = ptr_byte[2] =
uchar(value * 255.0f);
1406 context->depsgraph, context->rectx, context->recty, strip->mask, frame_index, make_float);
1411 if (strip->scene_view_layer_name !=
nullptr) {
1445 Depsgraph *depsgraph,
1464 if (use_scene_settings) {
1466 if (display_scene->
world !=
nullptr) {
1481 char err_out[256] =
"unknown";
1496 if (ibuf ==
nullptr) {
1497 fprintf(stderr,
"VSE failed to render scene strip image: %s\n", err_out);
1528 float timeline_frame)
1530 ImBuf *ibuf =
nullptr;
1545 Scene *scene = strip->scene;
1549 if (scene == context->scene) {
1553 const bool is_rendering =
G.is_rendering;
1554 const bool is_preview = !context->render && (context->scene->r.seq_prev_type) !=
OB_RENDER;
1555 const float frame =
float(scene->
r.sfra) + frame_index +
float(strip->anim_startofs);
1562 if (strip->scene_camera) {
1563 camera = strip->scene_camera;
1579 if (have_comp ==
false &&
camera ==
nullptr) {
1589 if (is_viewport_render) {
1595 if (context->scene->r.seq_prev_type == 0) {
1596 context->scene->r.seq_prev_type =
OB_SOLID;
1604 eDrawType(context->scene->r.seq_prev_type),
1608 context->gpu_offscreen,
1609 context->gpu_viewport);
1625 if (is_preview && (is_rendering && !
G.background)) {
1631 if (re ==
nullptr) {
1635 const float subframe = frame -
floorf(frame);
1642 have_comp ?
nullptr : view_layer,
1651 G.is_rendering = is_rendering;
1653 for (
int view_id = 0; view_id < totviews; view_id++) {
1657 localcontext.
view_id = view_id;
1673 if (view_id != context->view_id) {
1684 ibuf = ibufs_arr[context->view_id].image;
1686 if (res.image != ibuf) {
1696 Main *bmain,
Scene *timeline_scene,
const Strip *strip,
float frame_index,
int size)
1698 if (
view3d_fn ==
nullptr ||
G.is_rendering) {
1701 Scene *scene = strip->scene;
1702 if (
ELEM(scene,
nullptr, timeline_scene)) {
1709 if (width <= 0 || height <= 0) {
1720 const float frame =
float(scene->
r.sfra) + frame_index;
1724 if (strip->scene_camera) {
1725 camera = strip->scene_camera;
1757 float timeline_frame)
1762 if (strip->scene ==
nullptr) {
1769 if (
out.image && !
out.image->can_contain_alpha()) {
1770 out.is_opaque_before_transform =
true;
1784 ListBaseT<Strip> *seqbase =
nullptr;
1785 ListBaseT<SeqTimelineChannel> *channels =
nullptr;
1790 if (seqbase && !seqbase->is_empty()) {
1792 frame_index += offset;
1797 context->depsgraph, frame_index);
1811 context->render !=
nullptr);
1833 float timeline_frame,
1834 bool *r_is_proxy_image)
1837 float frame_index =
give_frame_index(context->scene, strip, timeline_frame);
1840 out.is_opaque_before_transform =
out.image && !
out.image->can_contain_alpha();
1844 if (!
state->scenes_in_progress.contains(strip->scene)) {
1845 state->scenes_in_progress.add(context->scene);
1848 if (strip->scene && (context->scene != strip->scene)) {
1852 local_context.
scene = strip->scene;
1864 state->scenes_in_progress.remove(context->scene);
1867 else if (strip->is_effect()) {
1872 if (
out.image && !
out.image->can_contain_alpha()) {
1873 out.is_opaque_before_transform =
true;
1878 if (
out.image && !
out.image->can_contain_alpha()) {
1879 out.is_opaque_before_transform =
true;
1885 if (
out.image && !
out.image->can_contain_alpha()) {
1886 out.is_opaque_before_transform =
true;
1906 float timeline_frame)
1910 bool use_preprocess =
false;
1911 bool is_proxy_image =
false;
1930 context,
state, strip, res, timeline_frame, use_preprocess, is_proxy_image);
1949 float fac = strip->blend_opacity / 100.0f;
1970 float timeline_frame,
1976 float fac = strip->blend_opacity / 100.0f;
1984 swap_input ? src2 : src1,
1985 swap_input ? src1 : src2);
1994 if (strip->blend_opacity < 100.0f) {
2002 (!context->render &&
2015 ListBaseT<SeqTimelineChannel> *channels,
2016 ListBaseT<Strip> *seqbasep,
2017 float timeline_frame,
2022 context->scene, channels, seqbasep, timeline_frame, chanshown);
2031 for (i = strips.
size() - 1; i >= 0; i--) {
2032 Strip *strip = strips[i];
2035 if (
out.is_valid()) {
2074 switch (early_out) {
2098 context,
state, strip, timeline_frame, ibuf1, ibuf2);
2109 if (
out.is_valid()) {
2115 for (; i < strips.
size(); i++) {
2116 Strip *strip = strips[i];
2127 context,
state, strip, timeline_frame, ibuf1, ibuf2);
2141 Scene *scene = context->scene;
2143 ListBaseT<Strip> *seqbasep;
2144 ListBaseT<SeqTimelineChannel> *channels;
2146 if (
ed ==
nullptr) {
2150 if ((chanshown < 0) && !
ed->metastack.is_empty()) {
2151 int count =
ed->metastack.count();
2152 count =
max_ii(count + chanshown, 0);
2159 seqbasep =
ed->current_strips();
2160 channels =
ed->current_channels();
2168 context->render !=
nullptr);
2172 if (!context->skip_cache) {
2177 {context->rectx, context->recty},
2178 context->render !=
nullptr);
2182 scene, channels, seqbasep, timeline_frame, chanshown);
2202 {context->rectx, context->recty},
2203 context->render !=
nullptr,
2215 float timeline_frame,
2217 ListBaseT<SeqTimelineChannel> *channels,
2218 ListBaseT<Strip> *seqbasep)
2236 context->render !=
nullptr);
2244 return strip->flag &
SEQ_MUTE || channel->is_muted();
2263 if (active_ctx !=
nullptr) {
2283 if (!render_ghost_context) {
#define BLI_path_join(...)
#define ID_BLEND_PATH_FROM_GLOBAL(_id)
Read Blender memory allocation and freeing.
#define PRF_scope_with_name(ui_name, category)
#define BLI_assert_msg(a, msg)
constexpr int64_t first() const
constexpr IndexRange()=default
void append(const T &value)
const T & last(const int64_t n=0) const
IndexRange index_range() const
const T & data(const Action &owning_action) const
SequencerRuntime sequencer
ImBuf * decode_frame(int frame_index, IMB_Proxy_Size proxy_size)
void camera(KernelGlobals &kg, const ShadingData &sd, float3 &outview, float &outdepth, float &outdist)
float3x3 scale(float3x3 mat, float2 scale)
bool is_enabled(const Scene &scene, ExecutionMode mode)
void GPU_activate_secondary_context(const GPUSecondaryContextData &data)
void GPU_deactivate_secondary_context(const GPUSecondaryContextData &data)
CartesianBasis invert(const CartesianBasis &basis)
AxisSigned cross(const AxisSigned a, const AxisSigned b)
MatT from_scale(const VecBase< typename MatT::base_type, ScaleDim > &scale)
MatT from_origin_transform(const MatT &transform, const VectorT origin)
MatT from_location(const typename MatT::loc_type &location)
MatT from_loc_rot_scale(const typename MatT::loc_type &location, const RotationT &rotation, const VecBase< typename MatT::base_type, ScaleDim > &scale)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
void ensure_ibuf_is_sequencer_space(const Scene *scene, ImBuf *ibuf, bool make_float)
static ImBuf * seq_render_image_strip_view(const RenderData *context, Strip *strip, const char *filepath, const char *prefix, int view_id)
EffectHandle strip_blend_mode_handle_get(Strip *strip)
void source_image_cache_put(const RenderData *context, const Strip *strip, float timeline_frame, const SeqResult &image)
SeqResult intra_frame_cache_get_preprocessed(Scene *scene, const Strip *strip)
static ImBuf * seq_render_movie_strip(const RenderData *context, Strip *strip, float timeline_frame, bool *r_is_proxy_image)
MovieReaderAccessor movie_reader_cache_acquire_view(Scene &cache_scene, const Scene &key_scene, const Strip &strip, const int view_id, const int frame_index)
bool seq_strip_do_multiview_render(const Scene *scene, const Strip *strip, const char *filepath, char *r_prefix)
ImBuf *(*)(Depsgraph *, Scene *, View3DShading *, eDrawType, Object *, int, int, ImBufFlags, eV3DOffscreenDrawFlag, int, const char *, GPUOffScreen *, GPUViewport *, char *) DrawViewFn
float2 image_transform_mirror_factor_get(const Strip *strip)
void ensure_ibuf_is_rgba(ImBuf *ibuf)
static SeqResult seq_render_strip_stack_apply_effect(const RenderData *context, SeqRenderState *state, Strip *strip, float timeline_frame, const SeqResult &src1, const SeqResult &src2)
EffectHandle strip_effect_handle_get(Strip *strip)
static SeqResult seq_render_effect_strip_impl(const RenderData *context, SeqRenderState *state, Strip *strip, float timeline_frame)
ImBuf * render_scene_strip_thumbnail(Main *bmain, Scene *timeline_scene, const Strip *strip, float frame_index, int size)
ImBuf * render_give_ibuf(const RenderData *context, float timeline_frame, int chanshown)
void movie_reader_cache_timestamp_bump()
void intra_frame_cache_put_composite(Scene *scene, const Strip *strip, const SeqResult &result)
bool seq_proxy_get_custom_file_filepath(const Strip *strip, char *filepath, const int view_id)
IMB_Proxy_Size rendersize_to_proxysize(eSpaceSeq_Proxy_RenderSize render_size)
static SeqResult seq_render_strip_stack(const RenderData *context, SeqRenderState *state, ListBaseT< SeqTimelineChannel > *channels, ListBaseT< Strip > *seqbasep, float timeline_frame, int chanshown)
float give_frame_index(const Scene *scene, const Strip *strip, float timeline_frame)
static SeqResult seq_render_scene_strip(const RenderData *context, Strip *strip, float frame_index, float timeline_frame)
Array< float2 > image_transform_quad_get(const Scene *scene, const Strip *strip)
static bool is_opaque_alpha_over(const Strip *strip, const RenderData *context)
bool render_is_muted(const ListBaseT< SeqTimelineChannel > *channels, const Strip *strip)
static bool seq_must_swap_input_in_blend_mode(Strip *strip)
Editing * editing_get(const Scene *scene)
static void ensure_ibuf_is_color_space(ImBuf *ibuf, bool make_float, const char *to_colorspace)
static ImBuf * seq_render_image_strip(const RenderData *context, Strip *strip, int timeline_frame, bool *r_is_proxy_image)
static Depsgraph * get_depsgraph_for_scene_strip(Main *bmain, Scene *scene, ViewLayer *view_layer)
SeqResult seq_render_strip(const RenderData *context, SeqRenderState *state, Strip *strip, float timeline_frame)
ImBuf * seq_proxy_fetch(const RenderData *context, Strip *strip, int timeline_frame)
float get_render_scale_factor(eSpaceSeq_Proxy_RenderSize render_size, short scene_render_scale)
static ImBuf * seq_get_movieclip_ibuf(Strip *strip, MovieClipUser user)
static void multiply_ibuf(ImBuf *ibuf, const float fmul, const bool multiply_alpha)
static bool is_quad_a_inside_b(const StripScreenQuad &a, const StripScreenQuad &b)
void intra_frame_cache_set_cur_frame(Scene *scene, float frame, int view_id, int width, int height, bool is_render)
void seq_prefetch_start(const RenderData *context, float timeline_frame)
static ImBuf * create_missing_media_image(const RenderData *context, int width, int height)
static SeqResult seq_render_preprocess_ibuf(const RenderData *context, SeqRenderState *state, Strip *strip, const SeqResult &input, float timeline_frame, bool use_preprocess, const bool is_proxy_image)
Vector< Strip * > query_rendered_strips_sorted(const Scene *scene, ListBaseT< SeqTimelineChannel > *channels, ListBaseT< Strip > *seqbase, const int timeline_frame, const int chanshown)
void intra_frame_cache_put_preprocessed(Scene *scene, const Strip *strip, const SeqResult &result)
int seq_multiview_num_files_get(const Scene *scene, eImageFormat_ViewsFormat views_format)
SeqResult seq_render_give_ibuf_seqbase(const RenderData *context, SeqRenderState *state, float timeline_frame, int chan_shown, ListBaseT< SeqTimelineChannel > *channels, ListBaseT< Strip > *seqbasep)
static ImBuf * seq_render_movie_strip_custom_file_proxy(const RenderData *context, Strip *strip, int timeline_frame)
static ImBuf * seq_render_mask_strip(const RenderData *context, Strip *strip, float frame_index)
void render_new_render_data(Main *bmain, Depsgraph *depsgraph, Scene *scene, int rectx, int recty, eSpaceSeq_Proxy_RenderSize preview_render_size, Render *render, RenderData *r_context)
static ImBuf * render_scene_strip_viewport(const Scene *display_scene, Scene *scene, const Strip *strip, Depsgraph *depsgraph, Object *camera, eDrawType draw_type, int width, int height, int view_id, GPUOffScreen *gpu_offscreen, GPUViewport *gpu_viewport)
static bool is_strip_covering_screen(const RenderData *context, const Strip *strip)
static float3x3 calc_strip_transform_matrix(const Scene *scene, const Strip *strip, const int2 in_size, const int2 out_size, const float image_scale_factor, const float preview_scale_factor)
float strip_speed_effect_target_frame_get(Scene *scene, Strip *strip_speed, float timeline_frame, int input)
static bool strip_result_covers_strip_quad(const RenderData *context, const Strip *strip, const ImBuf *image, const float3x3 &matrix, const float crop_scale_factor)
void render_end_gpu(const RenderData &rd, GpuContextState state)
ImBuf * final_image_cache_get(Scene *scene, float timeline_frame, int view_id, int display_channel, int2 image_size, bool is_render)
bool seq_multiview_view_filepath_get(const Scene &scene, const char *filepath, const int view_id, char *r_filepath, const size_t r_filepath_maxncpy, const char **r_suffix)
StripScreenQuad get_strip_screen_quad(const RenderData *context, const Strip *strip)
static StripEarlyOut strip_get_early_out_for_blend_mode(Strip *strip)
SeqResult source_image_cache_get(const RenderData *context, const Strip *strip, float timeline_frame)
float2 image_transform_origin_get(const Scene *scene, const Strip *strip)
SeqTimelineChannel * channel_get_by_index(const ListBaseT< SeqTimelineChannel > *channels, const int channel_index)
static bool seq_input_have_to_preprocess(const Strip *strip)
void final_image_cache_put(Scene *scene, float timeline_frame, int view_id, int display_channel, int2 image_size, bool is_render, ImBuf *image)
static Mutex seq_render_mutex
void image_size_to_thumb_size(int &r_width, int &r_height, int size)
static ImBuf * seq_render_scene_strip_ex(const RenderData *context, Strip *strip, float frame_index, float timeline_frame)
static SeqResult do_render_strip_uncached(const RenderData *context, SeqRenderState *state, Strip *strip, float timeline_frame, bool *r_is_proxy_image)
GpuContextState render_begin_gpu(const RenderData &rd)
void modifier_apply_stack(ModifierApplyContext &context)
bool evict_caches_if_full(Scene *scene)
float rendersize_to_scale_factor(eSpaceSeq_Proxy_RenderSize render_size)
static void sequencer_preprocess_transform_crop(ImBuf *in, ImBuf *out, const RenderData *context, Strip *strip, const float3x3 &matrix, const bool scale_crop_values, const float preview_scale_factor)
static ViewLayer * get_view_layer_for_scene_strip(Scene *scene, const Strip *strip)
void media_presence_set_missing(Scene *scene, const Strip *strip, bool missing)
static eIMBInterpolationFilterMode get_auto_filter(const StripTransform *transform)
static bool sequencer_use_crop(const Strip *strip)
static SeqResult input_preprocess(const RenderData *context, SeqRenderState *state, Strip *strip, float timeline_frame, const SeqResult &input, const bool is_proxy_image)
ListBaseT< Strip > * get_seqbase_from_strip(Strip *strip, ListBaseT< SeqTimelineChannel > **r_channels, int *r_offset)
ImBuf * seq_render_mask(Depsgraph *depsgraph, int width, int height, const Mask *mask, float frame_index, bool make_float)
static void sequencer_image_crop_init(const Strip *strip, const ImBuf *in, float crop_scale_factor, rctf *r_crop)
static ImBuf * seq_render_movie_strip_view(const RenderData *context, Strip *strip, float timeline_frame, MovieReaderAccessor &reader, bool *r_is_proxy_image)
MovieReaderAccessor movie_reader_cache_acquire(Scene &cache_scene, const Scene &key_scene, const Strip &strip, const int frame_index)
SeqResult intra_frame_cache_get_composite(Scene *scene, const Strip *strip)
bool can_use_proxy(const RenderData *context, const Strip *strip, IMB_Proxy_Size psize)
void ensure_ibuf_is_linear_space(ImBuf *ibuf, bool make_float)
static bool sequencer_use_transform(const Strip *strip)
static ImBuf * seq_render_movieclip_strip(const RenderData *context, Strip *strip, float frame_index, bool *r_is_proxy_image)
Scene * prefetch_get_original_scene(const RenderData *context)
float effect_fader_calc(Scene *scene, Strip *strip, float timeline_frame, const bool is_current_frame)
static SeqResult do_render_strip_seqbase(const RenderData *context, SeqRenderState *state, Strip *strip, float frame_index)
StripElem * render_give_stripelem(const Scene *scene, const Strip *strip, int timeline_frame)
static bool seq_need_scale_to_render_size(const Strip *strip, bool is_proxy_image)
void seq_imbuf_assign_sequencer_space(const Scene *scene, ImBuf *ibuf)
ImBuf * render_give_ibuf_direct(const RenderData *context, float timeline_frame, Strip *strip)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
void IMB_colormanagement_transform_byte_to_float(float *float_buffer, const unsigned char *byte_buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace)
void DRW_gpu_context_enable()
void * RE_blender_gpu_context_ensure(Render *re)
void DEG_graph_tag_relations_update(Depsgraph *graph)
void IMB_colormanagement_assign_float_colorspace(ImBuf *ibuf, const char *name)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
eSpaceSeq_Proxy_RenderSize
void RE_RenderFrame(Render *re, Main *bmain, Scene *scene, ViewLayer *single_layer, Object *camera_override, const int frame, const float subframe, const bool write_still)
void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph)
ImBuf * IMB_makeSingleUser(ImBuf *ibuf)
void IMB_free_byte_pixels(ImBuf *ibuf)
void IMB_saturation(ImBuf *ibuf, float sat)
const char * BKE_scene_multiview_render_view_name_get(const RenderData *rd, int view_id)
MaskRasterHandle * BKE_maskrasterize_handle_new()
MINLINE void copy_v3_v3(float r[3], const float a[3])
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
bool DEG_is_active(const Depsgraph *depsgraph)
MINLINE int round_fl_to_int(float a)
size_t IMB_get_pixel_count(const ImBuf *ibuf)
Get the length of the data of the given image buffer in pixels.
float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float xy[2])
@ SEQ_STORAGE_PROXY_CUSTOM_FILE
bool BKE_movieclip_proxy_enabled(MovieClip *clip)
void IMB_rectfill(ImBuf *drect, const float col[4])
Depsgraph * DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode)
ImBuf * MOV_decode_frame(MovieReader *anim, int frame_index, IMB_Proxy_Size preview_size)
@ V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS
@ V3D_OFSDRAW_NO_WORLD_BACKGROUND_OVERRIDE
@ V3D_OFSDRAW_SHOW_ANNOTATION
void WM_system_gpu_context_release(GHOST_IContext *context)
const char * IMB_colormanagement_get_byte_colorspace(const ImBuf *ibuf)
MINLINE int max_ii(int a, int b)
@ COLOR_ROLE_SCENE_LINEAR
void GPU_context_active_set(GPUContext *)
int BKE_scene_multiview_num_views_get(const RenderData *rd)
@ MCLIP_PROXY_RENDER_UNDISTORT
@ MCLIP_PROXY_RENDER_USE_FALLBACK_RENDER
@ STRIP_MODIFIER_FLAG_MUTE
@ STRIP_MODIFIER_FLAG_SHOW_PREVIEW
@ MCLIP_PROXY_RENDER_SIZE_75
@ MCLIP_PROXY_RENDER_SIZE_25
@ MCLIP_PROXY_RENDER_SIZE_FULL
@ MCLIP_PROXY_RENDER_SIZE_50
@ MCLIP_PROXY_RENDER_SIZE_100
void BKE_mask_evaluate(Mask *mask, float ctime, bool do_newframe)
@ LIB_ID_COPY_NO_ANIMDATA
bool DRW_gpu_context_is_enabled()
void BKE_scene_frame_set(Scene *scene, float frame)
void BKE_render_resolution(const RenderData *r, const bool use_crop, int *r_width, int *r_height)
ImBuf * IMB_dupImBuf(const ImBuf *ibuf1)
AnimationEvalContext BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
void RE_display_free(Render *re)
AnimData * BKE_animdata_from_id(const ID *id)
ImBuf * IMB_load_image_from_filepath(const char *filepath, ImBufFlags flags, ColorManagedColorspaceSettings *colorspace_settings=nullptr)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void IMB_transform(const ImBuf *src, ImBuf *dst, eIMBTransformMode mode, eIMBInterpolationFilterMode filter, const float3x3 &transform_matrix, const rctf *src_crop)
Transform source image buffer onto destination image buffer using a transform matrix.
void DRW_gpu_context_disable()
Render * RE_GetSceneRender(const Scene *scene)
bool BLI_rctf_is_empty(const struct rctf *rect)
@ SEQ_EDIT_PROXY_DIR_STORAGE
ViewLayer * DEG_get_input_view_layer(const Depsgraph *graph)
void IMB_freeImBuf(ImBuf *ibuf)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
float BKE_scene_frame_get(const Scene *scene)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
void DEG_graph_replace_owners(Depsgraph *depsgraph, Main *bmain, Scene *scene, ViewLayer *view_layer)
void IMB_flipx(ImBuf *ibuf)
void IMB_flipy(ImBuf *ibuf)
void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, Mask *mask, int width, int height, bool do_aspect_correct, bool do_mask_aa, bool do_feather)
ImBuf * BKE_movieclip_get_stable_ibuf(MovieClip *clip, const MovieClipUser *user, MovieClipPostprocFlag postprocess_flag, float r_loc[2], float *r_scale, float *r_angle)
void BKE_maskrasterize_handle_free(MaskRasterHandle *mr_handle)
void DEG_debug_name_set(Depsgraph *depsgraph, const char *name)
@ SEQ_SCENE_NO_ANNOTATION
MovieReader * openanim(const char *filepath, ImBufFlags ibuf_flags, int streamindex, bool keep_original_colorspace, ColorManagedColorspaceSettings *colorspace_settings)
void IMB_buffer_float_rgba_from_float(float *dest, const float *src, int src_channels, int width, int height)
int isect_point_quad_v2(const float p[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2])
eIMBInterpolationFilterMode
@ IMB_FILTER_CUBIC_BSPLINE
@ IMB_FILTER_CUBIC_MITCHELL
void WM_system_gpu_context_activate(GHOST_IContext *context)
@ R_SEQ_OVERRIDE_SCENE_SETTINGS
MatBase< float, 3, 3 > float3x3
void BKE_id_free(Main *bmain, void *idv)
@ SEQ_SPEED_USE_INTERPOLATION
void IMB_colormanagement_assign_byte_colorspace(ImBuf *ibuf, const char *name)
void BKE_movieclip_user_set_frame(MovieClipUser *user, int framenr)
ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, ImBufFlags flags)
void RE_display_share(Render *re, const Render *parent_re)
void BKE_animsys_evaluate_animdata(ID *id, AnimData *adt, const AnimationEvalContext *anim_eval_context, eAnimData_Recalc recalc, bool flush_to_original)
@ V3D_SHADING_BACKGROUND_VIEWPORT
ViewLayer * BKE_view_layer_find(const Scene *scene, const char *layer_name)
void RE_ReleaseResultImage(Render *re)
void IMB_ImBufFromStereo3d(const Stereo3dFormat *s3d, ImBuf *ibuf_stereo3d, ImBuf **r_ibuf_left, ImBuf **r_ibuf_right)
MINLINE void copy_v3_fl(float r[3], float f)
ImBuf * BKE_movieclip_get_ibuf_flag(MovieClip *clip, const MovieClipUser *user, MovieClipFlag flag, MovieClipCacheFlag cache_flag)
@ SEQ_EDIT_SHOW_MISSING_MEDIA
@ SEQ_MOVIECLIP_RENDER_STABILIZED
@ SEQ_MOVIECLIP_RENDER_UNDISTORTED
bool BKE_scene_camera_switch_update(Scene *scene)
void IMB_metadata_copy(ImBuf *ibuf_dst, const ImBuf *ibuf_src)
bool BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rctf *dest)
Render * RE_NewSceneRender(const Scene *scene)
float MOV_get_fps(const MovieReader *anim)
@ SEQ_CACHE_STORE_FINAL_OUT
@ SEQ_TRANSFORM_FILTER_AUTO
@ SEQ_TRANSFORM_FILTER_CUBIC_MITCHELL
@ SEQ_TRANSFORM_FILTER_BILINEAR
@ SEQ_TRANSFORM_FILTER_CUBIC_BSPLINE
@ SEQ_TRANSFORM_FILTER_NEAREST
@ SEQ_TRANSFORM_FILTER_BOX
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
bool IMB_alloc_float_pixels(ImBuf *ibuf, unsigned int channels, bool initialize_pixels=true)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
ViewLayer * BKE_view_layer_default_render(const Scene *scene)
void IMB_colormanagement_transform_float(float *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace, bool predivide)
MINLINE int min_ii(int a, int b)
void BKE_scene_multiview_view_prefix_get(const Scene *scene, const char *filepath, char *r_prefix, const char **r_ext)
void IMB_filtery(ImBuf *ibuf)
const char * IMB_colormanagement_get_float_colorspace(const ImBuf *ibuf)
GHOST_IContext * RE_system_gpu_context_get(Render *re)
void RE_AcquireResultImage(Render *re, RenderResult *rr, const int view_id)
GPUContext * GPU_context_active_get()
@ IMB_TRANSFORM_MODE_CROP_SRC
Crop the source buffer.
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
eEditingCacheFlag cache_flag
ListBaseT< Strip > seqbase
const ColorSpace * colorspace
const ColorSpace * colorspace
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
const uint8_t * byte_data() const
uint8_t * byte_data_for_write()
const float * float_data() const
float * float_data_for_write()
bool can_contain_alpha() const
void assign_float_data(float *data)
static MatBase identity()
eMovieClipProxy_RenderFlag render_flag
eMovieClipProxy_RenderSize render_size
struct SceneDisplay display
bke::SceneRuntime * runtime
ColorManagedColorspaceSettings sequencer_colorspace_settings
eEffectSpeedControlFlags flags
struct MovieReader * anim
eV3DShadingBackgroundType background_type
float background_color[3]
GHOST_IContext * ghost_context
StripEarlyOut(*) early_out(const Strip *strip, float fac)
SeqResult(*) execute(const RenderData *context, SeqRenderState *state, Strip *strip, float timeline_frame, float fac, const SeqResult &input1, const SeqResult &input2)
bool is_occluded(const RenderData *context, const Strip *strip, int order_index) const
void add_occluder(const RenderData *context, const Strip *strip, int order_index)
Vector< OpaqueQuad, 4 > opaques
GPUOffScreen * gpu_offscreen
float motion_blur_shutter
gpu::GPUSecondaryContextData gpu_context
bool ignore_missing_media
eSpaceSeq_Proxy_RenderSize preview_render_size
GPUViewport * gpu_viewport
SceneStripSavedState(Scene *scene)
bool is_opaque_before_transform