RenderScript - call to clamp() is ambiguous

375 views Asked by At

In my RenderScript file, I have the following:

out.b = clamp(out.b, 0, 255);

When I build the project, I get the following error:

error: call to 'clamp' is ambiguous

Why is that happening ?

1

There are 1 answers

0
sakridge On

I think it probably doesn’t know the types of the inputs. Use an explicit cast for the constants to match all the types.

If out.b is uchar: out.b = clamp(out.b, (uchar)0, (uchar)255)