MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / handleCrop

Function handleCrop

plugins/base/utils/transform-setting.cpp:99–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99static void handleCrop(struct obs_sceneitem_crop &crop, const std::string &id,
100 const std::string &value)
101{
102 int val = 0;
103 try {
104 val = std::stoi(value);
105 } catch (const std::invalid_argument &e) {
106 logConversionError(e, __func__, id.c_str(), value.c_str());
107 return;
108 } catch (const std::out_of_range &e) {
109 logConversionError(e, __func__, id.c_str(), value.c_str());
110 return;
111 }
112
113 if (id == "left") {
114 crop.left = val;
115 } else if (id == "top") {
116 crop.top = val;
117 } else if (id == "right") {
118 crop.right = val;
119 } else if (id == "bottom") {
120 crop.bottom = val;
121 }
122}
123
124static void handlePosOrScaleOrBounds(struct obs_transform_info &info,
125 const TransformSetting &setting,

Callers 1

SetTransformSettingFunction · 0.85

Calls 2

logConversionErrorFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected