you should be defining this as
uchar3 __attribute__((kernel)) invert(uchar3 in);
that function will then be reflected as ScriptC_.forEach_invert(Allocation in, Allocation out). each element in in will be passed to invert, and each value returned from invert will be written to the corresponding location in out.