Beispiel #1
0
        print("  item {} {} {:.6}".format(p.name, p.type, p.value))
    else:
        print("  item {} {} {}".format(p.name, p.type, p.value))


def print_param_list(pl):
    for p in pl:
        print_param_value(p)


######################################################################
# main test starts here

try:
    print("Testing individual ParamValue:")
    pv = oiio.ParamValue("a", 42)
    print_param_value(pv)
    pv = oiio.ParamValue("b", 3.5)
    print_param_value(pv)
    pv = oiio.ParamValue("c", "xyzpdq")
    print_param_value(pv)
    pv = oiio.ParamValue("d", "float[4]", (3.5, 4.5, 5.5, 6.5))
    print_param_value(pv)
    pv = oiio.ParamValue("e", "float", 4, oiio.Interp.INTERP_LINEAR,
                         (1, 3, 5, 7))
    print_param_value(pv)
    print("")

    print("Testing ParamValueList:")
    pl = oiio.ParamValueList()
    pl.attribute("i", 1)
Beispiel #2
0
    else :
        print ("  item {} {} {}".format(p.name, p.type, p.value))

def print_param_list(pl) :
    for p in pl :
        print_param_value(p)



######################################################################
# main test starts here

try:
    print ("Testing individual ParamValue:")
    # Construct from scalars
    pv = oiio.ParamValue("a", 42)
    print_param_value(pv)
    pv = oiio.ParamValue("b", 3.5)
    print_param_value(pv)
    pv = oiio.ParamValue("c", "xyzpdq")
    print_param_value(pv)
    # Construct from tuple
    pv = oiio.ParamValue("d", "float[4]", (3.5, 4.5, 5.5, 6.5))
    print_param_value(pv)
    # Construct from tuple with nvalues/interp
    pv = oiio.ParamValue("e", "float", 4, oiio.Interp.LINEAR, (1, 3, 5, 7))
    print_param_value(pv)
    # Construct from a list
    pv = oiio.ParamValue("f", "point", [3.5, 4.5, 5.5, 6.5])
    print_param_value(pv)
    # Construct from a numpy array