Blender  V3.3
Classes | Variables
render.c File Reference
#include <time.h>
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_defaults.h"
#include "DNA_mask_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#include "DNA_space_types.h"
#include "BLI_linklist.h"
#include "BLI_listbase.h"
#include "BLI_path_util.h"
#include "BLI_rect.h"
#include "BKE_anim_data.h"
#include "BKE_animsys.h"
#include "BKE_fcurve.h"
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_mask.h"
#include "BKE_movieclip.h"
#include "BKE_scene.h"
#include "BKE_sequencer_offscreen.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "IMB_colormanagement.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_metadata.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "RE_engine.h"
#include "RE_pipeline.h"
#include "SEQ_channels.h"
#include "SEQ_effects.h"
#include "SEQ_iterator.h"
#include "SEQ_modifier.h"
#include "SEQ_proxy.h"
#include "SEQ_relations.h"
#include "SEQ_render.h"
#include "SEQ_sequencer.h"
#include "SEQ_time.h"
#include "SEQ_transform.h"
#include "SEQ_utils.h"
#include "effects.h"
#include "image_cache.h"
#include "multiview.h"
#include "prefetch.h"
#include "proxy.h"
#include "render.h"
#include "strip_time.h"
#include "utils.h"

Go to the source code of this file.

Classes

struct  RenderEffectInitData
 
struct  RenderEffectThread
 

Functions

Strip Stack Rendering Functions
static ImBufseq_render_strip_stack (const SeqRenderData *context, SeqRenderState *state, ListBase *channels, ListBase *seqbasep, float timeline_frame, int chanshown)
 
static ImBufdo_render_strip_uncached (const SeqRenderData *context, SeqRenderState *state, Sequence *seq, float timeline_frame, bool *r_is_proxy_image)
 
ImBufseq_render_strip (const SeqRenderData *context, SeqRenderState *state, Sequence *seq, float timeline_frame)
 
static bool seq_must_swap_input_in_blend_mode (Sequence *seq)
 
static int seq_get_early_out_for_blend_mode (Sequence *seq)
 
static ImBufseq_render_strip_stack_apply_effect (const SeqRenderData *context, Sequence *seq, float timeline_frame, ImBuf *ibuf1, ImBuf *ibuf2)
 
ImBufSEQ_render_give_ibuf (const SeqRenderData *context, float timeline_frame, int chanshown)
 
ImBufseq_render_give_ibuf_seqbase (const SeqRenderData *context, float timeline_frame, int chan_shown, ListBase *channels, ListBase *seqbasep)
 
ImBufSEQ_render_give_ibuf_direct (const SeqRenderData *context, float timeline_frame, Sequence *seq)
 
float SEQ_render_thumbnail_first_frame_get (const Scene *scene, Sequence *seq, float frame_step, rctf *view_area)
 
float SEQ_render_thumbnail_next_frame_get (const Scene *scene, Sequence *seq, float last_frame, float frame_step)
 
static ImBufseq_get_uncached_thumbnail (const SeqRenderData *context, SeqRenderState *state, Sequence *seq, float timeline_frame)
 
ImBufSEQ_get_thumbnail (const SeqRenderData *context, Sequence *seq, float timeline_frame, rcti *crop, bool clipped)
 
void SEQ_render_thumbnails (const SeqRenderData *context, Sequence *seq, Sequence *seq_orig, float frame_step, rctf *view_area, const short *stop)
 
int SEQ_render_thumbnails_guaranteed_set_frame_step_get (const Scene *scene, const Sequence *seq)
 
void SEQ_render_thumbnails_base_set (const SeqRenderData *context, Sequence *seq, Sequence *seq_orig, rctf *view_area, const short *stop)
 
bool SEQ_render_is_muted (const ListBase *channels, const Sequence *seq)
 
Color-space utility functions
void seq_imbuf_assign_spaces (Scene *scene, ImBuf *ibuf)
 
void seq_imbuf_to_sequencer_space (Scene *scene, ImBuf *ibuf, bool make_float)
 
void SEQ_render_imbuf_from_sequencer_space (Scene *scene, ImBuf *ibuf)
 
