CameraITS: check the reported crop region

The reported crop region when both YUV and RAW are requested should
be the crop region for the YUV frame within tolerance.

Add the gating to skip test_crop_regions on devices that don't support
freeform cropping.

Fix the requesting crop region in test_crop_region_raw to be a supported
center region.

    Bug: 17994909

Change-Id: Iaeec3a8b51185e4f4a8084548252ad0c34e0aa5c
diff --git a/apps/CameraITS/pymodules/its/objects.py b/apps/CameraITS/pymodules/its/objects.py
index d11ef84..809a98a 100644
--- a/apps/CameraITS/pymodules/its/objects.py
+++ b/apps/CameraITS/pymodules/its/objects.py
@@ -159,6 +159,25 @@
     req = manual_capture_request(s,e)
     return req, out_spec
 
+def get_max_digital_zoom(props):
+    """Returns the maximum amount of zooming possible by the camera device.
+
+    Args:
+        props: the object returned from its.device.get_camera_properties().
+
+    Return:
+        A float indicating the maximum amount of zooming possible by the
+        camera device.
+    """
+
+    maxz = 1.0
+
+    if props.has_key("android.scaler.availableMaxDigitalZoom"):
+        maxz = props["android.scaler.availableMaxDigitalZoom"]
+
+    return maxz
+
+
 class __UnitTest(unittest.TestCase):
     """Run a suite of unit tests on this module.
     """