1 /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3  * This file is part of openfx-supportext <https://github.com/devernay/openfx-supportext>,
4  * Copyright (C) 2013-2018 INRIA
5  *
6  * openfx-supportext is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * openfx-supportext is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with openfx-supportext.  If not, see <http://www.gnu.org/licenses/gpl-2.0.html>
18  * ***** END LICENSE BLOCK ***** */
19 
20 /*
21  * OFX Shutter parameter support
22  */
23 
24 #ifndef openfx_supportext_ofxsShutter_h
25 #define openfx_supportext_ofxsShutter_h
26 
27 #include <memory>
28 
29 #include "ofxsImageEffect.h"
30 #include "ofxsMacros.h"
31 
32 
33 #define kParamShutter "shutter"
34 #define kParamShutterLabel "Shutter"
35 #define kParamShutterHint "Controls how long (in frames) the shutter should remain open."
36 
37 #define kParamShutterOffset "shutterOffset"
38 #define kParamShutterOffsetLabel "Shutter Offset"
39 #define kParamShutterOffsetHint "Controls when the shutter should be open/closed. Ignored if there is no motion blur (i.e. shutter=0 or motionBlur=0)."
40 #define kParamShutterOffsetOptionCentered "Centered", "Centers the shutter around the frame (from t-shutter/2 to t+shutter/2)", "centered"
41 #define kParamShutterOffsetOptionStart "Start", "Open the shutter at the frame (from t to t+shutter)", "start"
42 #define kParamShutterOffsetOptionEnd "End", "Close the shutter at the frame (from t-shutter to t)", "end"
43 #define kParamShutterOffsetOptionCustom "Custom", "Open the shutter at t+shuttercustomoffset (from t+shuttercustomoffset to t+shuttercustomoffset+shutter)", "custom"
44 
45 enum ShutterOffsetEnum
46 {
47     eShutterOffsetCentered,
48     eShutterOffsetStart,
49     eShutterOffsetEnd,
50     eShutterOffsetCustom
51 };
52 
53 
54 #define kParamShutterCustomOffset "shutterCustomOffset"
55 #define kParamShutterCustomOffsetLabel "Custom Offset"
56 #define kParamShutterCustomOffsetHint "When custom is selected, the shutter is open at current time plus this offset (in frames). Ignored if there is no motion blur (i.e. shutter=0 or motionBlur=0)."
57 
58 namespace OFX {
59 void shutterDescribeInContext(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum context, OFX::PageParamDescriptor* page);
60 void shutterRange(double time, double shutter, ShutterOffsetEnum shutteroffset, double shuttercustomoffset, OfxRangeD* range);
61 }
62 #endif /* defined(openfx_supportext_ofxsShutter_h) */
63