void SEQ_render_pixel_from_sequencer_space_v4 (struct Scene *scene, float pixel[4])
 
Rendering utility functions
void SEQ_render_new_render_data (Main *bmain, struct Depsgraph *depsgraph, Scene *scene, int rectx, int recty, int preview_render_size, int for_render, SeqRenderData *r_context)
 
void seq_render_state_init (SeqRenderState *state)
 
StripElemSEQ_render_give_stripelem (const Scene *scene, Sequence *seq, int timeline_frame)
 
static int seq_channel_cmp_fn (const void *a, const void *b)
 
int seq_get_shown_sequences (const Scene *scene, ListBase *channels, ListBase *seqbase, const int timeline_frame, const int chanshown, Sequence **r_seq_arr)
 
Individual strip rendering functions
static ImBufseq_render_image_strip_view (const SeqRenderData *context, Sequence *seq, char *name, char *prefix, const char *ext, int view_id)
 
static bool seq_image_strip_is_multiview_render (Scene *scene, Sequence *seq, int totfiles, char *name, char *r_prefix, const char *r_ext)
 
static ImBufseq_render_image_strip (const SeqRenderData *context, Sequence *seq, float UNUSED(frame_index), float timeline_frame, bool *r_is_proxy_image)
 
static ImBufseq_render_movie_strip_custom_file_proxy (const SeqRenderData *context, Sequence *seq, int timeline_frame)
 
static ImBufseq_render_movie_strip_view (const SeqRenderData *context, Sequence *seq, float frame_index, float timeline_frame, StripAnim *sanim, bool *r_is_proxy_image)
 
static ImBufseq_render_movie_strip (const SeqRenderData *context, Sequence *seq, float frame_index, float timeline_frame, bool *r_is_proxy_image)
 
static ImBufseq_get_movieclip_ibuf (Sequence *seq, MovieClipUser user)
 
static ImBufseq_render_movieclip_strip (const SeqRenderData *context, Sequence *seq, float frame_index, bool *r_is_proxy_image)
 
ImBufseq_render_mask (const SeqRenderData *context, Mask *mask, float frame_index, bool make_float)
 
static ImBufseq_render_mask_strip (const SeqRenderData *context, Sequence *seq, float frame_index)
 
static ImBufseq_render_scene_strip (const SeqRenderData *context, Sequence *seq, float frame_index, float timeline_frame)
 
static ImBufdo_render_strip_seqbase (const SeqRenderData *context, SeqRenderState *state, Sequence *seq, float frame_index)
 

Variables

static ThreadMutex seq_render_mutex = BLI_MUTEX_INITIALIZER
 
SequencerDrawView sequencer_view3d_fn = NULL
 

Preprocessing & Effects

Input preprocessing for SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_MOVIECLIP and SEQ_TYPE_SCENE.

Do all the things you can't really do afterwards using sequence effects (read: before re-scaling to render resolution has been done).

Order is important!

  • De-interlace.
  • Crop and transform in image source coordinate space.
  • Flip X + Flip Y (could be done afterwards, backward compatibility).
  • Promote image to float data (affects pipeline operations afterwards).
  • Color balance (is most efficient in the byte -> float (future: half -> float should also work fine!) case, if done on load, since we can use lookup tables).
  • Pre-multiply.
typedef struct RenderEffectInitData RenderEffectInitData
 
typedef struct RenderEffectThread RenderEffectThread
 
static bool sequencer_use_transform (const Sequence *seq)
 
static bool sequencer_use_crop (const Sequence *seq)
 
static bool seq_input_have_to_preprocess (const SeqRenderData *context, Sequence *seq, float UNUSED(timeline_frame))
 
static bool seq_need_scale_to_render_size (const Sequence *seq, bool is_proxy_image)
 
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])
 
static void sequencer_image_crop_init (const Sequence *seq, const ImBuf *in, float crop_scale_factor, rctf *r_crop)
 
static void sequencer_thumbnail_transform (ImBuf *in, ImBuf *out)
 
static bool seq_image_transform_transparency_gained (const SeqRenderData *context, Sequence *seq)
 
static void sequencer_preprocess_transform_crop (ImBuf *in, ImBuf *out, const SeqRenderData *context, Sequence *seq, const bool is_proxy_image)
 
