Closed jimfinnis closed 3 years ago
Coming along nicely, but does massively complicate adding a function. Here's some code now:
self.registerFunc("grey", "convert an image to greyscale",
[Parameter("image", "an image to process", conntypes.IMG)],
[Parameter("useCV",
"if non-zero, use openCV greyscale conversion (RGB input only): 0.299*R + 0.587*G + 0.114*B",
conntypes.NUMBER, deflt=0)],
funcGrey)
So that's
Now I need to provide the help function and useful error reporting using that data.
Done, via context menus in the expression editor. Works fairly well.
Eval functions need some kind of help system:
This requires the registerFunc code to be able to handle documentation, and chkargs to be tweaked too (with arg names!) We should also make sure we use chkargs throughout, or make its use automatic. Don't add more funcs until I've thought about this.