Blender V4.3
BKE_movieclip.h File Reference

Go to the source code of this file.

Macros

#define MOVIECLIP_CACHE_SKIP   (1 << 0)
 
#define MOVIECLIP_DISABLE_RED   (1 << 0)
 
#define MOVIECLIP_DISABLE_GREEN   (1 << 1)
 
#define MOVIECLIP_DISABLE_BLUE   (1 << 2)
 
#define MOVIECLIP_PREVIEW_GRAYSCALE   (1 << 3)
 

Functions

struct MovieClipBKE_movieclip_file_add (struct Main *bmain, const char *filepath)
 
struct MovieClipBKE_movieclip_file_add_exists_ex (struct Main *bmain, const char *filepath, bool *r_exists)
 
struct MovieClipBKE_movieclip_file_add_exists (struct Main *bmain, const char *filepath)
 
void BKE_movieclip_reload (struct Main *bmain, struct MovieClip *clip)
 
void BKE_movieclip_clear_cache (struct MovieClip *clip)
 
void BKE_movieclip_clear_proxy_cache (struct MovieClip *clip)
 
void BKE_movieclip_convert_multilayer_ibuf (struct ImBuf *ibuf)
 
struct ImBufBKE_movieclip_get_ibuf (struct MovieClip *clip, const struct MovieClipUser *user)
 
struct ImBufBKE_movieclip_get_postprocessed_ibuf (struct MovieClip *clip, const struct MovieClipUser *user, int postprocess_flag)
 
struct ImBufBKE_movieclip_get_stable_ibuf (struct MovieClip *clip, const struct MovieClipUser *user, int postprocess_flag, float r_loc[2], float *r_scale, float *r_angle)
 
struct ImBufBKE_movieclip_get_ibuf_flag (struct MovieClip *clip, const struct MovieClipUser *user, int flag, int cache_flag)
 
void BKE_movieclip_get_size (struct MovieClip *clip, const struct MovieClipUser *user, int *r_width, int *r_height)
 
void BKE_movieclip_get_size_fl (struct MovieClip *clip, const struct MovieClipUser *user, float r_size[2])
 
int BKE_movieclip_get_duration (struct MovieClip *clip)
 
float BKE_movieclip_get_fps (struct MovieClip *clip)
 
void BKE_movieclip_get_aspect (struct MovieClip *clip, float *aspx, float *aspy)
 
bool BKE_movieclip_has_frame (struct MovieClip *clip, const struct MovieClipUser *user)
 
void BKE_movieclip_user_set_frame (struct MovieClipUser *user, int framenr)
 
void BKE_movieclip_update_scopes (struct MovieClip *clip, const struct MovieClipUser *user, struct MovieClipScopes *scopes)
 
void BKE_movieclip_get_cache_segments (struct MovieClip *clip, const struct MovieClipUser *user, int *r_totseg, int **r_points)
 
void BKE_movieclip_build_proxy_frame (struct MovieClip *clip, int clip_flag, struct MovieDistortion *distortion, int cfra, const int *build_sizes, int build_count, bool undistorted)
 
void BKE_movieclip_build_proxy_frame_for_ibuf (struct MovieClip *clip, struct ImBuf *ibuf, struct MovieDistortion *distortion, int cfra, const int *build_sizes, int build_count, bool undistorted)
 
bool BKE_movieclip_proxy_enabled (struct MovieClip *clip)
 
float BKE_movieclip_remap_scene_to_clip_frame (const struct MovieClip *clip, float framenr)
 
float BKE_movieclip_remap_clip_to_scene_frame (const struct MovieClip *clip, float framenr)
 
void BKE_movieclip_filepath_for_frame (struct MovieClip *clip, const struct MovieClipUser *user, char *filepath)
 
struct ImBufBKE_movieclip_anim_ibuf_for_frame_no_lock (struct MovieClip *clip, const struct MovieClipUser *user)
 
bool BKE_movieclip_has_cached_frame (struct MovieClip *clip, const struct MovieClipUser *user)
 
bool BKE_movieclip_put_frame_if_possible (struct MovieClip *clip, const struct MovieClipUser *user, struct ImBuf *ibuf)
 
struct GPUTexture * BKE_movieclip_get_gpu_texture (struct MovieClip *clip, struct MovieClipUser *cuser)
 
void BKE_movieclip_free_gputexture (struct MovieClip *clip)
 
void BKE_movieclip_eval_update (struct Depsgraph *depsgraph, struct Main *bmain, struct MovieClip *clip)
 

Macro Definition Documentation

◆ MOVIECLIP_CACHE_SKIP

◆ MOVIECLIP_DISABLE_BLUE

#define MOVIECLIP_DISABLE_BLUE   (1 << 2)

Definition at line 143 of file BKE_movieclip.h.

Referenced by postprocess_frame(), and rna_def_space_clip().

◆ MOVIECLIP_DISABLE_GREEN

#define MOVIECLIP_DISABLE_GREEN   (1 << 1)

Definition at line 142 of file BKE_movieclip.h.

Referenced by postprocess_frame(), and rna_def_space_clip().

◆ MOVIECLIP_DISABLE_RED

#define MOVIECLIP_DISABLE_RED   (1 << 0)

Post-processing flags.

Definition at line 141 of file BKE_movieclip.h.

Referenced by postprocess_frame(), and rna_def_space_clip().

◆ MOVIECLIP_PREVIEW_GRAYSCALE

#define MOVIECLIP_PREVIEW_GRAYSCALE   (1 << 3)

Definition at line 144 of file BKE_movieclip.h.

Referenced by postprocess_frame(), and rna_def_space_clip().

Function Documentation

◆ BKE_movieclip_anim_ibuf_for_frame_no_lock()

struct ImBuf * BKE_movieclip_anim_ibuf_for_frame_no_lock ( struct MovieClip * clip,
const struct MovieClipUser * user )

Read image buffer from the given movie clip without acquiring the LOCK_MOVIECLIP lock. Used by a prefetch job which takes care of creating a local copy of the clip.

Referenced by prefetch_movie_frame().

◆ BKE_movieclip_build_proxy_frame()

void BKE_movieclip_build_proxy_frame ( struct MovieClip * clip,
int clip_flag,
struct MovieDistortion * distortion,
int cfra,
const int * build_sizes,
int build_count,
bool undistorted )
Note
currently used by proxy job for movies, threading happens within single frame (meaning scaling shall be threaded).

Definition at line 1800 of file movieclip.cc.

References BKE_movieclip_get_ibuf_flag(), MovieClipUser::framenr, get_undistorted_ibuf(), IMB_freeImBuf(), MCLIP_PROXY_RENDER_SIZE_FULL, movieclip_build_proxy_ibuf(), MOVIECLIP_CACHE_SKIP, MovieClipUser::render_flag, and MovieClipUser::render_size.

Referenced by do_movie_proxy().

◆ BKE_movieclip_build_proxy_frame_for_ibuf()

void BKE_movieclip_build_proxy_frame_for_ibuf ( struct MovieClip * clip,
struct ImBuf * ibuf,
struct MovieDistortion * distortion,
int cfra,
const int * build_sizes,
int build_count,
bool undistorted )
Note
currently used by proxy job for sequences, threading happens within sequence (different threads handles different frames, no threading within frame is needed)

Definition at line 1841 of file movieclip.cc.

References get_undistorted_ibuf(), IMB_freeImBuf(), and movieclip_build_proxy_ibuf().

Referenced by proxy_task_func().

◆ BKE_movieclip_clear_cache()

void BKE_movieclip_clear_cache ( struct MovieClip * clip)

Definition at line 1634 of file movieclip.cc.

References free_buffers().

Referenced by ED_space_clip_set_clip().

◆ BKE_movieclip_clear_proxy_cache()

void BKE_movieclip_clear_proxy_cache ( struct MovieClip * clip)

Definition at line 1639 of file movieclip.cc.

References IMB_moviecache_cleanup(), and moviecache_check_free_proxy().

Referenced by proxy_endjob().

◆ BKE_movieclip_convert_multilayer_ibuf()

void BKE_movieclip_convert_multilayer_ibuf ( struct ImBuf * ibuf)

Will try to make image buffer usable when originating from the multi-layer source. Internally finds a first combined pass and uses that as a buffer. Not ideal, but is better than a complete empty buffer.

Definition at line 505 of file movieclip.cc.

References BLI_assert, ImBuf::channels, ImBufFloatBuffer::data, ImBuf::float_buffer, ImBuf::ftype, IB_TAKE_OWNERSHIP, IMB_assign_float_buffer(), IMB_exr_close(), IMB_exr_multilayer_convert(), IMB_FTYPE_OPENEXR, and ImBuf::userdata.

Referenced by movieclip_load_sequence_file(), and prefetch_task_func().

