Fixed issue where lutFunc wouldn't vectorize a Python function over the array.

master
Sofus Albert Høgsbro Rose 2017-11-28 12:25:04 -05:00
parent 282aea28f7
commit 560c979a21
Signed by: so-rose
GPG Key ID: 3D01BE95F3EFFEB9
1 changed files with 2 additions and 2 deletions

View File

@ -41,8 +41,8 @@ class LUT(Transform) :
if dims == 1 :
lut = LUT(dims=dims, size=size, title=title, iRange=iRange)
#Use fast function sampling if the function is a C++ function.
vFunc = lambda arr: olo.gam(arr, func) if isinstance(func, types.BuiltinFunctionType) else np.vectorize(func, otypes=[np.float32])
#Use fast C++ function sampling if the function is a C++ function.
vFunc = lambda arr: olo.gam(arr, func) if isinstance(func, types.BuiltinFunctionType) else np.vectorize(func, otypes=[np.float32])(arr)
lut.array = vFunc(lut.array)
return lut