aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTimothy Knight <tknight@google.com>2014-08-20 02:23:44 -0700
committerTimothy Knight <tknight@google.com>2014-08-20 02:27:23 -0700
commit6ae9561b05d56e3fbc4ebaacf6120a0d30010abe (patch)
tree6bace5168a64d40b9b8163856135e11cff7d4aba /apps
parent55e4ad4c2baa60330509b625871667f8108b5018 (diff)
downloadpdk-6ae9561b05d56e3fbc4ebaacf6120a0d30010abe.tar.gz
CameraITS: Fixed bug in RAW10 image handling
Change-Id: I7180e0df997d7c57c3da3af67a3c283644ce1016
Diffstat (limited to 'apps')
-rw-r--r--apps/CameraITS/service/src/com/android/camera2/its/ItsUtils.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/CameraITS/service/src/com/android/camera2/its/ItsUtils.java b/apps/CameraITS/service/src/com/android/camera2/its/ItsUtils.java
index e5c6345..0a5747e 100644
--- a/apps/CameraITS/service/src/com/android/camera2/its/ItsUtils.java
+++ b/apps/CameraITS/service/src/com/android/camera2/its/ItsUtils.java
@@ -174,8 +174,17 @@ public class ItsUtils {
readSize = buffer.remaining();
}
buffer.get(rowData, 0, readSize);
- for (int col = 0; col < w; col++) {
- data[offset++] = rowData[col * pixelStride];
+ if (pixelStride >= 1) {
+ for (int col = 0; col < w; col++) {
+ data[offset++] = rowData[col * pixelStride];
+ }
+ } else {
+ // PixelStride of 0 can mean pixel isn't a multiple of 8 bits, for
+ // example with RAW10. Just copy the buffer, dropping any padding at
+ // the end of the row.
+ int length = (w * ImageFormat.getBitsPerPixel(format)) / 8;
+ System.arraycopy(rowData,0,data,offset,length);
+ offset += length;
}
}
}