2011-11-07 12:55:18 +00:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
2012-05-12 20:39:39 +00:00
|
|
|
* The Original Code is Copyright (C) 2011 Blender Foundation.
|
2011-11-07 12:55:18 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup bke
|
2011-11-07 12:55:18 +00:00
|
|
|
*/
|
|
|
|
|
2020-03-02 15:07:49 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-04-06 12:07:27 +02:00
|
|
|
struct Depsgraph;
|
2011-11-07 12:55:18 +00:00
|
|
|
struct ImBuf;
|
|
|
|
struct Main;
|
|
|
|
struct MovieClip;
|
|
|
|
struct MovieClipScopes;
|
|
|
|
struct MovieClipUser;
|
|
|
|
struct MovieDistortion;
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
struct MovieClip *BKE_movieclip_file_add(struct Main *bmain, const char *name);
|
2015-10-06 19:40:15 +11:00
|
|
|
struct MovieClip *BKE_movieclip_file_add_exists_ex(struct Main *bmain,
|
2020-09-04 20:59:13 +02:00
|
|
|
const char *filepath,
|
2015-10-06 19:40:15 +11:00
|
|
|
bool *r_exists);
|
2020-09-04 20:59:13 +02:00
|
|
|
struct MovieClip *BKE_movieclip_file_add_exists(struct Main *bmain, const char *filepath);
|
2018-06-05 15:10:33 +02:00
|
|
|
void BKE_movieclip_reload(struct Main *bmain, struct MovieClip *clip);
|
2013-04-04 09:50:51 +00:00
|
|
|
void BKE_movieclip_clear_cache(struct MovieClip *clip);
|
2014-12-15 22:20:06 +05:00
|
|
|
void BKE_movieclip_clear_proxy_cache(struct MovieClip *clip);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2019-02-05 16:50:57 +01:00
|
|
|
void BKE_movieclip_convert_multilayer_ibuf(struct ImBuf *ibuf);
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
struct ImBuf *BKE_movieclip_get_ibuf(struct MovieClip *clip, struct MovieClipUser *user);
|
2012-01-15 13:31:58 +00:00
|
|
|
struct ImBuf *BKE_movieclip_get_postprocessed_ibuf(struct MovieClip *clip,
|
|
|
|
struct MovieClipUser *user,
|
|
|
|
int postprocess_flag);
|
|
|
|
struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip,
|
|
|
|
struct MovieClipUser *user,
|
|
|
|
float loc[2],
|
|
|
|
float *scale,
|
|
|
|
float *angle,
|
|
|
|
int postprocess_flag);
|
2012-02-01 19:06:21 +00:00
|
|
|
struct ImBuf *BKE_movieclip_get_ibuf_flag(struct MovieClip *clip,
|
|
|
|
struct MovieClipUser *user,
|
|
|
|
int flag,
|
|
|
|
int cache_flag);
|
2011-11-07 12:55:18 +00:00
|
|
|
void BKE_movieclip_get_size(struct MovieClip *clip,
|
|
|
|
struct MovieClipUser *user,
|
|
|
|
int *width,
|
|
|
|
int *height);
|
2012-09-13 05:29:38 +00:00
|
|
|
void BKE_movieclip_get_size_fl(struct MovieClip *clip, struct MovieClipUser *user, float size[2]);
|
|
|
|
int BKE_movieclip_get_duration(struct MovieClip *clip);
|
2018-03-05 15:00:04 +01:00
|
|
|
float BKE_movieclip_get_fps(struct MovieClip *clip);
|
2012-09-13 05:29:38 +00:00
|
|
|
void BKE_movieclip_get_aspect(struct MovieClip *clip, float *aspx, float *aspy);
|
2014-02-03 18:55:59 +11:00
|
|
|
bool BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user);
|
2011-11-07 12:55:18 +00:00
|
|
|
void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr);
|
|
|
|
|
|
|
|
void BKE_movieclip_update_scopes(struct MovieClip *clip,
|
|
|
|
struct MovieClipUser *user,
|
|
|
|
struct MovieClipScopes *scopes);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-05-08 07:25:39 +10:00
|
|
|
void BKE_movieclip_get_cache_segments(struct MovieClip *clip,
|
|
|
|
struct MovieClipUser *user,
|
|
|
|
int *r_totseg,
|
|
|
|
int **r_points);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-12-27 11:09:06 +00:00
|
|
|
void BKE_movieclip_build_proxy_frame(struct MovieClip *clip,
|
|
|
|
int clip_flag,
|
|
|
|
struct MovieDistortion *distortion,
|
2014-02-03 18:55:59 +11:00
|
|
|
int cfra,
|
|
|
|
int *build_sizes,
|
|
|
|
int build_count,
|
|
|
|
bool undistorted);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-03-15 16:57:19 +00:00
|
|
|
void BKE_movieclip_build_proxy_frame_for_ibuf(struct MovieClip *clip,
|
|
|
|
struct ImBuf *ibuf,
|
|
|
|
struct MovieDistortion *distortion,
|
2014-02-03 18:55:59 +11:00
|
|
|
int cfra,
|
|
|
|
int *build_sizes,
|
|
|
|
int build_count,
|
|
|
|
bool undistorted);
|
2013-03-15 16:57:19 +00:00
|
|
|
|
2017-12-15 12:23:35 +01:00
|
|
|
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);
|
2012-06-06 18:58:30 +00:00
|
|
|
|
2013-03-20 17:03:20 +00:00
|
|
|
void BKE_movieclip_filename_for_frame(struct MovieClip *clip,
|
|
|
|
struct MovieClipUser *user,
|
|
|
|
char *name);
|
2021-03-22 16:24:03 +01:00
|
|
|
|
|
|
|
/* 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. */
|
|
|
|
struct ImBuf *BKE_movieclip_anim_ibuf_for_frame_no_lock(struct MovieClip *clip,
|
|
|
|
struct MovieClipUser *user);
|
2013-03-20 17:03:20 +00:00
|
|
|
|
2014-02-03 18:55:59 +11:00
|
|
|
bool BKE_movieclip_has_cached_frame(struct MovieClip *clip, struct MovieClipUser *user);
|
|
|
|
bool BKE_movieclip_put_frame_if_possible(struct MovieClip *clip,
|
|
|
|
struct MovieClipUser *user,
|
|
|
|
struct ImBuf *ibuf);
|
2013-03-15 16:57:19 +00:00
|
|
|
|
2020-07-29 18:13:19 +02:00
|
|
|
struct GPUTexture *BKE_movieclip_get_gpu_texture(struct MovieClip *clip,
|
|
|
|
struct MovieClipUser *cuser);
|
|
|
|
|
|
|
|
void BKE_movieclip_free_gputexture(struct MovieClip *clip);
|
|
|
|
|
2019-06-04 16:52:48 +02:00
|
|
|
/* Dependency graph evaluation. */
|
|
|
|
|
2019-07-28 13:24:18 +02:00
|
|
|
void BKE_movieclip_eval_update(struct Depsgraph *depsgraph,
|
|
|
|
struct Main *bmain,
|
|
|
|
struct MovieClip *clip);
|
2018-08-13 16:59:42 -03:00
|
|
|
void BKE_movieclip_eval_selection_update(struct Depsgraph *depsgraph, struct MovieClip *clip);
|
2017-10-25 11:45:31 +02:00
|
|
|
|
2018-09-24 18:46:51 +02:00
|
|
|
/* caching flags */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define MOVIECLIP_CACHE_SKIP (1 << 0)
|
2012-02-01 19:06:21 +00:00
|
|
|
|
2012-01-15 13:31:58 +00:00
|
|
|
/* postprocessing flags */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define MOVIECLIP_DISABLE_RED (1 << 0)
|
|
|
|
#define MOVIECLIP_DISABLE_GREEN (1 << 1)
|
|
|
|
#define MOVIECLIP_DISABLE_BLUE (1 << 2)
|
|
|
|
#define MOVIECLIP_PREVIEW_GRAYSCALE (1 << 3)
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2020-03-02 15:07:49 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|