37 b.
append(codegen->generateExpr(expr.args[1].get()).postfix);
38 b.append(codegen->generateExpr(expr.args[2].get()).postfix);
40 auto clip_res = codegen->generateExpr(expr.args[0].get());
41 std::string clip_name = clip_res.postfix.getExpression();
43 b.addDynPixelAccessExpr(clip_name,
":c");
51 b.
append(codegen->generateExpr(expr.args[1].get()).postfix);
52 b.append(codegen->generateExpr(expr.args[2].get()).postfix);
54 auto clip_res = codegen->generateExpr(expr.args[0].get());
55 std::string clip_name = clip_res.postfix.getExpression();
58 int boundary_mode = std::stoi(boundary_expr->value.value);
60 switch (boundary_mode) {
72 std::format(
"Invalid boundary mode '{}' for dyn()", boundary_mode),
75 b.addDynPixelAccessExpr(clip_name, suffix);
81 auto clip_res = codegen->generateExpr(expr.args[0].get());
85 std::string plane_idx = plane_expr->value.value;
88 b.
append(codegen->generateExpr(expr.args[1].get()).postfix);
89 b.append(codegen->generateExpr(expr.args[2].get()).postfix);
90 b.addDynPixelAccessSingle(clip_name, plane_idx);
97 b.
append(codegen->generateExpr(expr.args[2].get()).postfix);
98 b.append(codegen->generateExpr(expr.args[0].get()).postfix);
99 b.append(codegen->generateExpr(expr.args[1].get()).postfix);
108 std::string plane_idx = plane_expr->value.value;
111 b.
append(codegen->generateExpr(expr.args[3].get()).postfix);
112 b.append(codegen->generateExpr(expr.args[0].get()).postfix);
113 b.append(codegen->generateExpr(expr.args[1].get()).postfix);
114 b.addStoreSingle(plane_idx);
120 const std::string& suffix) {
125 b.
append(codegen->generateExpr(expr.args[1].get()).postfix);
126 b.addSetProp(prop_name_expr->name.value, suffix);
131 return handle_set_prop_typed(codegen, expr,
"f");
135 return handle_set_prop_typed(codegen, expr,
"i");
140 return handle_set_prop_typed(codegen, expr,
"af");
145 return handle_set_prop_typed(codegen, expr,
"ai");
159 [[maybe_unused]]
const CallExpr& expr) {
168 auto clip_res = codegen->generateExpr(expr.args[0].get());
179const std::map<std::string, std::vector<BuiltinFunction>> builtin_functions = {
184 .mode_restriction = std::nullopt,
189 .mode_restriction = std::nullopt,
194 .mode_restriction = std::nullopt,
199 .mode_restriction = std::nullopt,
204 .mode_restriction = std::nullopt,
209 .mode_restriction = std::nullopt,
214 .mode_restriction = std::nullopt,
219 .mode_restriction = std::nullopt,
224 .mode_restriction = std::nullopt,
229 .mode_restriction = std::nullopt,
234 .mode_restriction = std::nullopt,
239 .mode_restriction = std::nullopt,
244 .mode_restriction = std::nullopt,
249 .mode_restriction = std::nullopt,
254 .mode_restriction = std::nullopt,
259 .mode_restriction = std::nullopt,
264 .mode_restriction = std::nullopt,
269 .mode_restriction = std::nullopt,
274 .mode_restriction = std::nullopt,
279 .mode_restriction = std::nullopt,
284 .mode_restriction = std::nullopt,
289 .mode_restriction = std::nullopt,
294 .mode_restriction = std::nullopt,
299 .mode_restriction = std::nullopt,
310 .returns_value =
false}}},
316 .special_handler = handle_set_propf,
317 .returns_value =
false}}},
323 .special_handler = handle_set_propi,
324 .returns_value =
false}}},
330 .special_handler = handle_set_propaf,
331 .returns_value =
false}}},
337 .special_handler = handle_set_propai,
338 .returns_value =
false}}},
344 .special_handler = handle_remove_prop,
345 .returns_value =
false}}},
349 .mode_restriction = std::nullopt,
351 .special_handler = handle_is_prop_exist}}},
358 .special_handler = &handle_dyn_expr_3args},
364 .special_handler = &handle_dyn_expr_4args},
370 .special_handler = &handle_dyn_single},
378 .special_handler = &handle_store_expr,
379 .returns_value =
false},
385 .special_handler = &handle_store_single,
386 .returns_value =
false},
393 .special_handler = &handle_exit,
394 .returns_value =
false}}},
399const std::map<std::string, std::vector<BuiltinFunction>>&
401 return builtin_functions;
void addPropExist(const std::string &clip_name, const std::string &prop_name)
void addDeleteProp(const std::string &prop_name)
std::string getExpression() const
void append(const PostfixBuilder &other)
auto get_if(Wrapper *wrapper) -> decltype(std::get_if< T >(&wrapper->value))
const std::map< std::string, std::vector< BuiltinFunction > > & get_builtin_functions()