Blender V4.3
render.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 * SPDX-FileCopyrightText: 2003-2024 Blender Authors
3 * SPDX-FileCopyrightText: 2005-2006 Peter Schlaile <peter [at] schlaile [dot] de>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later */
6
11#include <ctime>
12
13#include "MEM_guardedalloc.h"
14
15#include "DNA_defaults.h"
16#include "DNA_mask_types.h"
17#include "DNA_scene_types.h"
18#include "DNA_sequence_types.h"
19#include "DNA_space_types.h"
20
21#include "BLI_linklist.h"
22#include "BLI_listbase.h"
23#include "BLI_math_geom.h"
24#include "BLI_math_rotation.h"
25#include "BLI_path_utils.hh"
26#include "BLI_rect.h"
27#include "BLI_task.hh"
28
29#include "BKE_anim_data.hh"
30#include "BKE_animsys.h"
31#include "BKE_fcurve.hh"
32#include "BKE_global.hh"
33#include "BKE_image.hh"
34#include "BKE_layer.hh"
35#include "BKE_lib_id.hh"
36#include "BKE_main.hh"
37#include "BKE_mask.h"
38#include "BKE_movieclip.h"
39#include "BKE_scene.hh"
41
42#include "DEG_depsgraph.hh"
44
46#include "IMB_imbuf.hh"
47#include "IMB_imbuf_types.hh"
48#include "IMB_metadata.hh"
49
50#include "RNA_prototypes.hh"
51
52#include "RE_engine.h"
53#include "RE_pipeline.h"
54
55#include "SEQ_channels.hh"
56#include "SEQ_effects.hh"
57#include "SEQ_iterator.hh"
58#include "SEQ_modifier.hh"
59#include "SEQ_proxy.hh"
60#include "SEQ_relations.hh"
61#include "SEQ_render.hh"
62#include "SEQ_sequencer.hh"
63#include "SEQ_time.hh"
64#include "SEQ_transform.hh"
65#include "SEQ_utils.hh"
66
67#include "effects.hh"
68#include "image_cache.hh"
69#include "multiview.hh"
70#include "prefetch.hh"
71#include "proxy.hh"
72#include "render.hh"
73#include "utils.hh"
74
75#include <algorithm>
76
77using namespace blender;
78
79static ImBuf *seq_render_strip_stack(const SeqRenderData *context,
81 ListBase *channels,
82 ListBase *seqbasep,
83 float timeline_frame,
84 int chanshown);
85
87SequencerDrawView sequencer_view3d_fn = nullptr; /* nullptr in background mode */
88
89/* -------------------------------------------------------------------- */
93void seq_imbuf_assign_spaces(const Scene *scene, ImBuf *ibuf)
94{
95#if 0
96 /* Byte buffer is supposed to be in sequencer working space already. */
97 if (ibuf->rect != nullptr) {
98 IMB_colormanagement_assign_byte_colorspace(ibuf, scene->sequencer_colorspace_settings.name);
99 }
100#endif
101 if (ibuf->float_buffer.data != nullptr) {
102 IMB_colormanagement_assign_float_colorspace(ibuf, scene->sequencer_colorspace_settings.name);
103 }
104}
105
106void seq_imbuf_to_sequencer_space(const Scene *scene, ImBuf *ibuf, bool make_float)
107{
108 /* Early output check: if both buffers are nullptr we have nothing to convert. */
109 if (ibuf->float_buffer.data == nullptr && ibuf->byte_buffer.data == nullptr) {
110 return;
111 }
112 /* Get common conversion settings. */
113 const char *to_colorspace = scene->sequencer_colorspace_settings.name;
114 /* Perform actual conversion logic. */
115 if (ibuf->float_buffer.data == nullptr) {
116 /* We are not requested to give float buffer and byte buffer is already
117 * in thee required colorspace. Can skip doing anything here.
118 */
119 const char *from_colorspace = IMB_colormanagement_get_rect_colorspace(ibuf);
120 if (!make_float && STREQ(from_colorspace, to_colorspace)) {
121 return;
122 }
123 if (false) {
124 /* The idea here is to provide as fast playback as possible and
125 * enforcing float buffer here (a) uses more cache memory (b) might
126 * make some other effects slower to apply.
127 *
128 * However, this might also have negative effect by adding weird
129 * artifacts which will then not happen in final render.
130 */
132 ibuf->x,
133 ibuf->y,
134 ibuf->channels,
135 from_colorspace,
136 to_colorspace);
137 }
138 else {
139 /* We perform conversion to a float buffer so we don't worry about
140 * precision loss.
141 */
142 imb_addrectfloatImBuf(ibuf, 4, false);
144 ibuf->byte_buffer.data,
145 ibuf->x,
146 ibuf->y,
147 ibuf->channels,
148 from_colorspace,
149 to_colorspace);
150 /* We don't need byte buffer anymore. */
151 imb_freerectImBuf(ibuf);
152 }
153 }
154 else {
155 const char *from_colorspace = IMB_colormanagement_get_float_colorspace(ibuf);
156 /* Unknown input color space, can't perform conversion. */
157 if (from_colorspace == nullptr || from_colorspace[0] == '\0') {
158 return;
159 }
160 /* We don't want both byte and float buffers around: they'll either run
161 * out of sync or conversion of byte buffer will lose precision in there.
162 */
163 if (ibuf->byte_buffer.data != nullptr) {
164 imb_freerectImBuf(ibuf);
165 }
167 ibuf->x,
168 ibuf->y,
169 ibuf->channels,
170 from_colorspace,
171 to_colorspace,
172 true);
173 }
174 seq_imbuf_assign_spaces(scene, ibuf);
175}
176
178{
179 const char *from_colorspace = scene->sequencer_colorspace_settings.name;
180 const char *to_colorspace = IMB_colormanagement_role_colorspace_name_get(
182
183 if (!ibuf->float_buffer.data) {
184 return;
185 }
186
187 if (to_colorspace && to_colorspace[0] != '\0') {
189 ibuf->x,
190 ibuf->y,
191 ibuf->channels,
192 from_colorspace,
193 to_colorspace,
194 true);
196 }
197}
198
200{
201 const char *from_colorspace = scene->sequencer_colorspace_settings.name;
202 const char *to_colorspace = IMB_colormanagement_role_colorspace_name_get(
204
205 if (to_colorspace && to_colorspace[0] != '\0') {
206 IMB_colormanagement_transform_v4(pixel, from_colorspace, to_colorspace);
207 }
208 else {
209 /* if no color management enables fallback to legacy conversion */
210 srgb_to_linearrgb_v4(pixel, pixel);
211 }
212}
213
216/* -------------------------------------------------------------------- */
221 Depsgraph *depsgraph,
222 Scene *scene,
223 int rectx,
224 int recty,
225 int preview_render_size,
226 int for_render,
227 SeqRenderData *r_context)
228{
229 r_context->bmain = bmain;
230 r_context->depsgraph = depsgraph;
231 r_context->scene = scene;
232 r_context->rectx = rectx;
233 r_context->recty = recty;
234 r_context->preview_render_size = preview_render_size;
235 r_context->ignore_missing_media = false;
236 r_context->for_render = for_render;
237 r_context->motion_blur_samples = 0;
238 r_context->motion_blur_shutter = 0;
239 r_context->skip_cache = false;
240 r_context->is_proxy_render = false;
241 r_context->view_id = 0;
242 r_context->gpu_offscreen = nullptr;
243 r_context->gpu_viewport = nullptr;
244 r_context->task_id = SEQ_TASK_MAIN_RENDER;
245 r_context->is_prefetch_render = false;
246}
247
248StripElem *SEQ_render_give_stripelem(const Scene *scene, const Sequence *seq, int timeline_frame)
249{
250 StripElem *se = seq->strip->stripdata;
251
252 if (seq->type == SEQ_TYPE_IMAGE) {
253 /* only IMAGE strips use the whole array, MOVIE strips use only the first element,
254 * all other strips don't use this...
255 */
256
257 int frame_index = round_fl_to_int(SEQ_give_frame_index(scene, seq, timeline_frame));
258
259 if (frame_index == -1 || se == nullptr) {
260 return nullptr;
261 }
262
263 se += frame_index + seq->anim_startofs;
264 }
265 return se;
266}
267
269 ListBase *channels,
270 ListBase *seqbase,
271 const int timeline_frame,
272 const int chanshown)
273{
276 scene, channels, seqbase, timeline_frame, chanshown);
277 const int strip_count = strips.size();
278
279 if (UNLIKELY(strip_count > SEQ_MAX_CHANNELS)) {
280 BLI_assert_msg(0, "Too many strips, this shouldn't happen");
281 return result;
282 }
283
284 result.reserve(strips.size());
285 for (Sequence *seq : strips) {
286 result.append(seq);
287 }
288
289 /* Sort strips by channel. */
290 std::sort(result.begin(), result.end(), [](const Sequence *a, const Sequence *b) {
291 return a->machine < b->machine;
292 });
293 return result;
294}
295
297{
298 Scene *scene = context->scene;
299 const int x = context->rectx;
300 const int y = context->recty;
301 float2 offset{x * 0.5f, y * 0.5f};
302
303 float quad[4][2];
305 return StripScreenQuad{quad[0] + offset, quad[1] + offset, quad[2] + offset, quad[3] + offset};
306}
307
308/* Is quad `a` fully contained (i.e. covered by) quad `b`? For that to happen,
309 * all corners of `a` have to be inside `b`. */
311{
312 return isect_point_quad_v2(a.v0, b.v0, b.v1, b.v2, b.v3) &&
313 isect_point_quad_v2(a.v1, b.v0, b.v1, b.v2, b.v3) &&
314 isect_point_quad_v2(a.v2, b.v0, b.v1, b.v2, b.v3) &&
315 isect_point_quad_v2(a.v3, b.v0, b.v1, b.v2, b.v3);
316}
317
318/* Tracking of "known to be opaque" strip quad coordinates, along with their
319 * order index within visible strips during rendering. */
320
325
328
329 /* Determine if the input strip is completely behind opaque strips that are
330 * above it. Current implementation is simple and only checks if strip is
331 * completely covered by any other strip. It does not detect case where
332 * a strip is not covered by a single strip, but is behind of the union
333 * of the strips above. */
334 bool is_occluded(const SeqRenderData *context, const Sequence *seq, int order_index) const
335 {
337 if (quad.is_empty()) {
338 /* Strip size is not initialized/valid, we can't know if it is occluded. */
339 return false;
340 }
341 for (const OpaqueQuad &q : opaques) {
342 if (q.order_index > order_index && is_quad_a_inside_b(quad, q.quad)) {
343 return true;
344 }
345 }
346 return false;
347 }
348
349 void add_occluder(const SeqRenderData *context, const Sequence *seq, int order_index)
350 {
352 if (!quad.is_empty()) {
353 opaques.append({quad, order_index});
354 }
355 }
356};
357
360/* -------------------------------------------------------------------- */
380static bool sequencer_use_transform(const Sequence *seq)
381{
382 const StripTransform *transform = seq->strip->transform;
383
384 if (transform->xofs != 0 || transform->yofs != 0 || transform->scale_x != 1 ||
385 transform->scale_y != 1 || transform->rotation != 0)
386 {
387 return true;
388 }
389
390 return false;
391}
392
393static bool sequencer_use_crop(const Sequence *seq)
394{
395 const StripCrop *crop = seq->strip->crop;
396 if (crop->left > 0 || crop->right > 0 || crop->top > 0 || crop->bottom > 0) {
397 return true;
398 }
399
400 return false;
401}
402
404 Sequence *seq,
405 float /*timeline_frame*/)
406{
407 float mul;
408
409 if (context && context->is_proxy_render) {
410 return false;
411 }
412
413 if ((seq->flag & (SEQ_FILTERY | SEQ_FLIPX | SEQ_FLIPY | SEQ_MAKE_FLOAT)) ||
415 {
416 return true;
417 }
418
419 mul = seq->mul;
420
421 if (seq->blend_mode == SEQ_BLEND_REPLACE) {
422 mul *= seq->blend_opacity / 100.0f;
423 }
424
425 if (mul != 1.0f) {
426 return true;
427 }
428
429 if (seq->sat != 1.0f) {
430 return true;
431 }
432
433 if (seq->modifiers.first) {
434 return true;
435 }
436
437 return false;
438}
439
446static bool seq_need_scale_to_render_size(const Sequence *seq, bool is_proxy_image)
447{
448 if (is_proxy_image) {
449 return true;
450 }
451 if ((seq->type & SEQ_TYPE_EFFECT) != 0 || seq->type == SEQ_TYPE_MASK ||
452 seq->type == SEQ_TYPE_META ||
453 (seq->type == SEQ_TYPE_SCENE && ((seq->flag & SEQ_SCENE_STRIPS) != 0)))
454 {
455 return true;
456 }
457 return false;
458}
459
461 const ImBuf *in,
462 const ImBuf *out,
463 const float image_scale_factor,
464 const float preview_scale_factor,
465 float r_transform_matrix[4][4])
466{
467 const StripTransform *transform = seq->strip->transform;
468 const float scale_x = transform->scale_x * image_scale_factor;
469 const float scale_y = transform->scale_y * image_scale_factor;
470 const float image_center_offs_x = (out->x - in->x) / 2;
471 const float image_center_offs_y = (out->y - in->y) / 2;
472 const float translate_x = transform->xofs * preview_scale_factor + image_center_offs_x;
473 const float translate_y = transform->yofs * preview_scale_factor + image_center_offs_y;
474 const float pivot[3] = {in->x * transform->origin[0], in->y * transform->origin[1], 0.0f};
475
476 float rotation_matrix[3][3];
477 axis_angle_to_mat3_single(rotation_matrix, 'Z', transform->rotation);
478 loc_rot_size_to_mat4(r_transform_matrix,
479 float3{translate_x, translate_y, 0.0f},
480 rotation_matrix,
481 float3{scale_x, scale_y, 1.0f});
482 transform_pivot_set_m4(r_transform_matrix, pivot);
483 invert_m4(r_transform_matrix);
484}
485
486static void sequencer_image_crop_init(const Sequence *seq,
487 const ImBuf *in,
488 float crop_scale_factor,
489 rctf *r_crop)
490{
491 const StripCrop *c = seq->strip->crop;
492 const int left = c->left * crop_scale_factor;
493 const int right = c->right * crop_scale_factor;
494 const int top = c->top * crop_scale_factor;
495 const int bottom = c->bottom * crop_scale_factor;
496
497 BLI_rctf_init(r_crop, left, in->x - right, bottom, in->y - top);
498}
499
500static bool is_strip_covering_screen(const SeqRenderData *context, const Sequence *seq)
501{
502 /* The check is done by checking whether all corners of viewport fit inside
503 * of the transformed strip. If they do not, the strip does not cover
504 * whole screen. */
505 float x0 = 0.0f;
506 float y0 = 0.0f;
507 float x1 = float(context->rectx);
508 float y1 = float(context->recty);
509 float x_aspect = context->scene->r.xasp / context->scene->r.yasp;
510 if (x_aspect != 1.0f) {
511 float xmid = (x0 + x1) * 0.5f;
512 x0 = xmid - (xmid - x0) * x_aspect;
513 x1 = xmid + (x1 - xmid) * x_aspect;
514 }
516 StripScreenQuad screen{float2(x0, y0), float2(x1, y0), float2(x0, y1), float2(x1, y1)};
517
518 return is_quad_a_inside_b(screen, quad);
519}
520
521/* Automatic filter:
522 * - No scale, no rotation and non-fractional position: nearest.
523 * - Scale up by more than 2x: cubic mitchell.
524 * - Scale down by more than 2x: box.
525 * - Otherwise: bilinear. */
527{
528 const float sx = fabsf(transform->scale_x);
529 const float sy = fabsf(transform->scale_y);
530 if (sx > 2.0f && sy > 2.0f) {
532 }
533 if (sx < 0.5f && sy < 0.5f) {
534 return IMB_FILTER_BOX;
535 }
536 const float px = transform->xofs;
537 const float py = transform->yofs;
538 const float rot = transform->rotation;
539 if (sx == 1.0f && sy == 1.0f && roundf(px) == px && roundf(py) == py && rot == 0.0f) {
540 return IMB_FILTER_NEAREST;
541 }
542 return IMB_FILTER_BILINEAR;
543}
544
546 ImBuf *in, ImBuf *out, const SeqRenderData *context, Sequence *seq, const bool is_proxy_image)
547{
548 const Scene *scene = context->scene;
549 const float preview_scale_factor = context->preview_render_size == SEQ_RENDER_SIZE_SCENE ?
550 float(scene->r.size) / 100 :
552 context->preview_render_size);
553 const bool do_scale_to_render_size = seq_need_scale_to_render_size(seq, is_proxy_image);
554 const float image_scale_factor = do_scale_to_render_size ? 1.0f : preview_scale_factor;
555
556 float transform_matrix[4][4];
558 seq, in, out, image_scale_factor, preview_scale_factor, transform_matrix);
559
560 /* Proxy image is smaller, so crop values must be corrected by proxy scale factor.
561 * Proxy scale factor always matches preview_scale_factor. */
562 rctf source_crop;
563 const float crop_scale_factor = do_scale_to_render_size ? preview_scale_factor : 1.0f;
564 sequencer_image_crop_init(seq, in, crop_scale_factor, &source_crop);
565
566 const StripTransform *transform = seq->strip->transform;
568 switch (transform->filter) {
570 filter = get_auto_filter(seq->strip->transform);
571 break;
573 filter = IMB_FILTER_NEAREST;
574 break;
576 filter = IMB_FILTER_BILINEAR;
577 break;
580 break;
583 break;
585 filter = IMB_FILTER_BOX;
586 break;
587 }
588
589 IMB_transform(in, out, IMB_TRANSFORM_MODE_CROP_SRC, filter, transform_matrix, &source_crop);
590
591 if (is_strip_covering_screen(context, seq)) {
592 out->planes = in->planes;
593 }
594 else {
595 /* Strip is not covering full viewport, which means areas with transparency
596 * are introduced for sure. */
597 out->planes = R_IMF_PLANES_RGBA;
598 }
599}
600
601static void multiply_ibuf(ImBuf *ibuf, const float fmul, const bool multiply_alpha)
602{
603 const size_t pixel_count = IMB_get_rect_len(ibuf);
604 if (ibuf->byte_buffer.data != nullptr) {
605 threading::parallel_for(IndexRange(pixel_count), 64 * 1024, [&](IndexRange range) {
606 uchar *ptr = ibuf->byte_buffer.data + range.first() * 4;
607 const int imul = int(256.0f * fmul);
608 for ([[maybe_unused]] const int64_t i : range) {
609 ptr[0] = min_ii((imul * ptr[0]) >> 8, 255);
610 ptr[1] = min_ii((imul * ptr[1]) >> 8, 255);
611 ptr[2] = min_ii((imul * ptr[2]) >> 8, 255);
612 if (multiply_alpha) {
613 ptr[3] = min_ii((imul * ptr[3]) >> 8, 255);
614 }
615 ptr += 4;
616 }
617 });
618 }
619
620 if (ibuf->float_buffer.data != nullptr) {
621 threading::parallel_for(IndexRange(pixel_count), 64 * 1024, [&](IndexRange range) {
622 float *ptr = ibuf->float_buffer.data + range.first() * 4;
623 for ([[maybe_unused]] const int64_t i : range) {
624 ptr[0] *= fmul;
625 ptr[1] *= fmul;
626 ptr[2] *= fmul;
627 if (multiply_alpha) {
628 ptr[3] *= fmul;
629 }
630 ptr += 4;
631 }
632 });
633 }
634}
635
636static ImBuf *input_preprocess(const SeqRenderData *context,
637 Sequence *seq,
638 float timeline_frame,
639 ImBuf *ibuf,
640 const bool is_proxy_image)
641{
642 Scene *scene = context->scene;
643 ImBuf *preprocessed_ibuf = nullptr;
644
645 /* Deinterlace. */
646 if ((seq->flag & SEQ_FILTERY) && !ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_MOVIECLIP)) {
647 /* Change original image pointer to avoid another duplication in SEQ_USE_TRANSFORM. */
648 preprocessed_ibuf = IMB_makeSingleUser(ibuf);
649 ibuf = preprocessed_ibuf;
650
651 IMB_filtery(preprocessed_ibuf);
652 }
653
654 if (sequencer_use_crop(seq) || sequencer_use_transform(seq) || context->rectx != ibuf->x ||
655 context->recty != ibuf->y)
656 {
657 const int x = context->rectx;
658 const int y = context->recty;
659 preprocessed_ibuf = IMB_allocImBuf(x, y, 32, ibuf->float_buffer.data ? IB_rectfloat : IB_rect);
660
661 sequencer_preprocess_transform_crop(ibuf, preprocessed_ibuf, context, seq, is_proxy_image);
662
663 seq_imbuf_assign_spaces(scene, preprocessed_ibuf);
664 IMB_metadata_copy(preprocessed_ibuf, ibuf);
665 IMB_freeImBuf(ibuf);
666 }
667
668 /* Duplicate ibuf if we still have original. */
669 if (preprocessed_ibuf == nullptr) {
670 preprocessed_ibuf = IMB_makeSingleUser(ibuf);
671 }
672
673 if (seq->flag & SEQ_FLIPX) {
674 IMB_flipx(preprocessed_ibuf);
675 }
676
677 if (seq->flag & SEQ_FLIPY) {
678 IMB_flipy(preprocessed_ibuf);
679 }
680
681 if (seq->sat != 1.0f) {
682 IMB_saturation(preprocessed_ibuf, seq->sat);
683 }
684
685 if (seq->flag & SEQ_MAKE_FLOAT) {
686 if (!preprocessed_ibuf->float_buffer.data) {
687 seq_imbuf_to_sequencer_space(scene, preprocessed_ibuf, true);
688 }
689
690 if (preprocessed_ibuf->byte_buffer.data) {
691 imb_freerectImBuf(preprocessed_ibuf);
692 }
693 }
694
695 float mul = seq->mul;
696 if (seq->blend_mode == SEQ_BLEND_REPLACE) {
697 mul *= seq->blend_opacity / 100.0f;
698 }
699
700 if (mul != 1.0f) {
701 const bool multiply_alpha = (seq->flag & SEQ_MULTIPLY_ALPHA);
702 multiply_ibuf(preprocessed_ibuf, mul, multiply_alpha);
703 }
704
705 if (seq->modifiers.first) {
706 SEQ_modifier_apply_stack(context, seq, preprocessed_ibuf, timeline_frame);
707 }
708
709 return preprocessed_ibuf;
710}
711
713 Sequence *seq,
714 ImBuf *ibuf,
715 float timeline_frame,
716 bool use_preprocess,
717 const bool is_proxy_image)
718{
719 if (context->is_proxy_render == false &&
720 (ibuf->x != context->rectx || ibuf->y != context->recty))
721 {
722 use_preprocess = true;
723 }
724
725 /* Proxies and non-generator effect strips are not stored in cache. */
726 const bool is_effect_with_inputs = (seq->type & SEQ_TYPE_EFFECT) != 0 &&
728 if (!is_proxy_image && !is_effect_with_inputs) {
729 seq_cache_put(context, seq, timeline_frame, SEQ_CACHE_STORE_RAW, ibuf);
730 }
731
732 if (use_preprocess) {
733 ibuf = input_preprocess(context, seq, timeline_frame, ibuf, is_proxy_image);
734 }
735
736 seq_cache_put(context, seq, timeline_frame, SEQ_CACHE_STORE_PREPROCESSED, ibuf);
737 return ibuf;
738}
739
749
760
761static void render_effect_execute_init_handle(void *handle_v,
762 int start_line,
763 int tot_line,
764 void *init_data_v)
765{
766 RenderEffectThread *handle = (RenderEffectThread *)handle_v;
768
769 handle->sh = init_data->sh;
770 handle->context = init_data->context;
771 handle->seq = init_data->seq;
772 handle->timeline_frame = init_data->timeline_frame;
773 handle->fac = init_data->fac;
774 handle->ibuf1 = init_data->ibuf1;
775 handle->ibuf2 = init_data->ibuf2;
776 handle->out = init_data->out;
777
778 handle->start_line = start_line;
779 handle->tot_line = tot_line;
780}
781
782static void *render_effect_execute_do_thread(void *thread_data_v)
783{
784 RenderEffectThread *thread_data = (RenderEffectThread *)thread_data_v;
785
786 thread_data->sh->execute_slice(thread_data->context,
787 thread_data->seq,
788 thread_data->timeline_frame,
789 thread_data->fac,
790 thread_data->ibuf1,
791 thread_data->ibuf2,
792 thread_data->start_line,
793 thread_data->tot_line,
794 thread_data->out);
795
796 return nullptr;
797}
798
800 const SeqRenderData *context,
801 Sequence *seq,
802 float timeline_frame,
803 float fac,
804 ImBuf *ibuf1,
805 ImBuf *ibuf2)
806{
808 ImBuf *out = sh->init_execution(context, ibuf1, ibuf2);
809
810 init_data.sh = sh;
811 init_data.context = context;
812 init_data.seq = seq;
813 init_data.timeline_frame = timeline_frame;
814 init_data.fac = fac;
815 init_data.ibuf1 = ibuf1;
816 init_data.ibuf2 = ibuf2;
817 init_data.out = out;
818
820 sizeof(RenderEffectThread),
821 &init_data,
824
825 return out;
826}
827
830 Sequence *seq,
831 float timeline_frame)
832{
833 Scene *scene = context->scene;
834 float fac;
835 int i;
837 const FCurve *fcu = nullptr;
838 ImBuf *ibuf[2];
839 Sequence *input[2];
840 ImBuf *out = nullptr;
841
842 ibuf[0] = ibuf[1] = nullptr;
843
844 input[0] = seq->seq1;
845 input[1] = seq->seq2;
846
847 if (!sh.execute && !(sh.execute_slice && sh.init_execution)) {
848 /* effect not supported in this version... */
849 out = IMB_allocImBuf(context->rectx, context->recty, 32, IB_rect);
850 return out;
851 }
852
854 sh.get_default_fac(scene, seq, timeline_frame, &fac);
855 }
856 else {
857 fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence, "effect_fader", 0, nullptr);
858 if (fcu) {
859 fac = evaluate_fcurve(fcu, timeline_frame);
860 }
861 else {
862 fac = seq->effect_fader;
863 }
864 }
865
866 StripEarlyOut early_out = sh.early_out(seq, fac);
867
868 switch (early_out) {
870 out = sh.execute(context, seq, timeline_frame, fac, nullptr, nullptr);
871 break;
873 for (i = 0; i < 2; i++) {
874 /* Speed effect requires time remapping of `timeline_frame` for input(s). */
875 if (input[0] && seq->type == SEQ_TYPE_SPEED) {
876 float target_frame = seq_speed_effect_target_frame_get(scene, seq, timeline_frame, i);
877
878 /* Only convert to int when interpolation is not used. */
879 SpeedControlVars *s = reinterpret_cast<SpeedControlVars *>(seq->effectdata);
880 if ((s->flags & SEQ_SPEED_USE_INTERPOLATION) != 0) {
881 target_frame = std::floor(target_frame);
882 }
883
884 ibuf[i] = seq_render_strip(context, state, input[0], target_frame);
885 }
886 else { /* Other effects. */
887 if (input[i]) {
888 ibuf[i] = seq_render_strip(context, state, input[i], timeline_frame);
889 }
890 }
891 }
892
893 if (ibuf[0] && (ibuf[1] || SEQ_effect_get_num_inputs(seq->type) == 1)) {
894 if (sh.multithreaded) {
896 &sh, context, seq, timeline_frame, fac, ibuf[0], ibuf[1]);
897 }
898 else {
899 out = sh.execute(context, seq, timeline_frame, fac, ibuf[0], ibuf[1]);
900 }
901 }
902 break;
904 if (input[0]) {
905 out = seq_render_strip(context, state, input[0], timeline_frame);
906 }
907 break;
909 if (input[1]) {
910 out = seq_render_strip(context, state, input[1], timeline_frame);
911 }
912 break;
913 }
914
915 for (i = 0; i < 2; i++) {
916 IMB_freeImBuf(ibuf[i]);
917 }
918
919 if (out == nullptr) {
920 out = IMB_allocImBuf(context->rectx, context->recty, 32, IB_rect);
921 }
922
923 return out;
924}
925
928/* -------------------------------------------------------------------- */
936 Sequence *seq,
937 char *filepath,
938 char *prefix,
939 const char *ext,
940 int view_id)
941{
942 ImBuf *ibuf = nullptr;
943
944 int flag = IB_rect | IB_metadata;
945 if (seq->alpha_mode == SEQ_ALPHA_PREMUL) {
947 }
948
949 if (prefix[0] == '\0') {
950 ibuf = IMB_loadiffname(filepath, flag, seq->strip->colorspace_settings.name);
951 }
952 else {
953 char filepath_view[FILE_MAX];
954 BKE_scene_multiview_view_prefix_get(context->scene, filepath, prefix, &ext);
955 seq_multiview_name(context->scene, view_id, prefix, ext, filepath_view, FILE_MAX);
956 ibuf = IMB_loadiffname(filepath_view, flag, seq->strip->colorspace_settings.name);
957 }
958
959 if (ibuf == nullptr) {
960 return nullptr;
961 }
962
963 /* We don't need both (speed reasons)! */
964 if (ibuf->float_buffer.data != nullptr && ibuf->byte_buffer.data != nullptr) {
965 imb_freerectImBuf(ibuf);
966 }
967
968 /* All sequencer color is done in SRGB space, linear gives odd cross-fades. */
969 seq_imbuf_to_sequencer_space(context->scene, ibuf, false);
970
971 return ibuf;
972}
973
975 Sequence *seq,
976 int totfiles,
977 const char *filepath,
978 char *r_prefix,
979 const char *r_ext)
980{
981 if (totfiles > 1) {
982 BKE_scene_multiview_view_prefix_get(scene, filepath, r_prefix, &r_ext);
983 if (r_prefix[0] == '\0') {
984 return false;
985 }
986 }
987 else {
988 r_prefix[0] = '\0';
989 }
990
991 return (seq->flag & SEQ_USE_VIEWS) != 0 && (scene->r.scemode & R_MULTIVIEW) != 0;
992}
993
994static ImBuf *create_missing_media_image(const SeqRenderData *context, int width, int height)
995{
996 if (context->ignore_missing_media) {
997 return nullptr;
998 }
999 if (context->scene == nullptr || context->scene->ed == nullptr ||
1000 (context->scene->ed->show_missing_media_flag & SEQ_EDIT_SHOW_MISSING_MEDIA) == 0)
1001 {
1002 return nullptr;
1003 }
1004
1005 ImBuf *ibuf = IMB_allocImBuf(max_ii(width, 1), max_ii(height, 1), 32, IB_rect);
1006 float col[4] = {0.85f, 0.0f, 0.75f, 1.0f};
1007 IMB_rectfill(ibuf, col);
1008 return ibuf;
1009}
1010
1012 Sequence *seq,
1013 int timeline_frame,
1014 bool *r_is_proxy_image)
1015{
1016 char filepath[FILE_MAX];
1017 const char *ext = nullptr;
1018 char prefix[FILE_MAX];
1019 ImBuf *ibuf = nullptr;
1020
1021 StripElem *s_elem = SEQ_render_give_stripelem(context->scene, seq, timeline_frame);
1022 if (s_elem == nullptr) {
1023 return nullptr;
1024 }
1025
1026 BLI_path_join(filepath, sizeof(filepath), seq->strip->dirpath, s_elem->filename);
1027 BLI_path_abs(filepath, ID_BLEND_PATH_FROM_GLOBAL(&context->scene->id));
1028
1029 /* Try to get a proxy image. */
1030 ibuf = seq_proxy_fetch(context, seq, timeline_frame);
1031 if (ibuf != nullptr) {
1032 *r_is_proxy_image = true;
1033 return ibuf;
1034 }
1035
1036 /* Proxy not found, render original. */
1037 const int totfiles = seq_num_files(context->scene, seq->views_format, true);
1038 bool is_multiview_render = seq_image_strip_is_multiview_render(
1039 context->scene, seq, totfiles, filepath, prefix, ext);
1040
1041 if (is_multiview_render) {
1042 int totviews = BKE_scene_multiview_num_views_get(&context->scene->r);
1043 ImBuf **ibufs_arr = static_cast<ImBuf **>(
1044 MEM_callocN(sizeof(ImBuf *) * totviews, "Sequence Image Views Imbufs"));
1045
1046 for (int view_id = 0; view_id < totfiles; view_id++) {
1047 ibufs_arr[view_id] = seq_render_image_strip_view(
1048 context, seq, filepath, prefix, ext, view_id);
1049 }
1050
1051 if (ibufs_arr[0] == nullptr) {
1052 return nullptr;
1053 }
1054
1055 if (seq->views_format == R_IMF_VIEWS_STEREO_3D) {
1056 IMB_ImBufFromStereo3d(seq->stereo3d_format, ibufs_arr[0], &ibufs_arr[0], &ibufs_arr[1]);
1057 }
1058
1059 for (int view_id = 0; view_id < totviews; view_id++) {
1060 SeqRenderData localcontext = *context;
1061 localcontext.view_id = view_id;
1062
1063 if (view_id != context->view_id) {
1064 ibufs_arr[view_id] = seq_render_preprocess_ibuf(
1065 &localcontext, seq, ibufs_arr[view_id], timeline_frame, true, false);
1066 }
1067 }
1068
1069 /* Return the original requested ImBuf. */
1070 ibuf = ibufs_arr[context->view_id];
1071
1072 /* Remove the others (decrease their refcount). */
1073 for (int view_id = 0; view_id < totviews; view_id++) {
1074 if (ibufs_arr[view_id] != ibuf) {
1075 IMB_freeImBuf(ibufs_arr[view_id]);
1076 }
1077 }
1078
1079 MEM_freeN(ibufs_arr);
1080 }
1081 else {
1082 ibuf = seq_render_image_strip_view(context, seq, filepath, prefix, ext, context->view_id);
1083 }
1084
1085 blender::seq::media_presence_set_missing(context->scene, seq, ibuf == nullptr);
1086 if (ibuf == nullptr) {
1087 return create_missing_media_image(context, s_elem->orig_width, s_elem->orig_height);
1088 }
1089
1090 s_elem->orig_width = ibuf->x;
1091 s_elem->orig_height = ibuf->y;
1092
1093 return ibuf;
1094}
1095
1097 Sequence *seq,
1098 int timeline_frame)
1099{
1100 char filepath[PROXY_MAXFILE];
1101 StripProxy *proxy = seq->strip->proxy;
1102
1103 if (proxy->anim == nullptr) {
1104 if (seq_proxy_get_custom_file_filepath(seq, filepath, context->view_id)) {
1105 proxy->anim = openanim(filepath, IB_rect, 0, seq->strip->colorspace_settings.name);
1106 }
1107 if (proxy->anim == nullptr) {
1108 return nullptr;
1109 }
1110 }
1111
1112 int frameno = round_fl_to_int(SEQ_give_frame_index(context->scene, seq, timeline_frame)) +
1113 seq->anim_startofs;
1114 return IMB_anim_absolute(proxy->anim, frameno, IMB_TC_NONE, IMB_PROXY_NONE);
1115}
1116
1118{
1119 bool use_timecodes = (seq->flag & SEQ_USE_PROXY) != 0;
1120 if (!use_timecodes) {
1121 return IMB_TC_NONE;
1122 }
1124 IMB_TC_NONE);
1125}
1126
1131 Sequence *seq,
1132 float timeline_frame,
1133 StripAnim *sanim,
1134 bool *r_is_proxy_image)
1135{
1136 ImBuf *ibuf = nullptr;
1137 IMB_Proxy_Size psize = IMB_Proxy_Size(SEQ_rendersize_to_proxysize(context->preview_render_size));
1138 const int frame_index = round_fl_to_int(
1139 SEQ_give_frame_index(context->scene, seq, timeline_frame));
1140
1141 if (SEQ_can_use_proxy(context, seq, psize)) {
1142 /* Try to get a proxy image.
1143 * Movie proxies are handled by ImBuf module with exception of `custom file` setting. */
1144 if (context->scene->ed->proxy_storage != SEQ_EDIT_PROXY_DIR_STORAGE &&
1146 {
1147 ibuf = seq_render_movie_strip_custom_file_proxy(context, seq, timeline_frame);
1148 }
1149 else {
1150 ibuf = IMB_anim_absolute(sanim->anim,
1151 frame_index + seq->anim_startofs,
1153 psize);
1154 }
1155
1156 if (ibuf != nullptr) {
1157 *r_is_proxy_image = true;
1158 }
1159 }
1160
1161 /* Fetching for requested proxy size failed, try fetching the original instead. */
1162 if (ibuf == nullptr) {
1163 ibuf = IMB_anim_absolute(sanim->anim,
1164 frame_index + seq->anim_startofs,
1167 }
1168 if (ibuf == nullptr) {
1169 return nullptr;
1170 }
1171
1172 seq_imbuf_to_sequencer_space(context->scene, ibuf, false);
1173
1174 /* We don't need both (speed reasons)! */
1175 if (ibuf->float_buffer.data != nullptr && ibuf->byte_buffer.data != nullptr) {
1176 imb_freerectImBuf(ibuf);
1177 }
1178
1179 return ibuf;
1180}
1181
1183 Sequence *seq,
1184 float timeline_frame,
1185 bool *r_is_proxy_image)
1186{
1187 /* Load all the videos. */
1188 seq_open_anim_file(context->scene, seq, false);
1189
1190 ImBuf *ibuf = nullptr;
1191 StripAnim *sanim = static_cast<StripAnim *>(seq->anims.first);
1192 const int totfiles = seq_num_files(context->scene, seq->views_format, true);
1193 bool is_multiview_render = (seq->flag & SEQ_USE_VIEWS) != 0 &&
1194 (context->scene->r.scemode & R_MULTIVIEW) != 0 &&
1195 BLI_listbase_count_is_equal_to(&seq->anims, totfiles);
1196
1197 if (is_multiview_render) {
1198 ImBuf **ibuf_arr;
1199 int totviews = BKE_scene_multiview_num_views_get(&context->scene->r);
1200 ibuf_arr = static_cast<ImBuf **>(
1201 MEM_callocN(sizeof(ImBuf *) * totviews, "Sequence Image Views Imbufs"));
1202 int ibuf_view_id;
1203
1204 for (ibuf_view_id = 0, sanim = static_cast<StripAnim *>(seq->anims.first); sanim;
1205 sanim = sanim->next, ibuf_view_id++)
1206 {
1207 if (sanim->anim) {
1208 ibuf_arr[ibuf_view_id] = seq_render_movie_strip_view(
1209 context, seq, timeline_frame, sanim, r_is_proxy_image);
1210 }
1211 }
1212
1213 if (seq->views_format == R_IMF_VIEWS_STEREO_3D) {
1214 if (ibuf_arr[0] == nullptr) {
1215 /* Probably proxy hasn't been created yet. */
1216 MEM_freeN(ibuf_arr);
1217 return nullptr;
1218 }
1219
1220 IMB_ImBufFromStereo3d(seq->stereo3d_format, ibuf_arr[0], &ibuf_arr[0], &ibuf_arr[1]);
1221 }
1222
1223 for (int view_id = 0; view_id < totviews; view_id++) {
1224 SeqRenderData localcontext = *context;
1225 localcontext.view_id = view_id;
1226
1227 if (view_id != context->view_id && ibuf_arr[view_id]) {
1228 ibuf_arr[view_id] = seq_render_preprocess_ibuf(
1229 &localcontext, seq, ibuf_arr[view_id], timeline_frame, true, false);
1230 }
1231 }
1232
1233 /* Return the original requested ImBuf. */
1234 ibuf = ibuf_arr[context->view_id];
1235
1236 /* Remove the others (decrease their refcount). */
1237 for (int view_id = 0; view_id < totviews; view_id++) {
1238 if (ibuf_arr[view_id] != ibuf) {
1239 IMB_freeImBuf(ibuf_arr[view_id]);
1240 }
1241 }
1242
1243 MEM_freeN(ibuf_arr);
1244 }
1245 else {
1246 ibuf = seq_render_movie_strip_view(context, seq, timeline_frame, sanim, r_is_proxy_image);
1247 }
1248
1249 blender::seq::media_presence_set_missing(context->scene, seq, ibuf == nullptr);
1250 if (ibuf == nullptr) {
1252 context, seq->strip->stripdata->orig_width, seq->strip->stripdata->orig_height);
1253 }
1254
1255 if (*r_is_proxy_image == false) {
1256 if (sanim && sanim->anim) {
1257 short fps_denom;
1258 float fps_num;
1259 IMB_anim_get_fps(sanim->anim, true, &fps_denom, &fps_num);
1260 seq->strip->stripdata->orig_fps = fps_denom / fps_num;
1261 }
1262 seq->strip->stripdata->orig_width = ibuf->x;
1263 seq->strip->stripdata->orig_height = ibuf->y;
1264 }
1265
1266 return ibuf;
1267}
1268
1270{
1271 ImBuf *ibuf = nullptr;
1272 float tloc[2], tscale, tangle;
1274 ibuf = BKE_movieclip_get_stable_ibuf(seq->clip, &user, 0, tloc, &tscale, &tangle);
1275 }
1276 else {
1278 }
1279 return ibuf;
1280}
1281
1283 Sequence *seq,
1284 float frame_index,
1285 bool *r_is_proxy_image)
1286{
1287 ImBuf *ibuf = nullptr;
1289 IMB_Proxy_Size psize = IMB_Proxy_Size(SEQ_rendersize_to_proxysize(context->preview_render_size));
1290
1291 if (!seq->clip) {
1292 return nullptr;
1293 }
1294
1295 BKE_movieclip_user_set_frame(&user, frame_index + seq->anim_startofs + seq->clip->start_frame);
1296
1298 switch (psize) {
1299 case IMB_PROXY_NONE:
1301 break;
1302 case IMB_PROXY_100:
1304 break;
1305 case IMB_PROXY_75:
1307 break;
1308 case IMB_PROXY_50:
1310 break;
1311 case IMB_PROXY_25:
1313 break;
1314 }
1315
1318 }
1319
1320 /* Try to get a proxy image. */
1321 ibuf = seq_get_movieclip_ibuf(seq, user);
1322
1323 /* If clip doesn't use proxies, it will fallback to full size render of original file. */
1324 if (ibuf != nullptr && psize != IMB_PROXY_NONE && BKE_movieclip_proxy_enabled(seq->clip)) {
1325 *r_is_proxy_image = true;
1326 }
1327
1328 /* If proxy is not found, grab full-size frame. */
1329 if (ibuf == nullptr) {
1331 ibuf = seq_get_movieclip_ibuf(seq, user);
1332 }
1333
1334 return ibuf;
1335}
1336
1338 Mask *mask,
1339 float frame_index,
1340 bool make_float)
1341{
1342 /* TODO: add option to rasterize to alpha imbuf? */
1343 ImBuf *ibuf = nullptr;
1344 float *maskbuf;
1345 int i;
1346
1347 if (!mask) {
1348 return nullptr;
1349 }
1350
1351 AnimData *adt;
1352 Mask *mask_temp;
1353 MaskRasterHandle *mr_handle;
1354
1355 mask_temp = (Mask *)BKE_id_copy_ex(
1356 nullptr, &mask->id, nullptr, LIB_ID_COPY_LOCALIZE | LIB_ID_COPY_NO_ANIMDATA);
1357
1358 BKE_mask_evaluate(mask_temp, mask->sfra + frame_index, true);
1359
1360 /* anim-data */
1361 adt = BKE_animdata_from_id(&mask->id);
1363 context->depsgraph, mask->sfra + frame_index);
1364 BKE_animsys_evaluate_animdata(&mask_temp->id, adt, &anim_eval_context, ADT_RECALC_ANIM, false);
1365
1366 maskbuf = static_cast<float *>(
1367 MEM_mallocN(sizeof(float) * context->rectx * context->recty, __func__));
1368
1369 mr_handle = BKE_maskrasterize_handle_new();
1370
1372 mr_handle, mask_temp, context->rectx, context->recty, true, true, true);
1373
1374 BKE_id_free(nullptr, &mask_temp->id);
1375
1376 BKE_maskrasterize_buffer(mr_handle, context->rectx, context->recty, maskbuf);
1377
1379
1380 if (make_float) {
1381 /* pixels */
1382 const float *fp_src;
1383 float *fp_dst;
1384
1385 ibuf = IMB_allocImBuf(
1386 context->rectx, context->recty, 32, IB_rectfloat | IB_uninitialized_pixels);
1387
1388 fp_src = maskbuf;
1389 fp_dst = ibuf->float_buffer.data;
1390 i = context->rectx * context->recty;
1391 while (--i) {
1392 fp_dst[0] = fp_dst[1] = fp_dst[2] = *fp_src;
1393 fp_dst[3] = 1.0f;
1394
1395 fp_src += 1;
1396 fp_dst += 4;
1397 }
1398 }
1399 else {
1400 /* pixels */
1401 const float *fp_src;
1402 uchar *ub_dst;
1403
1404 ibuf = IMB_allocImBuf(context->rectx, context->recty, 32, IB_rect | IB_uninitialized_pixels);
1405
1406 fp_src = maskbuf;
1407 ub_dst = ibuf->byte_buffer.data;
1408 i = context->rectx * context->recty;
1409 while (--i) {
1410 ub_dst[0] = ub_dst[1] = ub_dst[2] = uchar(*fp_src * 255.0f); /* already clamped */
1411 ub_dst[3] = 255;
1412
1413 fp_src += 1;
1414 ub_dst += 4;
1415 }
1416 }
1417
1418 MEM_freeN(maskbuf);
1419
1420 return ibuf;
1421}
1422
1423static ImBuf *seq_render_mask_strip(const SeqRenderData *context, Sequence *seq, float frame_index)
1424{
1425 bool make_float = (seq->flag & SEQ_MAKE_FLOAT) != 0;
1426
1427 return seq_render_mask(context, seq->mask, frame_index, make_float);
1428}
1429
1431 Sequence *seq,
1432 float frame_index,
1433 float timeline_frame)
1434{
1435 ImBuf *ibuf = nullptr;
1436 double frame;
1437 Object *camera;
1438
1439 struct {
1440 int scemode;
1441 int timeline_frame;
1442 float subframe;
1443
1444#ifdef DURIAN_CAMERA_SWITCH
1445 int mode;
1446#endif
1447 } orig_data;
1448
1449 /* Old info:
1450 * Hack! This function can be called from do_render_seq(), in that case
1451 * the seq->scene can already have a Render initialized with same name,
1452 * so we have to use a default name. (compositor uses scene name to
1453 * find render).
1454 * However, when called from within the UI (image preview in sequencer)
1455 * we do want to use scene Render, that way the render result is defined
1456 * for display in render/image-window
1457 *
1458 * Hmm, don't see, why we can't do that all the time,
1459 * and since G.is_rendering is uhm, gone... (Peter)
1460 */
1461
1462 /* New info:
1463 * Using the same name for the renders works just fine as the do_render_seq()
1464 * render is not used while the scene strips are rendered.
1465 *
1466 * However rendering from UI (through sequencer_preview_area_draw) can crash in
1467 * very many cases since other renders (material preview, an actual render etc.)
1468 * can be started while this sequence preview render is running. The only proper
1469 * solution is to make the sequencer preview render a proper job, which can be
1470 * stopped when needed. This would also give a nice progress bar for the preview
1471 * space so that users know there's something happening.
1472 *
1473 * As a result the active scene now only uses OpenGL rendering for the sequencer
1474 * preview. This is far from nice, but is the only way to prevent crashes at this
1475 * time.
1476 *
1477 * -jahka
1478 */
1479
1480 const bool is_rendering = G.is_rendering;
1481 bool is_preview = !context->for_render && (context->scene->r.seq_prev_type) != OB_RENDER;
1482
1483 bool have_comp = false;
1484 bool use_gpencil = true;
1485 /* do we need to re-evaluate the frame after rendering? */
1486 bool is_frame_update = false;
1487 Scene *scene;
1488
1489 /* don't refer to seq->scene above this point!, it can be nullptr */
1490 if (seq->scene == nullptr) {
1491 return create_missing_media_image(context, context->rectx, context->recty);
1492 }
1493
1494 /* Prevent rendering scene recursively. */
1495 if (seq->scene == context->scene) {
1496 return nullptr;
1497 }
1498
1499 scene = seq->scene;
1500 frame = double(scene->r.sfra) + double(frame_index) + double(seq->anim_startofs);
1501
1502#if 0 /* UNUSED */
1503 have_seq = (scene->r.scemode & R_DOSEQ) && scene->ed && scene->ed->seqbase.first;
1504#endif
1505 have_comp = (scene->r.scemode & R_DOCOMP) && scene->use_nodes && scene->nodetree;
1506
1507 /* Get view layer for the strip. */
1508 ViewLayer *view_layer = BKE_view_layer_default_render(scene);
1509 /* Depsgraph will be nullptr when doing rendering. */
1510 Depsgraph *depsgraph = nullptr;
1511
1512 orig_data.scemode = scene->r.scemode;
1513 orig_data.timeline_frame = scene->r.cfra;
1514 orig_data.subframe = scene->r.subframe;
1515#ifdef DURIAN_CAMERA_SWITCH
1516 orig_data.mode = scene->r.mode;
1517#endif
1518
1519 BKE_scene_frame_set(scene, frame);
1520
1521 if (seq->scene_camera) {
1522 camera = seq->scene_camera;
1523 }
1524 else {
1526 camera = scene->camera;
1527 }
1528
1529 if (have_comp == false && camera == nullptr) {
1530 goto finally;
1531 }
1532
1533 if (seq->flag & SEQ_SCENE_NO_ANNOTATION) {
1534 use_gpencil = false;
1535 }
1536
1537 /* prevent eternal loop */
1538 scene->r.scemode &= ~R_DOSEQ;
1539
1540#ifdef DURIAN_CAMERA_SWITCH
1541 /* stooping to new low's in hackyness :( */
1542 scene->r.mode |= R_NO_CAMERA_SWITCH;
1543#endif
1544
1545 is_frame_update = (orig_data.timeline_frame != scene->r.cfra) ||
1546 (orig_data.subframe != scene->r.subframe);
1547
1548 if (sequencer_view3d_fn && is_preview && camera && BLI_thread_is_main()) {
1549 char err_out[256] = "unknown";
1550 int width, height;
1551 BKE_render_resolution(&scene->r, false, &width, &height);
1552 const char *viewname = BKE_scene_multiview_render_view_name_get(&scene->r, context->view_id);
1553
1554 uint draw_flags = V3D_OFSDRAW_NONE;
1555 draw_flags |= (use_gpencil) ? V3D_OFSDRAW_SHOW_ANNOTATION : 0;
1556 draw_flags |= (context->scene->r.seq_flag & R_SEQ_OVERRIDE_SCENE_SETTINGS) ?
1558 0;
1559
1560 /* for old scene this can be uninitialized,
1561 * should probably be added to do_versions at some point if the functionality stays */
1562 if (context->scene->r.seq_prev_type == 0) {
1563 context->scene->r.seq_prev_type = 3 /* == OB_SOLID */;
1564 }
1565
1566 /* opengl offscreen render */
1567 depsgraph = BKE_scene_ensure_depsgraph(context->bmain, scene, view_layer);
1569 Object *camera_eval = DEG_get_evaluated_object(depsgraph, camera);
1570 ibuf = sequencer_view3d_fn(
1571 /* set for OpenGL render (nullptr when scrubbing) */
1572 depsgraph,
1573 scene,
1574 &context->scene->display.shading,
1575 eDrawType(context->scene->r.seq_prev_type),
1576 camera_eval,
1577 width,
1578 height,
1579 IB_rect,
1580 eV3DOffscreenDrawFlag(draw_flags),
1581 scene->r.alphamode,
1582 viewname,
1583 context->gpu_offscreen,
1584 context->gpu_viewport,
1585 err_out);
1586 if (ibuf == nullptr) {
1587 fprintf(stderr, "seq_render_scene_strip failed to get opengl buffer: %s\n", err_out);
1588 }
1589 }
1590 else {
1591 Render *re = RE_GetSceneRender(scene);
1592 const int totviews = BKE_scene_multiview_num_views_get(&scene->r);
1593 ImBuf **ibufs_arr;
1594
1595 /*
1596 * XXX: this if can be removed when sequence preview rendering uses the job system
1597 *
1598 * Disable rendered preview for sequencer while rendering - invoked render job will
1599 * conflict with already running render
1600 *
1601 * When rendering from command line renderer is called from main thread, in this
1602 * case it's always safe to render scene here
1603 */
1604
1605 if (is_preview && (is_rendering && !G.background)) {
1606 goto finally;
1607 }
1608
1609 ibufs_arr = static_cast<ImBuf **>(
1610 MEM_callocN(sizeof(ImBuf *) * totviews, "Sequence Image Views Imbufs"));
1611
1612 if (re == nullptr) {
1613 re = RE_NewSceneRender(scene);
1614 }
1615
1616 const float subframe = frame - floorf(frame);
1617
1618 RE_RenderFrame(re,
1619 context->bmain,
1620 scene,
1621 have_comp ? nullptr : view_layer,
1622 camera,
1623 floorf(frame),
1624 subframe,
1625 false);
1626
1627 /* restore previous state after it was toggled on & off by RE_RenderFrame */
1628 G.is_rendering = is_rendering;
1629
1630 for (int view_id = 0; view_id < totviews; view_id++) {
1631 SeqRenderData localcontext = *context;
1632 RenderResult rres;
1633
1634 localcontext.view_id = view_id;
1635
1636 RE_AcquireResultImage(re, &rres, view_id);
1637
1638 /* TODO: Share the pixel data with the original image buffer from the render result using
1639 * implicit sharing. */
1640 if (rres.ibuf && rres.ibuf->float_buffer.data) {
1641 ibufs_arr[view_id] = IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rectfloat);
1642 memcpy(ibufs_arr[view_id]->float_buffer.data,
1643 rres.ibuf->float_buffer.data,
1644 sizeof(float[4]) * rres.rectx * rres.recty);
1645
1646 /* float buffers in the sequencer are not linear */
1647 seq_imbuf_to_sequencer_space(context->scene, ibufs_arr[view_id], false);
1648 }
1649 else if (rres.ibuf && rres.ibuf->byte_buffer.data) {
1650 ibufs_arr[view_id] = IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rect);
1651 memcpy(ibufs_arr[view_id]->byte_buffer.data,
1652 rres.ibuf->byte_buffer.data,
1653 4 * rres.rectx * rres.recty);
1654 }
1655 else {
1656 ibufs_arr[view_id] = IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rect);
1657 }
1658
1659 if (view_id != context->view_id) {
1660 seq_cache_put(&localcontext, seq, timeline_frame, SEQ_CACHE_STORE_RAW, ibufs_arr[view_id]);
1661 }
1662
1664 }
1665
1666 /* return the original requested ImBuf */
1667 ibuf = ibufs_arr[context->view_id];
1668
1669 /* "remove" the others (decrease their refcount) */
1670 for (int view_id = 0; view_id < totviews; view_id++) {
1671 if (ibufs_arr[view_id] != ibuf) {
1672 IMB_freeImBuf(ibufs_arr[view_id]);
1673 }
1674 }
1675 MEM_freeN(ibufs_arr);
1676 }
1677
1678finally:
1679 /* restore */
1680 scene->r.scemode = orig_data.scemode;
1681 scene->r.cfra = orig_data.timeline_frame;
1682 scene->r.subframe = orig_data.subframe;
1683
1684 if (is_frame_update && (depsgraph != nullptr)) {
1686 }
1687
1688#ifdef DURIAN_CAMERA_SWITCH
1689 /* stooping to new low's in hackyness :( */
1690 scene->r.mode &= orig_data.mode | ~R_NO_CAMERA_SWITCH;
1691#endif
1692
1693 return ibuf;
1694}
1695
1701 Sequence *seq,
1702 float frame_index)
1703{
1704 ImBuf *ibuf = nullptr;
1705 ListBase *seqbase = nullptr;
1706 ListBase *channels = nullptr;
1707 int offset;
1708
1709 seqbase = SEQ_get_seqbase_from_sequence(seq, &channels, &offset);
1710
1711 if (seqbase && !BLI_listbase_is_empty(seqbase)) {
1712
1713 if (seq->flag & SEQ_SCENE_STRIPS && seq->scene) {
1714 BKE_animsys_evaluate_all_animation(context->bmain, context->depsgraph, frame_index + offset);
1715 }
1716
1717 ibuf = seq_render_strip_stack(context,
1718 state,
1719 channels,
1720 seqbase,
1721 /* scene strips don't have their start taken into account */
1722 frame_index + offset,
1723 0);
1724 }
1725
1726 return ibuf;
1727}
1728
1731/* -------------------------------------------------------------------- */
1737 Sequence *seq,
1738 float timeline_frame,
1739 bool *r_is_proxy_image)
1740{
1741 ImBuf *ibuf = nullptr;
1742 float frame_index = SEQ_give_frame_index(context->scene, seq, timeline_frame);
1743 int type = (seq->type & SEQ_TYPE_EFFECT) ? SEQ_TYPE_EFFECT : seq->type;
1744 switch (type) {
1745 case SEQ_TYPE_META: {
1746 ibuf = do_render_strip_seqbase(context, state, seq, frame_index);
1747 break;
1748 }
1749
1750 case SEQ_TYPE_SCENE: {
1751 if (seq->flag & SEQ_SCENE_STRIPS) {
1752 if (seq->scene && (context->scene != seq->scene)) {
1753 /* recursive check */
1754 if (BLI_linklist_index(state->scene_parents, seq->scene) != -1) {
1755 break;
1756 }
1757 LinkNode scene_parent{};
1758 scene_parent.next = state->scene_parents;
1759 scene_parent.link = seq->scene;
1760 state->scene_parents = &scene_parent;
1761 /* end check */
1762
1763 /* Use the Scene sequence-strip's scene for the context when rendering the
1764 * scene's sequences (necessary for multi-cam selector among others). */
1765 SeqRenderData local_context = *context;
1766 local_context.scene = seq->scene;
1767 local_context.skip_cache = true;
1768
1769 ibuf = do_render_strip_seqbase(&local_context, state, seq, frame_index);
1770
1771 /* step back in the list */
1772 state->scene_parents = state->scene_parents->next;
1773 }
1774 }
1775 else {
1776 /* scene can be nullptr after deletions */
1777 ibuf = seq_render_scene_strip(context, seq, frame_index, timeline_frame);
1778 }
1779
1780 break;
1781 }
1782
1783 case SEQ_TYPE_EFFECT: {
1784 ibuf = seq_render_effect_strip_impl(context, state, seq, timeline_frame);
1785 break;
1786 }
1787
1788 case SEQ_TYPE_IMAGE: {
1789 ibuf = seq_render_image_strip(context, seq, timeline_frame, r_is_proxy_image);
1790 break;
1791 }
1792
1793 case SEQ_TYPE_MOVIE: {
1794 ibuf = seq_render_movie_strip(context, seq, timeline_frame, r_is_proxy_image);
1795 break;
1796 }
1797
1798 case SEQ_TYPE_MOVIECLIP: {
1800 context, seq, round_fl_to_int(frame_index), r_is_proxy_image);
1801
1802 if (ibuf) {
1803 /* duplicate frame so movie cache wouldn't be confused by sequencer's stuff */
1804 ImBuf *i = IMB_dupImBuf(ibuf);
1805 IMB_freeImBuf(ibuf);
1806 ibuf = i;
1807
1808 if (ibuf->float_buffer.data) {
1809 seq_imbuf_to_sequencer_space(context->scene, ibuf, false);
1810 }
1811 }
1812
1813 break;
1814 }
1815
1816 case SEQ_TYPE_MASK: {
1817 /* ibuf is always new */
1818 ibuf = seq_render_mask_strip(context, seq, frame_index);
1819 break;
1820 }
1821 }
1822
1823 if (ibuf) {
1824 seq_imbuf_assign_spaces(context->scene, ibuf);
1825 }
1826
1827 return ibuf;
1828}
1829
1832 Sequence *seq,
1833 float timeline_frame)
1834{
1835 ImBuf *ibuf = nullptr;
1836 bool use_preprocess = false;
1837 bool is_proxy_image = false;
1838
1839 ibuf = seq_cache_get(context, seq, timeline_frame, SEQ_CACHE_STORE_PREPROCESSED);
1840 if (ibuf != nullptr) {
1841 return ibuf;
1842 }
1843
1844 /* Proxies are not stored in cache. */
1845 if (!SEQ_can_use_proxy(context, seq, SEQ_rendersize_to_proxysize(context->preview_render_size)))
1846 {
1847 ibuf = seq_cache_get(context, seq, timeline_frame, SEQ_CACHE_STORE_RAW);
1848 }
1849
1850 if (ibuf == nullptr) {
1851 ibuf = do_render_strip_uncached(context, state, seq, timeline_frame, &is_proxy_image);
1852 }
1853
1854 if (ibuf) {
1855 use_preprocess = seq_input_have_to_preprocess(context, seq, timeline_frame);
1857 context, seq, ibuf, timeline_frame, use_preprocess, is_proxy_image);
1858 }
1859
1860 if (ibuf == nullptr) {
1861 ibuf = IMB_allocImBuf(context->rectx, context->recty, 32, IB_rect);
1862 seq_imbuf_assign_spaces(context->scene, ibuf);
1863 }
1864
1865 return ibuf;
1866}
1867
1869{
1870 bool swap_input = false;
1871
1872 /* bad hack, to fix crazy input ordering of
1873 * those two effects */
1874
1876 swap_input = true;
1877 }
1878
1879 return swap_input;
1880}
1881
1883{
1885 float fac = seq->blend_opacity / 100.0f;
1886 StripEarlyOut early_out = sh.early_out(seq, fac);
1887
1889 return early_out;
1890 }
1891
1893 if (early_out == StripEarlyOut::UseInput2) {
1895 }
1896 if (early_out == StripEarlyOut::UseInput1) {
1898 }
1899 }
1900 return early_out;
1901}
1902
1904 const SeqRenderData *context, Sequence *seq, float timeline_frame, ImBuf *ibuf1, ImBuf *ibuf2)
1905{
1906 ImBuf *out;
1908 float fac = seq->blend_opacity / 100.0f;
1909 int swap_input = seq_must_swap_input_in_blend_mode(seq);
1910
1911 if (swap_input) {
1912 if (sh.multithreaded) {
1914 &sh, context, seq, timeline_frame, fac, ibuf2, ibuf1);
1915 }
1916 else {
1917 out = sh.execute(context, seq, timeline_frame, fac, ibuf2, ibuf1);
1918 }
1919 }
1920 else {
1921 if (sh.multithreaded) {
1923 &sh, context, seq, timeline_frame, fac, ibuf1, ibuf2);
1924 }
1925 else {
1926 out = sh.execute(context, seq, timeline_frame, fac, ibuf1, ibuf2);
1927 }
1928 }
1929
1930 return out;
1931}
1932
1933static bool is_opaque_alpha_over(const Sequence *seq)
1934{
1935 if (seq->blend_mode != SEQ_TYPE_ALPHAOVER) {
1936 return false;
1937 }
1938 if (seq->blend_opacity < 100.0f) {
1939 return false;
1940 }
1941 if (seq->mul < 1.0f && (seq->flag & SEQ_MULTIPLY_ALPHA) != 0) {
1942 return false;
1943 }
1945 /* Assume result is not opaque if there is an enabled Mask modifier. */
1946 if ((smd->flag & SEQUENCE_MODIFIER_MUTE) == 0 && smd->type == seqModifierType_Mask) {
1947 return false;
1948 }
1949 }
1950 return true;
1951}
1952
1955 ListBase *channels,
1956 ListBase *seqbasep,
1957 float timeline_frame,
1958 int chanshown)
1959{
1961 context->scene, channels, seqbasep, timeline_frame, chanshown);
1962 if (strips.is_empty()) {
1963 return nullptr;
1964 }
1965
1966 OpaqueQuadTracker opaques;
1967
1968 int64_t i;
1969 ImBuf *out = nullptr;
1970 for (i = strips.size() - 1; i >= 0; i--) {
1971 Sequence *seq = strips[i];
1972
1973 out = seq_cache_get(context, seq, timeline_frame, SEQ_CACHE_STORE_COMPOSITE);
1974
1975 if (out) {
1976 break;
1977 }
1978 if (seq->blend_mode == SEQ_BLEND_REPLACE) {
1979 out = seq_render_strip(context, state, seq, timeline_frame);
1980 break;
1981 }
1982
1984
1985 if (early_out == StripEarlyOut::DoEffect && opaques.is_occluded(context, seq, i)) {
1986 early_out = StripEarlyOut::UseInput1;
1987 }
1988
1989 /* "Alpha over" is default for all strips, and it can be optimized in some cases:
1990 * - If the whole image has no transparency, there's no need to do actual blending.
1991 * - Likewise, if we are at the bottom of the stack; the input can be used as-is.
1992 * - If we are rendering a strip that is known to be opaque, we mark it as an occluder,
1993 * so that strips below can check if they are completely hidden. */
1994 if (out == nullptr && early_out == StripEarlyOut::DoEffect && is_opaque_alpha_over(seq)) {
1995 ImBuf *test = seq_render_strip(context, state, seq, timeline_frame);
1996 if (ELEM(test->planes, R_IMF_PLANES_BW, R_IMF_PLANES_RGB) || i == 0) {
1997 early_out = StripEarlyOut::UseInput2;
1998 }
1999 else {
2000 early_out = StripEarlyOut::DoEffect;
2001 }
2002 /* Free the image. It is stored in cache, so this doesn't affect performance. */
2003 IMB_freeImBuf(test);
2004
2005 /* Check whether the raw (before preprocessing, which can add alpha) strip content
2006 * was opaque. */
2007 ImBuf *ibuf_raw = seq_cache_get(context, seq, timeline_frame, SEQ_CACHE_STORE_RAW);
2008 if (ibuf_raw != nullptr) {
2009 if (ibuf_raw->planes != R_IMF_PLANES_RGBA) {
2010 opaques.add_occluder(context, seq, i);
2011 }
2012 IMB_freeImBuf(ibuf_raw);
2013 }
2014 }
2015
2016 switch (early_out) {
2019 out = seq_render_strip(context, state, seq, timeline_frame);
2020 break;
2022 if (i == 0) {
2023 out = IMB_allocImBuf(context->rectx, context->recty, 32, IB_rect);
2024 seq_imbuf_assign_spaces(context->scene, out);
2025 }
2026 break;
2028 if (i == 0) {
2029 /* This is an effect at the bottom of the stack, so one of the inputs does not exist yet:
2030 * create one that is transparent black. Extra optimization for an alpha over strip at
2031 * the bottom, we can just return it instead of blending with black. */
2032 ImBuf *ibuf2 = seq_render_strip(context, state, seq, timeline_frame);
2033 const bool use_float = ibuf2 && ibuf2->float_buffer.data;
2034 ImBuf *ibuf1 = IMB_allocImBuf(
2035 context->rectx, context->recty, 32, use_float ? IB_rectfloat : IB_rect);
2036 seq_imbuf_assign_spaces(context->scene, ibuf1);
2037
2038 out = seq_render_strip_stack_apply_effect(context, seq, timeline_frame, ibuf1, ibuf2);
2039 IMB_metadata_copy(out, ibuf2);
2040
2041 seq_cache_put(context, strips[i], timeline_frame, SEQ_CACHE_STORE_COMPOSITE, out);
2042
2043 IMB_freeImBuf(ibuf1);
2044 IMB_freeImBuf(ibuf2);
2045 }
2046 break;
2047 }
2048
2049 if (out) {
2050 break;
2051 }
2052 }
2053
2054 i++;
2055 for (; i < strips.size(); i++) {
2056 Sequence *seq = strips[i];
2057
2058 if (opaques.is_occluded(context, seq, i)) {
2059 continue;
2060 }
2061
2063 ImBuf *ibuf1 = out;
2064 ImBuf *ibuf2 = seq_render_strip(context, state, seq, timeline_frame);
2065
2066 out = seq_render_strip_stack_apply_effect(context, seq, timeline_frame, ibuf1, ibuf2);
2067
2068 IMB_freeImBuf(ibuf1);
2069 IMB_freeImBuf(ibuf2);
2070 }
2071
2072 seq_cache_put(context, strips[i], timeline_frame, SEQ_CACHE_STORE_COMPOSITE, out);
2073 }
2074
2075 return out;
2076}
2077
2078ImBuf *SEQ_render_give_ibuf(const SeqRenderData *context, float timeline_frame, int chanshown)
2079{
2080 Scene *scene = context->scene;
2081 Editing *ed = SEQ_editing_get(scene);
2082 ListBase *seqbasep;
2084
2085 if (ed == nullptr) {
2086 return nullptr;
2087 }
2088
2089 if ((chanshown < 0) && !BLI_listbase_is_empty(&ed->metastack)) {
2091 count = max_ii(count + chanshown, 0);
2092 seqbasep = ((MetaStack *)BLI_findlink(&ed->metastack, count))->oldbasep;
2093 channels = ((MetaStack *)BLI_findlink(&ed->metastack, count))->old_channels;
2094 }
2095 else {
2096 seqbasep = ed->seqbasep;
2097 channels = ed->displayed_channels;
2098 }
2099
2101 ImBuf *out = nullptr;
2102
2104 scene, channels, seqbasep, timeline_frame, chanshown);
2105
2106 if (!strips.is_empty()) {
2107 out = seq_cache_get(context, strips.last(), timeline_frame, SEQ_CACHE_STORE_FINAL_OUT);
2108 }
2109
2110 seq_cache_free_temp_cache(context->scene, context->task_id, timeline_frame);
2111 /* Make sure we only keep the `anim` data for strips that are in view. */
2112 SEQ_relations_free_all_anim_ibufs(context->scene, timeline_frame);
2113
2114 if (!strips.is_empty() && !out) {
2116 out = seq_render_strip_stack(context, &state, channels, seqbasep, timeline_frame, chanshown);
2117
2118 if (context->is_prefetch_render) {
2119 seq_cache_put(context, strips.last(), timeline_frame, SEQ_CACHE_STORE_FINAL_OUT, out);
2120 }
2121 else {
2123 context, strips.last(), timeline_frame, SEQ_CACHE_STORE_FINAL_OUT, out);
2124 }
2126 }
2127
2128 seq_prefetch_start(context, timeline_frame);
2129
2130 return out;
2131}
2132
2134 float timeline_frame,
2135 int chan_shown,
2136 ListBase *channels,
2137 ListBase *seqbasep)
2138{
2140
2141 return seq_render_strip_stack(context, &state, channels, seqbasep, timeline_frame, chan_shown);
2142}
2143
2145 float timeline_frame,
2146 Sequence *seq)
2147{
2149
2150 ImBuf *ibuf = seq_render_strip(context, &state, seq, timeline_frame);
2151 return ibuf;
2152}
2153
2154bool SEQ_render_is_muted(const ListBase *channels, const Sequence *seq)
2155{
2156
2157 SeqTimelineChannel *channel = SEQ_channel_get_by_index(channels, seq->machine);
2158 return seq->flag & SEQ_MUTE || SEQ_channel_is_muted(channel);
2159}
2160
AnimData * BKE_animdata_from_id(const ID *id)
Definition anim_data.cc:89
void BKE_animsys_evaluate_all_animation(struct Main *main, struct Depsgraph *depsgraph, float ctime)
Definition anim_sys.cc:4039
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
Definition anim_sys.cc:734
@ ADT_RECALC_ANIM
void BKE_animsys_evaluate_animdata(struct ID *id, struct AnimData *adt, const struct AnimationEvalContext *anim_eval_context, eAnimData_Recalc recalc, bool flush_to_original)
float evaluate_fcurve(const FCurve *fcu, float evaltime)
FCurve * id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *prop_name, int index, bool *r_driven)
ImBufAnim * openanim(const char *filepath, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
ViewLayer * BKE_view_layer_default_render(const Scene *scene)
@ LIB_ID_COPY_LOCALIZE
@ LIB_ID_COPY_NO_ANIMDATA
void BKE_id_free(Main *bmain, void *idv)
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
Definition lib_id.cc:760
void BKE_maskrasterize_handle_free(MaskRasterHandle *mr_handle)
MaskRasterHandle * BKE_maskrasterize_handle_new(void)
void BKE_mask_evaluate(struct Mask *mask, float ctime, bool do_newframe)
void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mask, int width, int height, bool do_aspect_correct, bool do_mask_aa, bool do_feather)
void BKE_maskrasterize_buffer(MaskRasterHandle *mr_handle, unsigned int width, unsigned int height, float *buffer)
Rasterize a buffer from a single mask (threaded execution).
struct ImBuf * BKE_movieclip_get_stable_ibuf(struct MovieClip *clip, const struct MovieClipUser *user, int postprocess_flag, float r_loc[2], float *r_scale, float *r_angle)
bool BKE_movieclip_proxy_enabled(struct MovieClip *clip)
#define MOVIECLIP_CACHE_SKIP
void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr)
struct ImBuf * BKE_movieclip_get_ibuf_flag(struct MovieClip *clip, const struct MovieClipUser *user, int flag, int cache_flag)
void BKE_render_resolution(const RenderData *r, const bool use_crop, int *r_width, int *r_height)
Definition scene.cc:2877
int BKE_scene_multiview_num_views_get(const RenderData *rd)
Definition scene.cc:2928
void BKE_scene_frame_set(Scene *scene, float frame)
Definition scene.cc:2336
void BKE_scene_multiview_view_prefix_get(Scene *scene, const char *filepath, char *r_prefix, const char **r_ext)
Definition scene.cc:3152
bool BKE_scene_camera_switch_update(Scene *scene)
Definition scene.cc:2213
Depsgraph * BKE_scene_ensure_depsgraph(Main *bmain, Scene *scene, ViewLayer *view_layer)
Definition scene.cc:3377
void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph)
Definition scene.cc:2647
const char * BKE_scene_multiview_render_view_name_get(const RenderData *rd, int view_id)
Definition scene.cc:3059
struct ImBuf *(* SequencerDrawView)(struct Depsgraph *depsgraph, struct Scene *scene, struct View3DShading *shading_override, eDrawType drawtype, struct Object *camera, int width, int height, enum eImBufFlags flag, eV3DOffscreenDrawFlag draw_flags, int alpha_mode, const char *viewname, struct GPUOffScreen *ofs, struct GPUViewport *viewport, char err_out[256])
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:57
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_count_is_equal_to(const struct ListBase *listbase, const int count_cmp)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int round_fl_to_int(float a)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
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])
void loc_rot_size_to_mat4(float R[4][4], const float loc[3], const float rot[3][3], const float size[3])
void transform_pivot_set_m4(float mat[4][4], const float pivot[3])
bool invert_m4(float mat[4][4])
void axis_angle_to_mat3_single(float R[3][3], char axis, float angle)
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
#define FILE_MAX
#define BLI_path_join(...)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
Definition rct.c:408
unsigned char uchar
unsigned int uint
#define BLI_MUTEX_INITIALIZER
Definition BLI_threads.h:84
int BLI_thread_is_main(void)
Definition threads.cc:179
void BLI_mutex_lock(ThreadMutex *mutex)
Definition threads.cc:345
void BLI_mutex_unlock(ThreadMutex *mutex)
Definition threads.cc:350
pthread_mutex_t ThreadMutex
Definition BLI_threads.h:83
#define UNLIKELY(x)
#define ELEM(...)
#define STREQ(a, b)
typedef double(DMatrix)[4][4]
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
#define ID_BLEND_PATH_FROM_GLOBAL(_id)
Definition DNA_ID.h:649
#define DNA_struct_default_get(struct_name)
@ MCLIP_PROXY_RENDER_SIZE_75
@ MCLIP_PROXY_RENDER_SIZE_100
@ MCLIP_PROXY_RENDER_SIZE_50
@ MCLIP_PROXY_RENDER_SIZE_FULL
@ MCLIP_PROXY_RENDER_SIZE_25
@ MCLIP_PROXY_RENDER_USE_FALLBACK_RENDER
@ MCLIP_PROXY_RENDER_UNDISTORT
eDrawType
@ OB_RENDER
@ R_MULTIVIEW
@ R_DOSEQ
@ R_DOCOMP
@ R_IMF_VIEWS_STEREO_3D
@ R_NO_CAMERA_SWITCH
@ R_SEQ_OVERRIDE_SCENE_SETTINGS
@ R_IMF_PLANES_RGB
@ R_IMF_PLANES_RGBA
@ R_IMF_PLANES_BW
@ SEQ_BLEND_REPLACE
@ SEQ_STORAGE_PROXY_CUSTOM_FILE
@ SEQ_MOVIECLIP_RENDER_UNDISTORTED
@ SEQ_MOVIECLIP_RENDER_STABILIZED
@ SEQ_CACHE_STORE_PREPROCESSED
@ SEQ_CACHE_STORE_RAW
@ SEQ_CACHE_STORE_FINAL_OUT
@ SEQ_CACHE_STORE_COMPOSITE
@ SEQ_TYPE_META
@ SEQ_TYPE_OVERDROP
@ SEQ_TYPE_ALPHAUNDER
@ SEQ_TYPE_SCENE
@ SEQ_TYPE_MOVIECLIP
@ SEQ_TYPE_ALPHAOVER
@ SEQ_TYPE_IMAGE
@ SEQ_TYPE_SPEED
@ SEQ_TYPE_EFFECT
@ SEQ_TYPE_MOVIE
@ SEQ_TYPE_MASK
@ seqModifierType_Mask
@ SEQ_ALPHA_PREMUL
@ SEQ_EDIT_SHOW_MISSING_MEDIA
@ SEQ_EDIT_PROXY_DIR_STORAGE
@ SEQ_FILTERY
@ SEQ_FLIPX
@ SEQ_MAKE_FLOAT
@ SEQ_SCENE_STRIPS
@ SEQ_USE_PROXY
@ SEQ_USE_EFFECT_DEFAULT_FADE
@ SEQ_FLIPY
@ SEQ_MULTIPLY_ALPHA
@ SEQ_USE_VIEWS
@ SEQ_SCENE_NO_ANNOTATION
@ SEQUENCE_MODIFIER_MUTE
@ SEQ_TRANSFORM_FILTER_CUBIC_BSPLINE
@ SEQ_TRANSFORM_FILTER_AUTO
@ SEQ_TRANSFORM_FILTER_CUBIC_MITCHELL
@ SEQ_TRANSFORM_FILTER_BILINEAR
@ SEQ_TRANSFORM_FILTER_BOX
@ SEQ_TRANSFORM_FILTER_NEAREST
@ SEQ_SPEED_USE_INTERPOLATION
@ SEQ_RENDER_SIZE_SCENE
eV3DOffscreenDrawFlag
@ V3D_OFSDRAW_NONE
@ V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS
@ V3D_OFSDRAW_SHOW_ANNOTATION
void IMB_colormanagement_assign_byte_colorspace(ImBuf *ibuf, const char *name)
void IMB_colormanagement_assign_float_colorspace(ImBuf *ibuf, const char *name)
void IMB_colormanagement_transform_from_byte_threaded(float *float_buffer, unsigned char *byte_buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace)
void IMB_colormanagement_transform_threaded(float *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace, bool predivide)
void IMB_colormanagement_transform_byte_threaded(unsigned char *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
@ COLOR_ROLE_SCENE_LINEAR
const char * IMB_colormanagement_get_rect_colorspace(ImBuf *ibuf)
void IMB_colormanagement_transform_v4(float pixel[4], const char *from_colorspace, const char *to_colorspace)
const char * IMB_colormanagement_get_float_colorspace(ImBuf *ibuf)
void IMB_flipy(ImBuf *ibuf)
void imb_freerectImBuf(ImBuf *ibuf)
size_t IMB_get_rect_len(const ImBuf *ibuf)
Get the length of the rect of the given image buffer in terms of pixels.
void IMB_flipx(ImBuf *ibuf)
ImBuf * IMB_dupImBuf(const ImBuf *ibuf1)
ImBuf * IMB_anim_absolute(ImBufAnim *anim, int position, IMB_Timecode_Type tc, IMB_Proxy_Size preview_size)
void IMB_processor_apply_threaded(int buffer_lines, int handle_size, void *init_customdata, void(init_handle)(void *handle, int start_line, int tot_line, void *customdata), void *(do_thread)(void *))
ImBuf * IMB_makeSingleUser(ImBuf *ibuf)
bool IMB_anim_get_fps(const ImBufAnim *anim, bool no_av_base, short *r_frs_sec, float *r_frs_sec_base)
void IMB_ImBufFromStereo3d(const Stereo3dFormat *s3d, ImBuf *ibuf_stereo3d, ImBuf **r_ibuf_left, ImBuf **r_ibuf_right)
@ IMB_TRANSFORM_MODE_CROP_SRC
Crop the source buffer.
Definition IMB_imbuf.hh:680
ImBuf * IMB_loadiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE])
Definition readimage.cc:146
void IMB_saturation(ImBuf *ibuf, float sat)
Definition divers.cc:865
void IMB_filtery(ImBuf *ibuf)
Definition filter.cc:65
void IMB_rectfill(ImBuf *drect, const float col[4])
Definition rectop.cc:1051
void IMB_transform(const ImBuf *src, ImBuf *dst, eIMBTransformMode mode, eIMBInterpolationFilterMode filter, const float transform_matrix[4][4], const rctf *src_crop)
Transform source image buffer onto destination image buffer using a transform matrix.
eIMBInterpolationFilterMode
Definition IMB_imbuf.hh:288
@ IMB_FILTER_NEAREST
Definition IMB_imbuf.hh:289
@ IMB_FILTER_CUBIC_BSPLINE
Definition IMB_imbuf.hh:291
@ IMB_FILTER_CUBIC_MITCHELL
Definition IMB_imbuf.hh:292
@ IMB_FILTER_BILINEAR
Definition IMB_imbuf.hh:290
@ IMB_FILTER_BOX
Definition IMB_imbuf.hh:293
bool imb_addrectfloatImBuf(ImBuf *ibuf, const unsigned int channels, bool initialize_pixels=true)
IMB_Proxy_Size
@ IMB_PROXY_100
@ IMB_PROXY_75
@ IMB_PROXY_50
@ IMB_PROXY_25
@ IMB_PROXY_NONE
IMB_Timecode_Type
@ IMB_TC_NONE
Contains defines and structs used throughout the imbuf module.
@ IB_alphamode_premul
@ IB_rectfloat
@ IB_uninitialized_pixels
@ IB_metadata
@ IB_rect
void IMB_metadata_copy(ImBuf *ibuf_dst, const ImBuf *ibuf_src)
Definition metadata.cc:60
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
StripEarlyOut
@ SEQ_TASK_MAIN_RENDER
Definition SEQ_render.hh:22
constexpr int SEQ_MAX_CHANNELS
static void mul(btAlignedObjectArray< T > &items, const Q &value)
SeqTimelineChannel * SEQ_channel_get_by_index(const ListBase *channels, const int channel_index)
Definition channels.cc:61
bool SEQ_channel_is_muted(const SeqTimelineChannel *channel)
Definition channels.cc:82
int64_t size() const
int64_t size() const
void append(const T &value)
const T & last(const int64_t n=0) const
bool is_empty() const
local_group_size(16, 16) .push_constant(Type b
const Depsgraph * depsgraph
#define floorf(x)
#define fabsf(x)
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
#define rot(x, k)
float seq_speed_effect_target_frame_get(Scene *scene, Sequence *seq_speed, float timeline_frame, int input)
Definition effects.cc:2159
SeqEffectHandle SEQ_effect_handle_get(Sequence *seq)
Definition effects.cc:3430
int SEQ_effect_get_num_inputs(int seq_type)
Definition effects.cc:3467
SeqEffectHandle seq_effect_get_sequence_blend(Sequence *seq)
Definition effects.cc:3445
blender::gpu::Batch * quad
uint col
struct ImBuf * IMB_allocImBuf(unsigned int, unsigned int, unsigned char, unsigned int)
void IMB_freeImBuf(ImBuf *)
IndexRange range
ImBuf * seq_cache_get(const SeqRenderData *context, Sequence *seq, float timeline_frame, int type)
bool seq_cache_put_if_possible(const SeqRenderData *context, Sequence *seq, float timeline_frame, int type, ImBuf *ibuf)
void seq_cache_put(const SeqRenderData *context, Sequence *seq, float timeline_frame, int type, ImBuf *i)
void seq_cache_free_temp_cache(Scene *scene, short id, int timeline_frame)
int count
VectorSet< Sequence * > SEQ_query_rendered_strips(const Scene *scene, ListBase *channels, ListBase *seqbase, const int timeline_frame, const int displayed_channel)
Definition iterator.cc:184
void *(* MEM_mallocN)(size_t len, const char *str)
Definition mallocn.cc:44
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
void *(* MEM_callocN)(size_t len, const char *str)
Definition mallocn.cc:42
static ulong state[N]
#define G(x, y, z)
int seq_num_files(Scene *scene, char views_format, const bool is_multiview)
Definition multiview.cc:27
void seq_multiview_name(Scene *scene, const int view_id, const char *prefix, const char *ext, char *r_path, size_t r_size)
Definition multiview.cc:40
void media_presence_set_missing(Scene *scene, const Sequence *seq, bool missing)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
Definition BLI_task.hh:95
static void init_data(ModifierData *md)
VecBase< float, 2 > float2
void seq_prefetch_start(const SeqRenderData *context, float timeline_frame)
Definition prefetch.cc:558
bool seq_proxy_get_custom_file_filepath(Sequence *seq, char *filepath, const int view_id)
Definition proxy.cc:95
ImBuf * seq_proxy_fetch(const SeqRenderData *context, Sequence *seq, int timeline_frame)
Definition proxy.cc:197
int SEQ_rendersize_to_proxysize(int render_size)
Definition proxy.cc:67
bool SEQ_can_use_proxy(const SeqRenderData *context, const Sequence *seq, int psize)
Definition proxy.cc:187
double SEQ_rendersize_to_scale_factor(int render_size)
Definition proxy.cc:82
#define PROXY_MAXFILE
Definition proxy.hh:16
static ImBuf * seq_render_preprocess_ibuf(const SeqRenderData *context, Sequence *seq, ImBuf *ibuf, float timeline_frame, bool use_preprocess, const bool is_proxy_image)
Definition render.cc:712
static void multiply_ibuf(ImBuf *ibuf, const float fmul, const bool multiply_alpha)
Definition render.cc:601
static bool is_opaque_alpha_over(const Sequence *seq)
Definition render.cc:1933
static ImBuf * seq_render_scene_strip(const SeqRenderData *context, Sequence *seq, float frame_index, float timeline_frame)
Definition render.cc:1430
static ImBuf * input_preprocess(const SeqRenderData *context, Sequence *seq, float timeline_frame, ImBuf *ibuf, const bool is_proxy_image)
Definition render.cc:636
ImBuf * SEQ_render_give_ibuf_direct(const SeqRenderData *context, float timeline_frame, Sequence *seq)
Definition render.cc:2144
static ImBuf * seq_render_image_strip(const SeqRenderData *context, Sequence *seq, int timeline_frame, bool *r_is_proxy_image)
Definition render.cc:1011
static ImBuf * seq_render_mask_strip(const SeqRenderData *context, Sequence *seq, float frame_index)
Definition render.cc:1423
static ImBuf * seq_render_strip_stack_apply_effect(const SeqRenderData *context, Sequence *seq, float timeline_frame, ImBuf *ibuf1, ImBuf *ibuf2)
Definition render.cc:1903
void seq_imbuf_to_sequencer_space(const Scene *scene, ImBuf *ibuf, bool make_float)
Definition render.cc:106
SequencerDrawView sequencer_view3d_fn
Definition render.cc:87
static ThreadMutex seq_render_mutex
Definition render.cc:86
StripScreenQuad get_strip_screen_quad(const SeqRenderData *context, const Sequence *seq)
Definition render.cc:296
static bool is_quad_a_inside_b(const StripScreenQuad &a, const StripScreenQuad &b)
Definition render.cc:310
void SEQ_render_new_render_data(Main *bmain, Depsgraph *depsgraph, Scene *scene, int rectx, int recty, int preview_render_size, int for_render, SeqRenderData *r_context)
Definition render.cc:220
static eIMBInterpolationFilterMode get_auto_filter(const StripTransform *transform)
Definition render.cc:526
void seq_imbuf_assign_spaces(const Scene *scene, ImBuf *ibuf)
Definition render.cc:93
static void sequencer_image_crop_init(const Sequence *seq, const ImBuf *in, float crop_scale_factor, rctf *r_crop)
Definition render.cc:486
static ImBuf * seq_render_movie_strip(const SeqRenderData *context, Sequence *seq, float timeline_frame, bool *r_is_proxy_image)
Definition render.cc:1182
static void sequencer_preprocess_transform_crop(ImBuf *in, ImBuf *out, const SeqRenderData *context, Sequence *seq, const bool is_proxy_image)
Definition render.cc:545
static ImBuf * seq_render_movie_strip_custom_file_proxy(const SeqRenderData *context, Sequence *seq, int timeline_frame)
Definition render.cc:1096
ImBuf * SEQ_render_give_ibuf(const SeqRenderData *context, float timeline_frame, int chanshown)
Definition render.cc:2078
static ImBuf * seq_get_movieclip_ibuf(Sequence *seq, MovieClipUser user)
Definition render.cc:1269
static ImBuf * seq_render_strip_stack(const SeqRenderData *context, SeqRenderState *state, ListBase *channels, ListBase *seqbasep, float timeline_frame, int chanshown)
Definition render.cc:1953
static StripEarlyOut seq_get_early_out_for_blend_mode(Sequence *seq)
Definition render.cc:1882
bool SEQ_render_is_muted(const ListBase *channels, const Sequence *seq)
Definition render.cc:2154
static bool seq_need_scale_to_render_size(const Sequence *seq, bool is_proxy_image)
Definition render.cc:446
ImBuf * seq_render_mask(const SeqRenderData *context, Mask *mask, float frame_index, bool make_float)
Definition render.cc:1337
static ImBuf * do_render_strip_seqbase(const SeqRenderData *context, SeqRenderState *state, Sequence *seq, float frame_index)
Definition render.cc:1699
static ImBuf * create_missing_media_image(const SeqRenderData *context, int width, int height)
Definition render.cc:994
static void * render_effect_execute_do_thread(void *thread_data_v)
Definition render.cc:782
static bool seq_must_swap_input_in_blend_mode(Sequence *seq)
Definition render.cc:1868
StripElem * SEQ_render_give_stripelem(const Scene *scene, const Sequence *seq, int timeline_frame)
Definition render.cc:248
static bool seq_input_have_to_preprocess(const SeqRenderData *context, Sequence *seq, float)
Definition render.cc:403
void SEQ_render_pixel_from_sequencer_space_v4(Scene *scene, float pixel[4])
Definition render.cc:199
static ImBuf * seq_render_movie_strip_view(const SeqRenderData *context, Sequence *seq, float timeline_frame, StripAnim *sanim, bool *r_is_proxy_image)
Definition render.cc:1130
static void sequencer_image_crop_transform_matrix(const Sequence *seq, const ImBuf *in, const ImBuf *out, const float image_scale_factor, const float preview_scale_factor, float r_transform_matrix[4][4])
Definition render.cc:460
static ImBuf * seq_render_image_strip_view(const SeqRenderData *context, Sequence *seq, char *filepath, char *prefix, const char *ext, int view_id)
Definition render.cc:935
static ImBuf * seq_render_effect_strip_impl(const SeqRenderData *context, SeqRenderState *state, Sequence *seq, float timeline_frame)
Definition render.cc:828
static IMB_Timecode_Type seq_render_movie_strip_timecode_get(Sequence *seq)
Definition render.cc:1117
static ImBuf * do_render_strip_uncached(const SeqRenderData *context, SeqRenderState *state, Sequence *seq, float timeline_frame, bool *r_is_proxy_image)
Definition render.cc:1735
static bool sequencer_use_crop(const Sequence *seq)
Definition render.cc:393
static bool seq_image_strip_is_multiview_render(Scene *scene, Sequence *seq, int totfiles, const char *filepath, char *r_prefix, const char *r_ext)
Definition render.cc:974
ImBuf * seq_render_give_ibuf_seqbase(const SeqRenderData *context, float timeline_frame, int chan_shown, ListBase *channels, ListBase *seqbasep)
Definition render.cc:2133
ImBuf * seq_render_strip(const SeqRenderData *context, SeqRenderState *state, Sequence *seq, float timeline_frame)
Definition render.cc:1830
static bool is_strip_covering_screen(const SeqRenderData *context, const Sequence *seq)
Definition render.cc:500
ImBuf * seq_render_effect_execute_threaded(SeqEffectHandle *sh, const SeqRenderData *context, Sequence *seq, float timeline_frame, float fac, ImBuf *ibuf1, ImBuf *ibuf2)
Definition render.cc:799
static bool sequencer_use_transform(const Sequence *seq)
Definition render.cc:380
static ImBuf * seq_render_movieclip_strip(const SeqRenderData *context, Sequence *seq, float frame_index, bool *r_is_proxy_image)
Definition render.cc:1282
void SEQ_render_imbuf_from_sequencer_space(Scene *scene, ImBuf *ibuf)
Definition render.cc:177
static void render_effect_execute_init_handle(void *handle_v, int start_line, int tot_line, void *init_data_v)
Definition render.cc:761
Vector< Sequence * > seq_get_shown_sequences(const Scene *scene, ListBase *channels, ListBase *seqbase, const int timeline_frame, const int chanshown)
Definition render.cc:268
void SEQ_modifier_apply_stack(const SeqRenderData *context, const Sequence *seq, ImBuf *ibuf, int timeline_frame)
void seq_open_anim_file(Scene *scene, Sequence *seq, bool openfile)
ListBase * SEQ_get_seqbase_from_sequence(Sequence *seq, ListBase **r_channels, int *r_offset)
Editing * SEQ_editing_get(const Scene *scene)
Definition sequencer.cc:262
void RE_ReleaseResultImage(Render *re)
void RE_AcquireResultImage(Render *re, RenderResult *rr, const int view_id)
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)
Render * RE_NewSceneRender(const Scene *scene)
Render * RE_GetSceneRender(const Scene *scene)
__int64 int64_t
Definition stdint.h:89
void SEQ_relations_free_all_anim_ibufs(Scene *scene, int timeline_frame)
float SEQ_give_frame_index(const Scene *scene, const Sequence *seq, float timeline_frame)
Definition strip_time.cc:60
void SEQ_image_transform_final_quad_get(const Scene *scene, const Sequence *seq, float r_quad[4][2])
ListBase * seqbasep
ListBase * displayed_channels
ListBase metastack
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
unsigned char planes
void * link
struct LinkNode * next
void * first
bool is_occluded(const SeqRenderData *context, const Sequence *seq, int order_index) const
Definition render.cc:334
void add_occluder(const SeqRenderData *context, const Sequence *seq, int order_index)
Definition render.cc:349
Vector< OpaqueQuad, 4 > opaques
Definition render.cc:327
StripScreenQuad quad
Definition render.cc:322
int order_index
Definition render.cc:323
const SeqRenderData * context
Definition render.cc:742
SeqEffectHandle * sh
Definition render.cc:741
const SeqRenderData * context
Definition render.cc:752
Sequence * seq
Definition render.cc:753
SeqEffectHandle * sh
Definition render.cc:751
struct ImBuf * ibuf
void(* get_default_fac)(const Scene *scene, const Sequence *seq, float timeline_frame, float *fac)
ImBuf *(* init_execution)(const SeqRenderData *context, ImBuf *ibuf1, ImBuf *ibuf2)
ImBuf *(* execute)(const SeqRenderData *context, Sequence *seq, float timeline_frame, float fac, ImBuf *ibuf1, ImBuf *ibuf2)
StripEarlyOut(* early_out)(const Sequence *seq, float fac)
void(* execute_slice)(const SeqRenderData *context, Sequence *seq, float timeline_frame, float fac, const ImBuf *ibuf1, const ImBuf *ibuf2, int start_line, int total_lines, ImBuf *out)
int preview_render_size
Definition SEQ_render.hh:32
GPUOffScreen * gpu_offscreen
Definition SEQ_render.hh:48
GPUViewport * gpu_viewport
Definition SEQ_render.hh:49
Depsgraph * depsgraph
Definition SEQ_render.hh:28
bool is_proxy_render
Definition SEQ_render.hh:39
float motion_blur_shutter
Definition SEQ_render.hh:37
int motion_blur_samples
Definition SEQ_render.hh:36
Scene * scene
Definition SEQ_render.hh:29
bool ignore_missing_media
Definition SEQ_render.hh:34
bool is_prefetch_render
Definition SEQ_render.hh:40
eSeqTaskId task_id
Definition SEQ_render.hh:45
struct MovieClip * clip
struct Scene * scene
struct Object * scene_camera
struct Mask * mask
ListBase modifiers
struct Sequence * seq1
struct Sequence * seq2
struct Stereo3dFormat * stereo3d_format
struct StripAnim * next
struct ImBufAnim * anim
char filename[256]
struct ImBufAnim * anim
ColorManagedColorspaceSettings colorspace_settings
char dirpath[768]
StripProxy * proxy
StripTransform * transform
StripElem * stripdata
StripCrop * crop
PointerRNA * ptr
Definition wm_files.cc:4126
uint8_t flag
Definition wm_window.cc:138