static void multibuf (ImBuf *ibuf, const float fmul)
 
static ImBufinput_preprocess (const SeqRenderData *context, Sequence *seq, float timeline_frame, ImBuf *ibuf, const bool is_proxy_image)
 
static ImBufseq_render_preprocess_ibuf (const SeqRenderData *context, Sequence *seq, ImBuf *ibuf, float timeline_frame, bool use_preprocess, const bool is_proxy_image)
 
static void render_effect_execute_init_handle (void *handle_v, int start_line, int tot_line, void *init_data_v)
 
static voidrender_effect_execute_do_thread (void *thread_data_v)
 
ImBufseq_render_effect_execute_threaded (struct SeqEffectHandle *sh, const SeqRenderData *context, Sequence *seq, float timeline_frame, float fac, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *ibuf3)
 
static ImBufseq_render_effect_strip_impl (const SeqRenderData *context, SeqRenderState *state, Sequence *seq, float timeline_frame)
 

Typedef Documentation

◆ RenderEffectInitData

◆ RenderEffectThread

Function Documentation

◆ do_render_strip_seqbase()

static ImBuf* do_render_strip_seqbase ( const SeqRenderData context,
SeqRenderState state,
Sequence seq,
float  frame_index 
)
static

◆ do_render_strip_uncached()

static ImBuf* do_render_strip_uncached ( const SeqRenderData context,
SeqRenderState state,
Sequence seq,
float  timeline_frame,
bool r_is_proxy_image 
)
static

◆ input_preprocess()

static ImBuf* input_preprocess ( const SeqRenderData context,
Sequence seq,
float  timeline_frame,
ImBuf ibuf,
const bool  is_proxy_image 
)
static

◆ multibuf()

static void multibuf ( ImBuf ibuf,
const float  fmul 
)
static

◆ render_effect_execute_do_thread()

static void* render_effect_execute_do_thread ( void thread_data_v)
static

◆ render_effect_execute_init_handle()

static void render_effect_execute_init_handle ( void handle_v,
int  start_line,
int  tot_line,
void init_data_v 
)
static

◆ seq_channel_cmp_fn()

static int seq_channel_cmp_fn ( const void a,
const void b 
)
static

Definition at line 256 of file render.c.

References Freestyle::a, and usdtokens::b().

Referenced by seq_get_shown_sequences().

◆ seq_get_early_out_for_blend_mode()

static int seq_get_early_out_for_blend_mode ( Sequence seq)
static

◆ seq_get_movieclip_ibuf()

static ImBuf* seq_get_movieclip_ibuf ( Sequence seq,
MovieClipUser  user 
)
static

◆ seq_get_shown_sequences()

int seq_get_shown_sequences ( const Scene scene,
ListBase channels,
ListBase seqbase,
const int  timeline_frame,
const int  chanshown,
Sequence **  r_seq_arr 
)

◆ SEQ_get_thumbnail()

ImBuf* SEQ_get_thumbnail ( const SeqRenderData context,
Sequence seq,
float  timeline_frame,
rcti crop,
bool  clipped 
)

◆ seq_get_uncached_thumbnail()

static ImBuf* seq_get_uncached_thumbnail ( const SeqRenderData context,
SeqRenderState state,
Sequence seq,
float  timeline_frame 
)
static

◆ seq_image_strip_is_multiview_render()

static bool seq_image_strip_is_multiview_render ( Scene scene,
Sequence seq,
int  totfiles,
char *  name,
char *  r_prefix,
const char *  r_ext 
)
static

◆ seq_image_transform_transparency_gained()

static bool seq_image_transform_transparency_gained ( const SeqRenderData context,
Sequence seq 
)
static

◆ seq_imbuf_assign_spaces()

void seq_imbuf_assign_spaces ( Scene scene,
ImBuf ibuf 
)

◆ seq_imbuf_to_sequencer_space()

void seq_imbuf_to_sequencer_space ( Scene scene,
ImBuf ibuf,
bool  make_float 
)

◆ seq_input_have_to_preprocess()

static bool seq_input_have_to_preprocess ( const SeqRenderData context,
Sequence seq,
float   UNUSEDtimeline_frame 
)
static

