1 /*****************************************************************************
2 
3         Transfer.h
4         Author: Laurent de Soras, 2015
5 
6 --- Legal stuff ---
7 
8 This program is free software. It comes without any warranty, to
9 the extent permitted by applicable law. You can redistribute it
10 and/or modify it under the terms of the Do What The Fuck You Want
11 To Public License, Version 2, as published by Sam Hocevar. See
12 http://sam.zoy.org/wtfpl/COPYING for more details.
13 
14 *Tab=3***********************************************************************/
15 
16 
17 
18 #if ! defined (fmtc_Transfer_HEADER_INCLUDED)
19 #define	fmtc_Transfer_HEADER_INCLUDED
20 
21 #if defined (_MSC_VER)
22 	#pragma once
23 	#pragma warning (4 : 4250)
24 #endif
25 
26 
27 
28 /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
29 
30 #include "fstb/def.h"
31 
32 #include "fmtcl/TransCurve.h"
33 #include "fmtcl/TransModel.h"
34 #include "fmtcl/TransOpInterface.h"
35 #include "fmtcl/TransOpLogC.h"
36 #include "vsutl/FilterBase.h"
37 #include "vsutl/NodeRefSPtr.h"
38 #include "vswrap.h"
39 
40 #include <memory>
41 
42 
43 
44 namespace fmtc
45 {
46 
47 
48 
49 class Transfer
50 :	public vsutl::FilterBase
51 {
52 
53 /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
54 
55 public:
56 
57 	explicit       Transfer (const ::VSMap &in, ::VSMap &out, void *user_data_ptr, ::VSCore &core, const ::VSAPI &vsapi);
58 	virtual        ~Transfer () = default;
59 
60 	// vsutl::FilterBase
61 	virtual void   init_filter (::VSMap &in, ::VSMap &out, ::VSNode &node, ::VSCore &core);
62 	virtual const ::VSFrameRef *
63 	               get_frame (int n, int activation_reason, void * &frame_data_ptr, ::VSFrameContext &frame_ctx, ::VSCore &core);
64 
65 
66 
67 /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
68 
69 protected:
70 
71 
72 
73 /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
74 
75 private:
76 
77 	typedef  std::shared_ptr <fmtcl::TransOpInterface> OpSPtr;
78 
79 	const ::VSFormat &
80 	               get_output_colorspace (const ::VSMap &in, ::VSMap &out, ::VSCore &core, const ::VSFormat &fmt_src) const;
81 
82 	vsutl::NodeRefSPtr
83 	               _clip_src_sptr;
84 	const ::VSVideoInfo
85 	               _vi_in;     // Input. Must be declared after _clip_src_sptr because of initialisation order.
86 	::VSVideoInfo  _vi_out;    // Output. Must be declared after _vi_in.
87 
88 	bool           _sse2_flag = false;
89 	bool           _avx2_flag = false;
90 	std::string    _transs;
91 	std::string    _transd;
92 	double         _contrast  = 1;
93 	double         _gcor      = 1;
94 	bool           _full_range_src_flag = true;
95 	bool           _full_range_dst_flag = true;
96 	fmtcl::TransCurve
97 	               _curve_s = fmtcl::TransCurve_UNDEF;
98 	fmtcl::TransCurve
99 	               _curve_d = fmtcl::TransCurve_UNDEF;
100 	fmtcl::TransOpLogC::ExpIdx // Exposure Index for the Arri Log C curves
101 	               _logc_ei_s = fmtcl::TransOpLogC::ExpIdx_800;
102 	fmtcl::TransOpLogC::ExpIdx
103 	               _logc_ei_d = fmtcl::TransOpLogC::ExpIdx_800;
104 
105 	std::unique_ptr <fmtcl::TransModel>
106 	               _model_uptr;
107 
108 	bool           _dbg_flag = false;
109 	std::string    _dbg_name;     // Property name
110 
111 
112 
113 /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
114 
115 private:
116 
117 	               Transfer ()                               = delete;
118 	               Transfer (const Transfer &other)          = delete;
119 	               Transfer (Transfer &&other)               = delete;
120 	Transfer &     operator = (const Transfer &other)        = delete;
121 	Transfer &     operator = (Transfer &&other)             = delete;
122 	bool           operator == (const Transfer &other) const = delete;
123 	bool           operator != (const Transfer &other) const = delete;
124 
125 };	// class Transfer
126 
127 
128 
129 }	// namespace fmtc
130 
131 
132 
133 //#include "fmtc/Transfer.hpp"
134 
135 
136 
137 #endif	// fmtc_Transfer_HEADER_INCLUDED
138 
139 
140 
141 /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
142