Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
matrix: frame prop is now set when a preset is used.
Browse files Browse the repository at this point in the history
  • Loading branch information
EleonoreMizo committed Aug 16, 2022
1 parent 87938f4 commit 7e0e95b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/fmtc/Matrix_vs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Matrix::Matrix (const ::VSMap &in, ::VSMap &out, void * /*user_data_ptr*/, ::VSC
const int nbr_expected_coef = _nbr_planes * (_nbr_planes + 1);

bool mat_init_flag = false;
bool preset_flag = false;

// Matrix presets
std::string mat (get_arg_str (in, out, "mat", ""));
Expand Down Expand Up @@ -182,6 +183,7 @@ Matrix::Matrix (const ::VSMap &in, ::VSMap &out, void * /*user_data_ptr*/, ::VSC
_mat_main = m2d * m2s;

mat_init_flag = true;
preset_flag = true;
}

// Custom coefficients
Expand Down Expand Up @@ -309,6 +311,7 @@ Matrix::Matrix (const ::VSMap &in, ::VSMap &out, void * /*user_data_ptr*/, ::VSC
vsutl::is_full_range_default (fmt_dst) ? 1 : 0,
0, &_range_set_dst_flag
) != 0);
_range_set_dst_flag |= preset_flag;

prepare_matrix_coef (
*this, *_proc_uptr, _mat_main,
Expand Down
4 changes: 3 additions & 1 deletion src/fmtcavs/Matrix_avs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Matrix::Matrix (::IScriptEnvironment &env, const ::AVSValue &args)
const int nbr_expected_coef = _nbr_planes_proc * (_nbr_planes_proc + 1);

bool mat_init_flag = false;
bool preset_flag = false;
fmtcl::Mat4 mat_main; // Main matrix, float input, float output

// Matrix presets
Expand Down Expand Up @@ -169,6 +170,7 @@ Matrix::Matrix (::IScriptEnvironment &env, const ::AVSValue &args)

mat_main = m2d * m2s;
mat_init_flag = true;
preset_flag = true;
}

// Alpha plane processing, if any
Expand Down Expand Up @@ -267,7 +269,7 @@ Matrix::Matrix (::IScriptEnvironment &env, const ::AVSValue &args)
_fulld_flag = args [Param_FULLD].AsBool (
fmtcl::is_full_range_default (fmt_dst.get_col_fam ())
);
_range_def_flag = args [Param_FULLD].Defined ();
_range_def_flag = (args [Param_FULLD].Defined () || preset_flag);

prepare_matrix_coef (
env, *_proc_uptr, mat_main,
Expand Down

0 comments on commit 7e0e95b

Please sign in to comment.