1 /***************************************************************************** 2 3 fnc.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_fnc_HEADER_INCLUDED) 20 #define fmtcavs_fnc_HEADER_INCLUDED 21 22 23 24 /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 25 26 #include "avsutl/PlaneProcMode.h" 27 #include "fmtcl/ColorFamily.h" 28 #include "fmtcl/ColorSpaceH265.h" 29 #include "fmtcl/PicFmt.h" 30 #include "fmtcl/ProcComp3Arg.h" 31 #include "fmtcl/SplFmt.h" 32 33 #include <string> 34 #include <vector> 35 36 37 38 class AVSValue; 39 class IScriptEnvironment; 40 class PVideoFrame; 41 struct VideoInfo; 42 43 44 45 namespace avsutl 46 { 47 class PlaneProcessor; 48 } 49 50 namespace fmtcl 51 { 52 class Mat4; 53 class MatrixProc; 54 } 55 56 namespace fmtcavs 57 { 58 59 class FmtAvs; 60 61 62 63 fmtcl::PicFmt conv_fmtavs_to_picfmt (const FmtAvs &fmt, bool full_flag); 64 fmtcl::SplFmt conv_vi_to_splfmt (const ::VideoInfo &vi); 65 void conv_vi_to_splfmt (fmtcl::SplFmt &type, int &bitdepth, const ::VideoInfo &vi); 66 fmtcl::SplFmt conv_bitdepth_to_splfmt (int bitdepth); 67 fmtcl::ColorFamily conv_vi_to_colfam (const ::VideoInfo &vi); 68 fmtcl::ColorFamily conv_str_to_colfam (std::string str); 69 void prepare_matrix_coef (::IScriptEnvironment &env, fmtcl::MatrixProc &mat_proc, const fmtcl::Mat4 &mat_main, const FmtAvs &fmt_dst, bool full_range_dst_flag, const FmtAvs &fmt_src, bool full_range_src_flag, fmtcl::ColorSpaceH265 csp_out, int plane_out); 70 fmtcl::ProcComp3Arg build_mat_proc (const ::VideoInfo &vi_dst, const ::PVideoFrame &dst_sptr, const ::VideoInfo &vi_src, const ::PVideoFrame &src_sptr, bool single_plane_flag = false); 71 bool is_array_defined (const ::AVSValue &arg); 72 std::vector <double> extract_array_f (::IScriptEnvironment &env, const ::AVSValue &arg, const char *filter_and_arg_0, double def_val = 0); 73 std::vector <int> extract_array_i (::IScriptEnvironment &env, const ::AVSValue &arg, const char *filter_and_arg_0, int def_val = 0); 74 std::vector <bool> extract_array_b (::IScriptEnvironment &env, const ::AVSValue &arg, const char *filter_and_arg_0, bool def_val = false); 75 std::vector <std::string> extract_array_s (::IScriptEnvironment &env, const ::AVSValue &arg, const char *filter_and_arg_0, std::string def_val = ""); 76 void set_masktools_planes_param (avsutl::PlaneProcessor &pp, ::IScriptEnvironment &env, const ::AVSValue &arg, const char *filter_and_arg_0, double def_val = double (avsutl::PlaneProcMode_PROCESS)); 77 78 79 80 } // namespace fmtcavs 81 82 83 84 //#include "fmtcavs/fnc.hpp" 85 86 87 88 #endif // fmtcavs_fnc_HEADER_INCLUDED 89 90 91 92 /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 93