2023-08-15 16:20:26 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2011 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup DNA
|
2011-11-07 13:55:18 +01:00
|
|
|
*/
|
|
|
|
|
2012-02-17 19:59:41 +01:00
|
|
|
#pragma once
|
2011-12-30 08:25:49 +01:00
|
|
|
|
2011-11-07 13:55:18 +01:00
|
|
|
#include "DNA_ID.h"
|
2020-12-15 00:47:58 +01:00
|
|
|
#include "DNA_color_types.h" /* for color management */
|
|
|
|
#include "DNA_tracking_types.h" /* for #MovieTracking */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-02-17 09:13:45 +01:00
|
|
|
struct AnimData;
|
2011-11-07 13:55:18 +01:00
|
|
|
struct ImBuf;
|
2024-01-23 10:26:49 +01:00
|
|
|
struct ImBufAnim;
|
2011-11-07 13:55:18 +01:00
|
|
|
struct MovieClipProxy;
|
|
|
|
struct MovieTrackingMarker;
|
2019-01-28 11:08:24 +01:00
|
|
|
struct MovieTrackingTrack;
|
|
|
|
struct bGPdata;
|
2011-11-07 13:55:18 +01:00
|
|
|
|
|
|
|
typedef struct MovieClipUser {
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Current frame number. */
|
|
|
|
int framenr;
|
|
|
|
/** Proxy render size. */
|
|
|
|
short render_size, render_flag;
|
2011-11-07 13:55:18 +01:00
|
|
|
} MovieClipUser;
|
|
|
|
|
|
|
|
typedef struct MovieClipProxy {
|
2019-01-07 12:19:13 +01:00
|
|
|
/** 768=FILE_MAXDIR custom directory for index and proxy files (defaults to BL_proxy). */
|
|
|
|
char dir[768];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Time code in use. */
|
|
|
|
short tc;
|
|
|
|
/** Proxy build quality. */
|
|
|
|
short quality;
|
|
|
|
/** Size flags (see below) of all proxies to build. */
|
|
|
|
short build_size_flag;
|
|
|
|
/** Time code flags (see below) of all tc indices to build. */
|
|
|
|
short build_tc_flag;
|
2011-11-07 13:55:18 +01:00
|
|
|
} MovieClipProxy;
|
|
|
|
|
2019-04-02 16:05:22 +02:00
|
|
|
typedef struct MovieClip_RuntimeGPUTexture {
|
|
|
|
void *next, *prev;
|
|
|
|
MovieClipUser user;
|
2020-07-29 04:55:21 +02:00
|
|
|
/** Not written in file 3 = TEXTARGET_COUNT. */
|
|
|
|
struct GPUTexture *gputexture[3];
|
2019-04-02 16:05:22 +02:00
|
|
|
} MovieClip_RuntimeGPUTexture;
|
|
|
|
|
|
|
|
typedef struct MovieClip_Runtime {
|
|
|
|
struct ListBase gputextures;
|
|
|
|
} MovieClip_Runtime;
|
|
|
|
|
2011-11-07 13:55:18 +01:00
|
|
|
typedef struct MovieClip {
|
|
|
|
ID id;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Animation data (must be immediately after id for utilities to use it). */
|
|
|
|
struct AnimData *adt;
|
2023-10-05 13:49:51 +02:00
|
|
|
/**
|
|
|
|
* Engines draw data, must be immediately after AnimData. See IdDdtTemplate and
|
|
|
|
* DRW_drawdatalist_from_id to understand this requirement.
|
|
|
|
*/
|
2023-10-04 07:35:07 +02:00
|
|
|
DrawDataList drawdata;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** File path, 1024 = FILE_MAX. */
|
2020-06-23 01:54:14 +02:00
|
|
|
char filepath[1024];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Sequence or movie. */
|
|
|
|
int source;
|
2023-01-05 12:21:04 +01:00
|
|
|
int _pad;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Size of last accessed frame. */
|
|
|
|
int lastsize[2];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Display aspect. */
|
|
|
|
float aspx, aspy;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Movie source data. */
|
2024-01-23 10:26:49 +01:00
|
|
|
struct ImBufAnim *anim;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Cache for different stuff, not in file. */
|
|
|
|
struct MovieClipCache *cache;
|
|
|
|
/** Grease pencil data. */
|
|
|
|
struct bGPdata *gpd;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Data for SfM tracking. */
|
|
|
|
struct MovieTracking tracking;
|
|
|
|
/**
|
|
|
|
* Context of tracking job used to synchronize data
|
2019-09-30 09:06:28 +02:00
|
|
|
* like frame-number in SpaceClip clip user.
|
2019-01-07 12:19:13 +01:00
|
|
|
*/
|
|
|
|
void *tracking_context;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Proxy to clip data. */
|
|
|
|
struct MovieClipProxy proxy;
|
2012-03-26 15:30:53 +02:00
|
|
|
int flag;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Length of movie. */
|
|
|
|
int len;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/**
|
|
|
|
* Scene frame number footage starts playing at affects all data
|
|
|
|
* which is associated with a clip such as motion tracking,
|
2019-06-16 05:37:21 +02:00
|
|
|
* camera Reconstruction and so.
|
2019-01-07 12:19:13 +01:00
|
|
|
*/
|
|
|
|
int start_frame;
|
|
|
|
/**
|
|
|
|
* Offset which is adding to a file number when reading frame from a file.
|
|
|
|
* affects only a way how scene frame is mapping to a file name and not
|
|
|
|
* touches other data associated with a clip. */
|
|
|
|
int frame_offset;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
/* color management */
|
|
|
|
ColorManagedColorspaceSettings colorspace_settings;
|
2019-04-02 16:05:22 +02:00
|
|
|
|
|
|
|
struct MovieClip_Runtime runtime;
|
2011-11-07 13:55:18 +01:00
|
|
|
} MovieClip;
|
|
|
|
|
|
|
|
typedef struct MovieClipScopes {
|
2019-01-07 12:19:13 +01:00
|
|
|
/** 1 means scopes are ok and recalculation is unneeded. */
|
|
|
|
short ok;
|
|
|
|
/** Whether track's mask should be applied on preview. */
|
|
|
|
short use_track_mask;
|
|
|
|
/** Height of track preview widget. */
|
|
|
|
int track_preview_height;
|
|
|
|
/** Width and height of frame for which scopes are calculated. */
|
|
|
|
int frame_width, frame_height;
|
|
|
|
/** Undistorted position of marker used for pattern sampling. */
|
|
|
|
struct MovieTrackingMarker undist_marker;
|
|
|
|
/** Search area of a track. */
|
|
|
|
struct ImBuf *track_search;
|
2019-01-07 15:00:40 +01:00
|
|
|
/** #ImBuf displayed in track preview. */
|
2019-01-07 12:19:13 +01:00
|
|
|
struct ImBuf *track_preview;
|
2021-02-22 15:39:36 +01:00
|
|
|
/** Sub-pixel position of marker in track ImBuf. */
|
2019-01-07 12:19:13 +01:00
|
|
|
float track_pos[2];
|
|
|
|
/** Active track is disabled, special notifier should be drawn. */
|
|
|
|
short track_disabled;
|
|
|
|
/** Active track is locked, no transformation should be allowed. */
|
|
|
|
short track_locked;
|
2021-02-22 15:54:56 +01:00
|
|
|
/** Frame number scopes are created for (measured in scene frames). */
|
|
|
|
int scene_framenr;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Track scopes are created for. */
|
|
|
|
struct MovieTrackingTrack *track;
|
|
|
|
/** Marker scopes are created for. */
|
|
|
|
struct MovieTrackingMarker *marker;
|
2021-02-13 07:44:51 +01:00
|
|
|
/** Scale used for sliding from preview area. */
|
2019-01-07 12:19:13 +01:00
|
|
|
float slide_scale[2];
|
2011-11-07 13:55:18 +01:00
|
|
|
} MovieClipScopes;
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** #MovieClipProxy.build_size_flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
MCLIP_PROXY_SIZE_25 = (1 << 0),
|
|
|
|
MCLIP_PROXY_SIZE_50 = (1 << 1),
|
|
|
|
MCLIP_PROXY_SIZE_75 = (1 << 2),
|
|
|
|
MCLIP_PROXY_SIZE_100 = (1 << 3),
|
|
|
|
MCLIP_PROXY_UNDISTORTED_SIZE_25 = (1 << 4),
|
|
|
|
MCLIP_PROXY_UNDISTORTED_SIZE_50 = (1 << 5),
|
|
|
|
MCLIP_PROXY_UNDISTORTED_SIZE_75 = (1 << 6),
|
2019-01-15 13:57:49 +01:00
|
|
|
MCLIP_PROXY_UNDISTORTED_SIZE_100 = (1 << 7),
|
2012-11-05 10:40:00 +01:00
|
|
|
};
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** #MovieClip.source */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
MCLIP_SRC_SEQUENCE = 1,
|
2019-01-15 13:57:49 +01:00
|
|
|
MCLIP_SRC_MOVIE = 2,
|
2012-11-05 10:40:00 +01:00
|
|
|
};
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** #MovieClip.flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
MCLIP_USE_PROXY = (1 << 0),
|
|
|
|
MCLIP_USE_PROXY_CUSTOM_DIR = (1 << 1),
|
2019-03-18 04:21:37 +01:00
|
|
|
/* MCLIP_CUSTOM_START_FRAME = (1 << 2), */ /* UNUSED */
|
2016-10-14 17:22:57 +02:00
|
|
|
MCLIP_DATA_EXPAND = (1 << 3),
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2019-01-15 13:57:49 +01:00
|
|
|
MCLIP_TIMECODE_FLAGS = (MCLIP_USE_PROXY | MCLIP_USE_PROXY_CUSTOM_DIR),
|
2012-11-05 10:40:00 +01:00
|
|
|
};
|
2011-12-27 12:09:06 +01:00
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** #MovieClip.render_size */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
MCLIP_PROXY_RENDER_SIZE_FULL = 0,
|
|
|
|
MCLIP_PROXY_RENDER_SIZE_25 = 1,
|
|
|
|
MCLIP_PROXY_RENDER_SIZE_50 = 2,
|
|
|
|
MCLIP_PROXY_RENDER_SIZE_75 = 3,
|
2019-01-15 13:57:49 +01:00
|
|
|
MCLIP_PROXY_RENDER_SIZE_100 = 4,
|
2012-11-05 10:40:00 +01:00
|
|
|
};
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** #MovieClip.render_flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
2019-01-15 13:57:49 +01:00
|
|
|
MCLIP_PROXY_RENDER_UNDISTORT = 1,
|
2019-03-18 20:01:40 +01:00
|
|
|
/** Use original, if proxy is not found. */
|
|
|
|
MCLIP_PROXY_RENDER_USE_FALLBACK_RENDER = 2,
|
2012-11-05 10:40:00 +01:00
|
|
|
};
|