◆ seq_must_swap_input_in_blend_mode()

static bool seq_must_swap_input_in_blend_mode ( Sequence seq)
static

◆ seq_need_scale_to_render_size()

static bool seq_need_scale_to_render_size ( const Sequence seq,
bool  is_proxy_image 
)
static

Effect, mask and scene in strip input strips are rendered in preview resolution. They are already down-scaled. input_preprocess() does not expect this to happen. Other strip types are rendered with original media resolution, unless proxies are enabled for them. With proxies is_proxy_image will be set correctly to true.

Definition at line 379 of file render.c.

References Sequence::flag, SEQ_SCENE_STRIPS, SEQ_TYPE_EFFECT, SEQ_TYPE_MASK, SEQ_TYPE_META, SEQ_TYPE_SCENE, and Sequence::type.

Referenced by sequencer_preprocess_transform_crop().

◆ seq_render_effect_execute_threaded()

ImBuf* seq_render_effect_execute_threaded ( struct SeqEffectHandle sh,
const SeqRenderData context,
Sequence seq,
float  timeline_frame,
float  fac,
ImBuf ibuf1,
ImBuf ibuf2,
ImBuf ibuf3 
)

◆ seq_render_effect_strip_impl()

static ImBuf* seq_render_effect_strip_impl ( const SeqRenderData context,
SeqRenderState state,
Sequence seq,
float  timeline_frame 
)
static

◆ SEQ_render_give_ibuf()

ImBuf* SEQ_render_give_ibuf ( const SeqRenderData context,
float  timeline_frame,
int  chanshown 
)

◆ SEQ_render_give_ibuf_direct()

ImBuf* SEQ_render_give_ibuf_direct ( const SeqRenderData context,
float  timeline_frame,
Sequence seq 
)

◆ seq_render_give_ibuf_seqbase()

ImBuf* seq_render_give_ibuf_seqbase ( const SeqRenderData context,
float  timeline_frame,
int  chan_shown,
ListBase channels,
ListBase seqbasep 
)

◆ SEQ_render_give_stripelem()

StripElem* SEQ_render_give_stripelem ( const Scene scene,
Sequence seq,
int  timeline_frame 
)

◆ seq_render_image_strip()

static ImBuf* seq_render_image_strip ( const SeqRenderData context,
Sequence seq,
float   UNUSEDframe_index,
float  timeline_frame,
bool r_is_proxy_image 
)
static

◆ seq_render_image_strip_view()

static ImBuf* seq_render_image_strip_view ( const SeqRenderData context,
Sequence seq,
char *  name,
char *  prefix,
const char *  ext,
int  view_id 
)
static

◆ SEQ_render_imbuf_from_sequencer_space()

void SEQ_render_imbuf_from_sequencer_space ( Scene scene,
ImBuf ibuf 
)

◆ SEQ_render_is_muted()

bool SEQ_render_is_muted ( const ListBase channels,
const Sequence seq 
)

◆ seq_render_mask()

ImBuf* seq_render_mask ( const SeqRenderData context,
Mask mask,
float  frame_index,
bool  make_float 
)

◆ seq_render_mask_strip()

static ImBuf* seq_render_mask_strip ( const SeqRenderData context,
Sequence seq,
float  frame_index 
)
static

◆ seq_render_movie_strip()

static ImBuf* seq_render_movie_strip ( const SeqRenderData context,
Sequence seq,
float  frame_index,
float  timeline_frame,
bool r_is_proxy_image 
)
static

◆ seq_render_movie_strip_custom_file_proxy()

static ImBuf* seq_render_movie_strip_custom_file_proxy ( const SeqRenderData context,
Sequence seq,
int  timeline_frame 
)
static

◆ seq_render_movie_strip_view()

static ImBuf* seq_render_movie_strip_view ( const SeqRenderData context,
Sequence seq,
float  frame_index,
float  timeline_frame,
StripAnim sanim,
bool r_is_proxy_image 
)
static

◆ seq_render_movieclip_strip()

static ImBuf* seq_render_movieclip_strip ( const SeqRenderData context,
Sequence seq,
float  frame_index,
bool r_is_proxy_image 
)
static

