diff options
author | Jason Sams <jsams@google.com> | 2013-01-08 11:52:32 -0800 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2013-01-08 11:52:56 -0800 |
commit | 40f1fa6ed699b885e3270faf88085ed78f54a2f4 (patch) | |
tree | 8530f0e4c16df44ec3a7d58f2fb8d8c91cd8f5af /tests/RenderScriptTests | |
parent | 3d5161049ab4b2c8efb1a8b18d960602ccaca520 (diff) | |
download | frameworks_base-40f1fa6ed699b885e3270faf88085ed78f54a2f4.zip frameworks_base-40f1fa6ed699b885e3270faf88085ed78f54a2f4.tar.gz frameworks_base-40f1fa6ed699b885e3270faf88085ed78f54a2f4.tar.bz2 |
Add 3D LUT intrinsic java class
Add test for 3D LUT
Change-Id: I52bc20fd5458afda6de0a6015e9c8bc6a4970055
Diffstat (limited to 'tests/RenderScriptTests')
-rw-r--r-- | tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ColorCube.java | 17 | ||||
-rw-r--r-- | tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java | 8 |
2 files changed, 18 insertions, 7 deletions
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ColorCube.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ColorCube.java index 1d2cdbd..f313c46 100644 --- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ColorCube.java +++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ColorCube.java @@ -25,6 +25,7 @@ import android.renderscript.RenderScript; import android.renderscript.Script; import android.renderscript.ScriptC; import android.renderscript.ScriptGroup; +import android.renderscript.ScriptIntrinsic3DLUT; import android.renderscript.ScriptIntrinsicColorMatrix; import android.renderscript.Type; import android.util.Log; @@ -32,8 +33,11 @@ import android.util.Log; public class ColorCube extends TestBase { private Allocation mCube; private ScriptC_colorcube mScript; + private ScriptIntrinsic3DLUT mIntrinsic; + private boolean mUseIntrinsic; - public ColorCube() { + public ColorCube(boolean useIntrinsic) { + mUseIntrinsic = useIntrinsic; } private void initCube() { @@ -66,16 +70,19 @@ public class ColorCube extends TestBase { public void createTest(android.content.res.Resources res) { mScript = new ScriptC_colorcube(mRS, res, R.raw.colorcube); + mIntrinsic = ScriptIntrinsic3DLUT.create(mRS, Element.U8_4(mRS)); initCube(); mScript.invoke_setCube(mCube); - - - //mScript.invoke_setMatrix(m); + mIntrinsic.setLUT(mCube); } public void runTest() { - mScript.forEach_root(mInPixelsAllocation, mOutPixelsAllocation); + if (mUseIntrinsic) { + mIntrinsic.forEach(mInPixelsAllocation, mOutPixelsAllocation); + } else { + mScript.forEach_root(mInPixelsAllocation, mOutPixelsAllocation); + } } } diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java index 18f438a..a8c1399 100644 --- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java +++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java @@ -292,7 +292,10 @@ public class ImageProcessingActivity extends Activity mTest = new WhiteBalance(); break; case 36: - mTest = new ColorCube(); + mTest = new ColorCube(false); + break; + case 37: + mTest = new ColorCube(true); break; } @@ -305,7 +308,7 @@ public class ImageProcessingActivity extends Activity } void setupTests() { - mTestNames = new String[37]; + mTestNames = new String[38]; mTestNames[0] = "Levels Vec3 Relaxed"; mTestNames[1] = "Levels Vec4 Relaxed"; mTestNames[2] = "Levels Vec3 Full"; @@ -343,6 +346,7 @@ public class ImageProcessingActivity extends Activity mTestNames[34] = "Exposure"; mTestNames[35] = "White Balance"; mTestNames[36] = "Color Cube"; + mTestNames[37] = "Color Cube (3D LUT intrinsic)"; mTestSpinner.setAdapter(new ArrayAdapter<String>( this, R.layout.spinner_layout, mTestNames)); |