2011-11-07 12:55:18 +00:00
|
|
|
/*
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation,
|
|
|
|
* Sergey Sharybin
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __BKE_MOVIECLIP_H__
|
|
|
|
#define __BKE_MOVIECLIP_H__
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/** \file BKE_movieclip.h
|
|
|
|
* \ingroup bke
|
|
|
|
* \author Sergey Sharybin
|
|
|
|
*/
|
|
|
|
|
2017-10-25 11:45:31 +02:00
|
|
|
struct EvaluationContext;
|
2011-11-07 12:55:18 +00:00
|
|
|
struct ImBuf;
|
|
|
|
struct Main;
|
|
|
|
struct MovieClip;
|
|
|
|
struct MovieClipScopes;
|
|
|
|
struct MovieClipUser;
|
|
|
|
struct MovieDistortion;
|
|
|
|
|
2012-04-28 16:49:00 +00:00
|
|
|
void BKE_movieclip_free(struct MovieClip *clip);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).
This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.
It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).
Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!
As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.
Design task : T51804
Phab Diff: D2714
2017-08-07 16:39:55 +02:00
|
|
|
void BKE_movieclip_copy_data(struct Main *bmain, struct MovieClip *clip_dst, const struct MovieClip *clip_src, const int flag);
|
2017-06-14 22:36:30 +02:00
|
|
|
struct MovieClip *BKE_movieclip_copy(struct Main *bmain, const struct MovieClip *clip);
|
2016-07-29 23:13:31 +02:00
|
|
|
void BKE_movieclip_make_local(struct Main *bmain, struct MovieClip *clip, const bool lib_local);
|
|
|
|
|
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, const char *name, bool *r_exists);
|
|
|
|
struct MovieClip *BKE_movieclip_file_add_exists(struct Main *bmain, const char *name);
|
2011-11-07 12:55:18 +00:00
|
|
|
void BKE_movieclip_reload(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
|
|
|
|
|
|
|
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);
|
|
|
|
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);
|
|
|
|
|
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);
|
2011-11-07 12:55:18 +00: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);
|
2011-11-07 12:55:18 +00: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
|
|
|
|
2012-06-20 10:54:56 +00:00
|
|
|
float BKE_movieclip_remap_scene_to_clip_frame(struct MovieClip *clip, float framenr);
|
|
|
|
float BKE_movieclip_remap_clip_to_scene_frame(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);
|
|
|
|
struct ImBuf *BKE_movieclip_anim_ibuf_for_frame(struct MovieClip *clip, struct MovieClipUser *user);
|
|
|
|
|
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
|
|
|
|
2017-10-25 11:45:31 +02:00
|
|
|
/* Evaluaiton. */
|
|
|
|
void BKE_movieclip_eval_update(struct EvaluationContext *eval_ctx, struct MovieClip *clip);
|
|
|
|
|
2012-02-01 19:06:21 +00:00
|
|
|
/* cacheing 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
|
|
|
|
|
|
|
#endif
|