mIntrinsic = ScriptIntrinsicLUT.create(mRS, Element.U8_4(mRS));
for (int ct=0; ct < 256; ct++) {
float f = ((float)ct) / 255.f;
float r = f;
if (r < 0.5f) {
r = 4.0f * r * r * r;
} else {
r = 1.0f - r;
r = 1.0f - (4.0f * r * r * r);
}
mIntrinsic.setRed(ct, (int)(r * 255.f + 0.5f));
float g = f;
if (g < 0.5f) {
g = 2.0f * g * g;
} else {
g = 1.0f - g;
g = 1.0f - (2.0f * g * g);
}
mIntrinsic.setGreen(ct, (int)(g * 255.f + 0.5f));
float b = f * 0.5f + 0.25f;
mIntrinsic.setBlue(ct, (int)(b * 255.f + 0.5f));
}