matpipeline.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:blemd 作者: niacdoial 项目源码 文件源码
def getMods(self, dest, bias, scale, clamp, type):
        if bias == 0:
            ret = dest
        elif bias <= 2:
            if bias == 2:
                val = -0.5
            else:
                val = 0.5
            if type == 1:
                ret = Node(data=Color((val, val, val)))
            else:
                ret = Node(data=val)
            ret = dest + ret
        else:
            print("getMods(): unknown bias", bias)
            if type == 1:
                ret = Node(data=Color((0,0,0)))
            else:
                ret = Node(data=0)

        if scale == 0:
            pass
        elif scale == 1:
            ret *= (Node('triple', Node(data=2)), 2)[type]  # auto select type
        elif scale == 2:
            ret *= (Node('triple', Node(data=4)), 4)[type]
        elif scale == 3:
            ret *= (Node('triple', Node(data=0.5)), 0.5)[type]
        else:
            print("getMods(): unknown scale", scale)

        if clamp:
            ret = Node('clamp', ret)

        return ret
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号