2023-08-15 16:20:26 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2004 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2020-12-19 06:44:57 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
* \ingroup sequencer
|
|
|
|
*/
|
|
|
|
|
2021-09-21 10:38:15 +02:00
|
|
|
#define SEQ_RENDER_THUMB_SIZE 256
|
|
|
|
|
2023-11-03 09:05:31 +01:00
|
|
|
struct Depsgraph;
|
|
|
|
struct GPUOffScreen;
|
2023-12-19 16:12:30 +01:00
|
|
|
struct GPUViewport;
|
2023-11-03 09:05:31 +01:00
|
|
|
struct ImBuf;
|
2021-01-04 02:03:34 +01:00
|
|
|
struct ListBase;
|
|
|
|
struct Main;
|
|
|
|
struct Scene;
|
2020-12-19 06:44:57 +01:00
|
|
|
struct Sequence;
|
2023-11-03 09:05:31 +01:00
|
|
|
struct StripElem;
|
2022-04-25 01:21:21 +02:00
|
|
|
struct rctf;
|
2020-12-19 06:44:57 +01:00
|
|
|
|
2023-11-03 09:05:31 +01:00
|
|
|
enum eSeqTaskId {
|
2020-12-19 06:44:57 +01:00
|
|
|
SEQ_TASK_MAIN_RENDER,
|
|
|
|
SEQ_TASK_PREFETCH_RENDER,
|
2023-11-03 09:05:31 +01:00
|
|
|
};
|
2020-12-19 06:44:57 +01:00
|
|
|
|
2023-11-03 09:05:31 +01:00
|
|
|
struct SeqRenderData {
|
|
|
|
Main *bmain;
|
|
|
|
Depsgraph *depsgraph;
|
|
|
|
Scene *scene;
|
2020-12-19 06:44:57 +01:00
|
|
|
int rectx;
|
|
|
|
int recty;
|
|
|
|
int preview_render_size;
|
2021-03-16 17:59:30 +01:00
|
|
|
bool use_proxies;
|
2020-12-19 06:44:57 +01:00
|
|
|
int for_render;
|
|
|
|
int motion_blur_samples;
|
|
|
|
float motion_blur_shutter;
|
|
|
|
bool skip_cache;
|
|
|
|
bool is_proxy_render;
|
|
|
|
bool is_prefetch_render;
|
|
|
|
int view_id;
|
2021-02-06 04:07:03 +01:00
|
|
|
/* ID of task for assigning temp cache entries to particular task(thread, etc.) */
|
2020-12-19 06:44:57 +01:00
|
|
|
eSeqTaskId task_id;
|
|
|
|
|
|
|
|
/* special case for OpenGL render */
|
2023-11-03 09:05:31 +01:00
|
|
|
GPUOffScreen *gpu_offscreen;
|
2023-12-19 16:12:30 +01:00
|
|
|
GPUViewport *gpu_viewport;
|
2020-12-19 06:44:57 +01:00
|
|
|
// int gpu_samples;
|
|
|
|
// bool gpu_full_samples;
|
2023-11-03 09:05:31 +01:00
|
|
|
};
|
2020-12-19 06:44:57 +01:00
|
|
|
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* \return The image buffer or NULL.
|
|
|
|
*
|
|
|
|
* \note The returned #ImBuf has its reference increased, free after usage!
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
ImBuf *SEQ_render_give_ibuf(const SeqRenderData *context, float timeline_frame, int chanshown);
|
|
|
|
ImBuf *SEQ_render_give_ibuf_direct(const SeqRenderData *context,
|
2020-12-19 06:44:57 +01:00
|
|
|
float timeline_frame,
|
2023-11-03 09:05:31 +01:00
|
|
|
Sequence *seq);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Render the series of thumbnails and store in cache.
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
void SEQ_render_thumbnails(const SeqRenderData *context,
|
|
|
|
Sequence *seq,
|
|
|
|
Sequence *seq_orig,
|
2021-09-21 10:38:15 +02:00
|
|
|
float frame_step,
|
2023-11-03 09:05:31 +01:00
|
|
|
const rctf *view_area,
|
2022-11-04 08:37:25 +01:00
|
|
|
const bool *stop);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Get cached thumbnails.
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
ImBuf *SEQ_get_thumbnail(
|
|
|
|
const SeqRenderData *context, Sequence *seq, float timeline_frame, rcti *crop, bool clipped);
|
2022-04-25 01:21:21 +02:00
|
|
|
/**
|
|
|
|
* Get frame for first thumbnail.
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
float SEQ_render_thumbnail_first_frame_get(const Scene *scene,
|
|
|
|
Sequence *seq,
|
2022-04-25 01:21:21 +02:00
|
|
|
float frame_step,
|
2023-11-03 09:05:31 +01:00
|
|
|
const rctf *view_area);
|
2022-04-25 01:21:21 +02:00
|
|
|
/**
|
|
|
|
* Get frame for first thumbnail.
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
float SEQ_render_thumbnail_next_frame_get(const Scene *scene,
|
|
|
|
Sequence *seq,
|
2022-04-25 01:21:21 +02:00
|
|
|
float last_frame,
|
|
|
|
float frame_step);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Get frame step for equally spaced thumbnails. These thumbnails should always be present in
|
|
|
|
* memory, so they can be used when zooming.
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
int SEQ_render_thumbnails_guaranteed_set_frame_step_get(const Scene *scene, const Sequence *seq);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Render set of evenly spaced thumbnails that are drawn when zooming..
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
void SEQ_render_thumbnails_base_set(const SeqRenderData *context,
|
|
|
|
Sequence *seq,
|
|
|
|
Sequence *seq_orig,
|
|
|
|
const rctf *view_area,
|
2022-11-04 08:37:25 +01:00
|
|
|
const bool *stop);
|
2021-09-21 10:38:15 +02:00
|
|
|
|
2023-11-03 09:05:31 +01:00
|
|
|
void SEQ_render_init_colorspace(Sequence *seq);
|
|
|
|
void SEQ_render_new_render_data(Main *bmain,
|
|
|
|
Depsgraph *depsgraph,
|
|
|
|
Scene *scene,
|
2020-12-19 06:44:57 +01:00
|
|
|
int rectx,
|
|
|
|
int recty,
|
|
|
|
int preview_render_size,
|
|
|
|
int for_render,
|
|
|
|
SeqRenderData *r_context);
|
2023-11-03 09:05:31 +01:00
|
|
|
int SEQ_render_evaluate_frame(ListBase *seqbase, int timeline_frame);
|
|
|
|
StripElem *SEQ_render_give_stripelem(const Scene *scene, Sequence *seq, int timeline_frame);
|
2020-12-19 06:44:57 +01:00
|
|
|
|
2023-11-03 09:05:31 +01:00
|
|
|
void SEQ_render_imbuf_from_sequencer_space(Scene *scene, ImBuf *ibuf);
|
|
|
|
void SEQ_render_pixel_from_sequencer_space_v4(Scene *scene, float pixel[4]);
|
2022-04-04 12:52:48 +02:00
|
|
|
/**
|
|
|
|
* Check if `seq` is muted for rendering.
|
|
|
|
* This function also checks `SeqTimelineChannel` flag.
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
bool SEQ_render_is_muted(const ListBase *channels, const Sequence *seq);
|