mScript = new ScriptC_wbalance(mRS); mHist = ScriptIntrinsicHistogram.create(mRS, Element.U8_4(mRS)); mSums = Allocation.createSized(mRS, Element.I32_3(mRS), 256); mHist.setOutput(mSums); mScript.set_histogramValues(mSums);
mHist.forEach(mInPixelsAllocation); mScript.invoke_prepareWhiteBalance(); mScript.forEach_whiteBalanceKernel(mInPixelsAllocation, mOutPixelsAllocation);