◆ BKE_movieclip_eval_update()

void BKE_movieclip_eval_update ( struct Depsgraph * depsgraph,
struct Main * bmain,
struct MovieClip * clip )

◆ BKE_movieclip_file_add()

struct MovieClip * BKE_movieclip_file_add ( struct Main * bmain,
const char * filepath )

Checks if image was already loaded, then returns same image otherwise creates new. does not load ibuf itself pass on optional frame for filepath images.

Definition at line 941 of file movieclip.cc.

References BKE_main_blendfile_path(), BLI_open(), BLI_path_abs(), BLI_path_basename(), detect_clip_source(), file, FILE_MAX, movieclip_alloc(), movieclip_calc_length(), movieclip_load_get_size(), O_BINARY, and STRNCPY.

Referenced by BKE_movieclip_file_add_exists_ex().

◆ BKE_movieclip_file_add_exists()

struct MovieClip * BKE_movieclip_file_add_exists ( struct Main * bmain,
const char * filepath )

Definition at line 1007 of file movieclip.cc.

References BKE_movieclip_file_add_exists_ex().

Referenced by open_exec().

◆ BKE_movieclip_file_add_exists_ex()

struct MovieClip * BKE_movieclip_file_add_exists_ex ( struct Main * bmain,
const char * filepath,
bool * r_exists )

◆ BKE_movieclip_filepath_for_frame()

void BKE_movieclip_filepath_for_frame ( struct MovieClip * clip,
const struct MovieClipUser * user,
char * filepath )

◆ BKE_movieclip_free_gputexture()

◆ BKE_movieclip_get_aspect()

void BKE_movieclip_get_aspect ( struct MovieClip * clip,
float * aspx,
float * aspy )

◆ BKE_movieclip_get_cache_segments()

void BKE_movieclip_get_cache_segments ( struct MovieClip * clip,
const struct MovieClipUser * user,
int * r_totseg,
int ** r_points )

Get segments of cached frames. useful for debugging cache policies.

Referenced by draw_movieclip_cache().

◆ BKE_movieclip_get_duration()

int BKE_movieclip_get_duration ( struct MovieClip * clip)

◆ BKE_movieclip_get_fps()

float BKE_movieclip_get_fps ( struct MovieClip * clip)

◆ BKE_movieclip_get_gpu_texture()

◆ BKE_movieclip_get_ibuf()

◆ BKE_movieclip_get_ibuf_flag()

◆ BKE_movieclip_get_postprocessed_ibuf()

struct ImBuf * BKE_movieclip_get_postprocessed_ibuf ( struct MovieClip * clip,
const struct MovieClipUser * user,
int postprocess_flag )

◆ BKE_movieclip_get_size()

void BKE_movieclip_get_size ( struct MovieClip * clip,
const struct MovieClipUser * user,
int * r_width,
int * r_height )

◆ BKE_movieclip_get_size_fl()

void BKE_movieclip_get_size_fl ( struct MovieClip * clip,
const struct MovieClipUser * user,
float r_size[2] )

◆ BKE_movieclip_get_stable_ibuf()

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 )

◆ BKE_movieclip_has_cached_frame()

bool BKE_movieclip_has_cached_frame ( struct MovieClip * clip,
const struct MovieClipUser * user )

◆ BKE_movieclip_has_frame()

bool BKE_movieclip_has_frame ( struct MovieClip * clip,
const struct MovieClipUser * user )

◆ BKE_movieclip_proxy_enabled()

bool BKE_movieclip_proxy_enabled ( struct MovieClip * clip)

Definition at line 1871 of file movieclip.cc.

References MCLIP_USE_PROXY.

Referenced by seq_render_movieclip_strip().

◆ BKE_movieclip_put_frame_if_possible()

bool BKE_movieclip_put_frame_if_possible ( struct MovieClip * clip,
const struct MovieClipUser * user,
struct ImBuf * ibuf )

◆ BKE_movieclip_reload()

void BKE_movieclip_reload ( struct Main * bmain,
struct MovieClip * clip )

◆ BKE_movieclip_remap_clip_to_scene_frame()

◆ BKE_movieclip_remap_scene_to_clip_frame()

◆ BKE_movieclip_update_scopes()

void BKE_movieclip_update_scopes ( struct MovieClip * clip,
const struct MovieClipUser * user,
struct MovieClipScopes * scopes )

◆ BKE_movieclip_user_set_frame()