2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2011 Blender Foundation.
19 * All rights reserved.
21 * Contributor(s): Blender Foundation,
24 * ***** END GPL LICENSE BLOCK *****
27 #ifndef __BKE_MOVIECLIP_H__
28 #define __BKE_MOVIECLIP_H__
30 /** \file BKE_movieclip.h
32 * \author Sergey Sharybin
38 struct MovieClipScopes;
40 struct MovieDistortion;
42 void BKE_movieclip_free(struct MovieClip *clip);
43 void BKE_movieclip_unlink(struct Main *bmain, struct MovieClip *clip);
45 struct MovieClip *BKE_movieclip_file_add(struct Main *bmain, const char *name);
46 void BKE_movieclip_reload(struct MovieClip *clip);
47 void BKE_movieclip_clear_cache(struct MovieClip *clip);
48 void BKE_movieclip_clear_proxy_cache(struct MovieClip *clip);
50 struct ImBuf *BKE_movieclip_get_ibuf(struct MovieClip *clip, struct MovieClipUser *user);
51 struct ImBuf *BKE_movieclip_get_postprocessed_ibuf(struct MovieClip *clip, struct MovieClipUser *user, int postprocess_flag);
52 struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip, struct MovieClipUser *user, float loc[2], float *scale, float *angle, int postprocess_flag);
53 struct ImBuf *BKE_movieclip_get_ibuf_flag(struct MovieClip *clip, struct MovieClipUser *user, int flag, int cache_flag);
54 void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height);
55 void BKE_movieclip_get_size_fl(struct MovieClip *clip, struct MovieClipUser *user, float size[2]);
56 int BKE_movieclip_get_duration(struct MovieClip *clip);
57 void BKE_movieclip_get_aspect(struct MovieClip *clip, float *aspx, float *aspy);
58 bool BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user);
59 void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr);
61 void BKE_movieclip_update_scopes(struct MovieClip *clip, struct MovieClipUser *user, struct MovieClipScopes *scopes);
63 void BKE_movieclip_get_cache_segments(struct MovieClip *clip, struct MovieClipUser *user, int *r_totseg, int **r_points);
65 void BKE_movieclip_build_proxy_frame(struct MovieClip *clip, int clip_flag, struct MovieDistortion *distortion,
66 int cfra, int *build_sizes, int build_count, bool undistorted);
68 void BKE_movieclip_build_proxy_frame_for_ibuf(struct MovieClip *clip, struct ImBuf *ibuf, struct MovieDistortion *distortion,
69 int cfra, int *build_sizes, int build_count, bool undistorted);
71 float BKE_movieclip_remap_scene_to_clip_frame(struct MovieClip *clip, float framenr);
72 float BKE_movieclip_remap_clip_to_scene_frame(struct MovieClip *clip, float framenr);
74 void BKE_movieclip_filename_for_frame(struct MovieClip *clip, struct MovieClipUser *user, char *name);
75 struct ImBuf *BKE_movieclip_anim_ibuf_for_frame(struct MovieClip *clip, struct MovieClipUser *user);
77 bool BKE_movieclip_has_cached_frame(struct MovieClip *clip, struct MovieClipUser *user);
78 bool BKE_movieclip_put_frame_if_possible(struct MovieClip *clip, struct MovieClipUser *user, struct ImBuf *ibuf);
81 #define MOVIECLIP_CACHE_SKIP (1 << 0)
83 /* postprocessing flags */
84 #define MOVIECLIP_DISABLE_RED (1 << 0)
85 #define MOVIECLIP_DISABLE_GREEN (1 << 1)
86 #define MOVIECLIP_DISABLE_BLUE (1 << 2)
87 #define MOVIECLIP_PREVIEW_GRAYSCALE (1 << 3)