Skip to content

define function using new_x,new_y which is an expr of x,y #8808

Description

@HuaMuLanChina

x, y = hl.Var("x"), hl.Var("y")

new_x = expr_of_xy_0...
new_y = expr_of_xy_1...

dst_img = hl.Func("dst_img")
dst_img[x,y] = hl.select(cond,expr_of_new_x_and_new_y,bg_color)

-------------------is this possible?--------------------------------------------------------_
bool_mapping_flag= hl.Func("bool_mapping_flag")
bool_mapping_flag[newx,newy] = hl.select(cond,True,False)

expr_of_xy0,expr_of_xy1 are some of kind of transformation(rotation or scale) on xy grid.
x,y and new_x,new_y is images with same width height.
use newx,newy for bool_mapping_flag got error like:
Error: Argument 1 in initial definition of "bool_mapping_flag" is not a Var.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions