1 /*****************************************************************************
2 
3         Transfer.h
4         Author: Laurent de Soras, 2021
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://www.wtfpl.net/ for more details.
13 
14 *Tab=3***********************************************************************/
15 
16 
17 
18 #pragma once
19 #if ! defined (fmtcavs_Transfer_HEADER_INCLUDED)
20 #define fmtcavs_Transfer_HEADER_INCLUDED
21 
22 
23 
24 /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
25 
26 #include "avsutl/VideoFilterBase.h"
27 #include "fmtcavs/ProcAlpha.h"
28 #include "fmtcl/TransCurve.h"
29 #include "fmtcl/TransModel.h"
30 
31 #include <array>
32 
33 
34 
35 namespace fmtcavs
36 {
37 
38 
39 
40 class Transfer
41 :	public avsutl::VideoFilterBase
42 {
43 
44 /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
45 
46 public:
47 
48 	typedef avsutl::VideoFilterBase Inherited;
49 
50 	enum Param
51 	{
52 		Param_CLIP_SRC = 0, // 0
53 		Param_TRANSS,
54 		Param_TRANSD,
55 		Param_CONT,
56 		Param_GCOR,
57 		Param_BITS,
58 		Param_FLT,
59 		Param_FULLS,
60 		Param_FULLD,
61 		Param_LOGCEIS,
62 		Param_LOGCEID, // 10
63 		Param_CPUOPT,
64 		Param_BLACKLVL,
65 		Param_SCENEREF,
66 		Param_LB,
67 		Param_LW,
68 		Param_LWS,
69 		Param_LWD,
70 		Param_AMBIENT,
71 		Param_MATCH,
72 		Param_GY, // 20
73 		Param_DEBUG,
74 
75 		Param_NBR_ELT,
76 	};
77 
78 	explicit       Transfer (::IScriptEnvironment &env, const ::AVSValue &args);
79 	virtual        ~Transfer () = default;
80 
81 	// VideoFilterBase
82 	::PVideoFrame __stdcall
83 						GetFrame (int n, ::IScriptEnvironment *env_ptr) override;
84 
85 
86 
87 /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
88 
89 protected:
90 
91 
92 
93 /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
94 
95 private:
96 
97 	static constexpr int _max_nbr_planes_proc = 3;
98 
99 	FmtAvs         get_output_colorspace (::IScriptEnvironment &env, const ::AVSValue &args, const FmtAvs &fmt_src);
100 
101 	::PClip        _clip_src_sptr;
102 	const ::VideoInfo
103 	               _vi_src;
104 
105 	std::unique_ptr <fmtcavs::ProcAlpha>
106 	               _proc_alpha_uptr;
107 
108 	std::unique_ptr <fmtcl::TransModel>
109 	               _model_uptr;
110 
111 	bool           _fulls_flag = true;
112 	bool           _fulld_flag = true;
113 	fmtcl::TransCurve
114 	               _curve_s    = fmtcl::TransCurve_INVALID;
115 	fmtcl::TransCurve
116 	               _curve_d    = fmtcl::TransCurve_INVALID;
117 
118 	bool           _dbg_flag   = false;
119 	std::string    _dbg_name;     // Property name
120 
121 
122 
123 /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
124 
125 private:
126 
127 	               Transfer ()                               = delete;
128 	               Transfer (const Transfer &other)          = delete;
129 	               Transfer (Transfer &&other)               = delete;
130 	Transfer &     operator = (const Transfer &other)        = delete;
131 	Transfer &     operator = (Transfer &&other)             = delete;
132 	bool           operator == (const Transfer &other) const = delete;
133 	bool           operator != (const Transfer &other) const = delete;
134 
135 }; // class Transfer
136 
137 
138 
139 }  // namespace fmtcavs
140 
141 
142 
143 //#include "fmtcavs/Transfer.hpp"
144 
145 
146 
147 #endif   // fmtcavs_Transfer_HEADER_INCLUDED
148 
149 
150 
151 /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
152