diff options
author | Yin-Chia Yeh <yinchiayeh@google.com> | 2014-05-27 10:04:54 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2014-05-28 01:36:54 -0700 |
commit | 8490ace76fd350e53de9554c11fca715c5a37aaf (patch) | |
tree | feeb7dd1e3c0fc17568815f6f961b07fe9c6fc10 /media | |
parent | 2bb91a7a68e32530adf730deeef2fe95bad20a96 (diff) | |
download | frameworks_base-8490ace76fd350e53de9554c11fca715c5a37aaf.zip frameworks_base-8490ace76fd350e53de9554c11fca715c5a37aaf.tar.gz frameworks_base-8490ace76fd350e53de9554c11fca715c5a37aaf.tar.bz2 |
Camera2: switch API interface to java classses
android.sensor.info.physicalSize: float[] -> SizeF
android.statistics.hotPixelMap: int[] -> Point[]
android.tonemap.curve[Red|Green|Blue]: float[] -> TonemapCurve
Bug: 14628001
Change-Id: I1e085f5e640a059852fcb504b6dd5f884039e653
Diffstat (limited to 'media')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java index cc64f00..fe51215 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java @@ -41,6 +41,7 @@ import android.hardware.camera2.params.RggbChannelVector; import android.hardware.camera2.params.StreamConfiguration; import android.hardware.camera2.params.StreamConfigurationDuration; import android.hardware.camera2.params.StreamConfigurationMap; +import android.hardware.camera2.params.TonemapCurve; import android.hardware.camera2.utils.TypeReference; import static android.hardware.camera2.impl.CameraMetadataNative.*; @@ -49,6 +50,7 @@ import static com.android.mediaframeworktest.unit.ByteArrayHelpers.*; import java.lang.reflect.Array; import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.util.Arrays; import java.util.List; /** @@ -1015,6 +1017,26 @@ public class CameraMetadataTest extends junit.framework.TestCase { assertNull(resultSimpleFaces[i].getMouthPosition()); } + /** + * Read/Write TonemapCurve + */ + float[] red = new float[] {0.0f, 0.0f, 1.0f, 1.0f}; + float[] green = new float[] {0.0f, 1.0f, 1.0f, 0.0f}; + float[] blue = new float[] { + 0.0000f, 0.0000f, 0.0667f, 0.2920f, 0.1333f, 0.4002f, 0.2000f, 0.4812f, + 0.2667f, 0.5484f, 0.3333f, 0.6069f, 0.4000f, 0.6594f, 0.4667f, 0.7072f, + 0.5333f, 0.7515f, 0.6000f, 0.7928f, 0.6667f, 0.8317f, 0.7333f, 0.8685f, + 0.8000f, 0.9035f, 0.8667f, 0.9370f, 0.9333f, 0.9691f, 1.0000f, 1.0000f}; + TonemapCurve tcIn = new TonemapCurve(red, green, blue); + mMetadata.set(CaptureResult.TONEMAP_CURVE, tcIn); + float[] redOut = mMetadata.get(CaptureResult.TONEMAP_CURVE_RED); + float[] greenOut = mMetadata.get(CaptureResult.TONEMAP_CURVE_GREEN); + float[] blueOut = mMetadata.get(CaptureResult.TONEMAP_CURVE_BLUE); + assertTrue("Input and output tonemap curve should match", Arrays.equals(red, redOut)); + assertTrue("Input and output tonemap curve should match", Arrays.equals(green, greenOut)); + assertTrue("Input and output tonemap curve should match", Arrays.equals(blue, blueOut)); + TonemapCurve tcOut = mMetadata.get(CaptureResult.TONEMAP_CURVE); + assertTrue("Input and output tonemap curve should match", tcIn.equals(tcOut)); } /** |