◆ SEQ_render_new_render_data()

void SEQ_render_new_render_data ( Main bmain,
struct Depsgraph depsgraph,
Scene scene,
int  rectx,
int  recty,
int  preview_render_size,
int  for_render,
SeqRenderData r_context 
)

◆ SEQ_render_pixel_from_sequencer_space_v4()

void SEQ_render_pixel_from_sequencer_space_v4 ( struct Scene scene,
float  pixel[4] 
)

◆ seq_render_preprocess_ibuf()

static ImBuf* seq_render_preprocess_ibuf ( const SeqRenderData context,
Sequence seq,
ImBuf ibuf,
float  timeline_frame,
bool  use_preprocess,
const bool  is_proxy_image 
)
static

◆ seq_render_scene_strip()

static ImBuf* seq_render_scene_strip ( const SeqRenderData context,
Sequence seq,
float  frame_index,
float  timeline_frame 
)
static

◆ seq_render_state_init()

void seq_render_state_init ( SeqRenderState state)

◆ seq_render_strip()

ImBuf* seq_render_strip ( const SeqRenderData context,
SeqRenderState state,
Sequence seq,
float  timeline_frame 
)

◆ seq_render_strip_stack()

static ImBuf * seq_render_strip_stack ( const SeqRenderData context,
SeqRenderState state,
ListBase channels,
ListBase seqbasep,
float  timeline_frame,
int  chanshown 
)
static

◆ seq_render_strip_stack_apply_effect()

static ImBuf* seq_render_strip_stack_apply_effect ( const SeqRenderData context,
Sequence seq,
float  timeline_frame,
ImBuf ibuf1,
ImBuf ibuf2 
)
static

◆ SEQ_render_thumbnail_first_frame_get()

float SEQ_render_thumbnail_first_frame_get ( const Scene scene,
Sequence seq,
float  frame_step,
rctf view_area 
)

◆ SEQ_render_thumbnail_next_frame_get()

float SEQ_render_thumbnail_next_frame_get ( const Scene scene,
Sequence seq,
float  last_frame,
float  frame_step 
)

◆ SEQ_render_thumbnails()

void SEQ_render_thumbnails ( const SeqRenderData context,
Sequence seq,
Sequence seq_orig,
float  frame_step,
rctf view_area,
const short *  stop 
)

◆ SEQ_render_thumbnails_base_set()

void SEQ_render_thumbnails_base_set ( const SeqRenderData context,
Sequence seq,
Sequence seq_orig,
rctf view_area,
const short *  stop 
)

◆ SEQ_render_thumbnails_guaranteed_set_frame_step_get()

int SEQ_render_thumbnails_guaranteed_set_frame_step_get ( const Scene scene,
const Sequence seq 
)

◆ sequencer_image_crop_init()

static void sequencer_image_crop_init ( const Sequence seq,
const ImBuf in,
float  crop_scale_factor,
rctf r_crop 
)
static

◆ sequencer_image_crop_transform_matrix()

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] 
)
static

◆ sequencer_preprocess_transform_crop()

static void sequencer_preprocess_transform_crop ( ImBuf in,
ImBuf out,
const SeqRenderData context,
Sequence seq,
const bool  is_proxy_image 
)
static

◆ sequencer_thumbnail_transform()

static void sequencer_thumbnail_transform ( ImBuf in,
ImBuf out 
)
static

◆ sequencer_use_crop()

static bool sequencer_use_crop ( const Sequence seq)
static

◆ sequencer_use_transform()

static bool sequencer_use_transform ( const Sequence seq)
static

Definition at line 315 of file render.c.

References Sequence::strip, transform(), and Strip::transform.

Referenced by input_preprocess(), and seq_input_have_to_preprocess().

Variable Documentation

◆ seq_render_mutex

ThreadMutex seq_render_mutex = BLI_MUTEX_INITIALIZER
static

Definition at line 81 of file render.c.

Referenced by SEQ_render_give_ibuf().

◆ sequencer_view3d_fn

SequencerDrawView sequencer_view3d_fn = NULL

Definition at line 82 of file render.c.

Referenced by ED_spacetype_sequencer(), and seq_render_scene_strip().