FileDocCategorySizeDatePackage
CrossProcess.javaAPI DocAndroid 5.1 API1928Thu Mar 12 22:22:54 GMT 2015com.android.rs.image

CrossProcess

public class CrossProcess extends TestBase

Fields Summary
private android.renderscript.ScriptIntrinsicLUT
mIntrinsic
Constructors Summary
Methods Summary
public voidcreateTest(android.content.res.Resources res)

        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));
        }

    
public voidrunTest()

        mIntrinsic.forEach(mInPixelsAllocation, mOutPixelsAllocation);