int width = mInPixelsAllocation.getType().getX();
int height = mInPixelsAllocation.getType().getY();
if (mUseIntrinsic) {
mIntrinsic = ScriptIntrinsicBlur.create(mRS, Element.U8_4(mRS));
mIntrinsic.setRadius(MAX_RADIUS);
mIntrinsic.setInput(mInPixelsAllocation);
} else {
Type.Builder tb = new Type.Builder(mRS, Element.F32_4(mRS));
tb.setX(width);
tb.setY(height);
mScratchPixelsAllocation1 = Allocation.createTyped(mRS, tb.create());
mScratchPixelsAllocation2 = Allocation.createTyped(mRS, tb.create());
mScript = new ScriptC_threshold(mRS);
mScript.set_width(width);
mScript.set_height(height);
mScript.invoke_setRadius(MAX_RADIUS);
mScript.set_InPixel(mInPixelsAllocation);
mScript.set_ScratchPixel1(mScratchPixelsAllocation1);
mScript.set_ScratchPixel2(mScratchPixelsAllocation2);
}