I looked at this example https://github.com/googlesamples/android-BasicRenderScript. In that project, they have the following line:
mInAllocation = Allocation.createFromBitmap(rs, mBitmapIn);
where mBitmapIn is of type Bitmap representing the image to process. Later, they call the kernel function named saturation in the .rs file asynchronously via an AsyncTask:
mScript.forEach_saturation(mInAllocation, mOutAllocations[index]);
In saturation.rs file, they have:
uchar4 __attribute__((kernel)) saturation(uchar4 in)
{
float4 f4 = rsUnpackColor8888(in);
...
From this thread Renderscript, what is the `in` parameter? I know that the parameter 'in' points to the data to be processed (which in our case is a pixel, right ? ) So, I know that a pixel consists of 4 color channels and therefore they use uchar4 which is a vector of 4 uchars (see https://developer.android.com/guide/topics/renderscript/reference/rs_value_types.html#android_rs:uchar4 ). But why uchar ? Why not, let's say, uint4 ? Or directly ufloat4 ??