diff --git a/README.md b/README.md index 8f2e3d81..5aaf4c92 100644 --- a/README.md +++ b/README.md @@ -398,9 +398,9 @@ Other APIs not mentioned above are provided, and are well documented and comment |`getExtraProperties()`|If camera was started, returns non-null object with extra information about the camera sensor. Not very useful at the moment.| |`setZoom(float)`, `getZoom()`|Sets a zoom value, where 0 means camera zoomed out and 1 means zoomed in. No-op if zoom is not supported, or camera not started.| |`setExposureCorrection(float)`, `getExposureCorrection()`|Sets exposure compensation EV value, in camera stops. No-op if this is not supported. Should be between the bounds returned by CameraOptions.| -|`setLocation(double, double)`|Sets latitude and longitude to be appended to picture/video metadata.| |`toggleFacing()`|Toggles the facing value between `Facing.FRONT` and `Facing.BACK`.| -|`toggleFlash()`|Toggles the flash value between `FLASH_OFF`, `FLASH_ON`, and `FLASH_AUTO`.| +|`toggleFlash()`|Toggles the flash value between `Flash.OFF`, `Flash.ON`, and `Flash.AUTO`.| +|`setLocation(double, double)`|Sets latitude and longitude to be appended to picture/video metadata.| |`startAutoFocus(float, float)`|Starts an autofocus process at the given coordinates, with respect to the view dimensions.| |`getPreviewSize()`|Returns the size of the preview surface. If CameraView was not constrained in its layout phase (e.g. it was `wrap_content`), this will return the same aspect ratio of CameraView.| |`getSnapshotSize()`|Returns `getPreviewSize()`, since a snapshot is a preview frame.| diff --git a/cameraview/src/main/options/com/otaliastudios/cameraview/Flash.java b/cameraview/src/main/options/com/otaliastudios/cameraview/Flash.java index 9ef9c337..44ebbaa6 100644 --- a/cameraview/src/main/options/com/otaliastudios/cameraview/Flash.java +++ b/cameraview/src/main/options/com/otaliastudios/cameraview/Flash.java @@ -32,7 +32,6 @@ public enum Flash { /** - * TODO: is this true? * Flash is always on, working as a torch. * This is not guaranteed to be supported. * diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java index ea6f904c..51b144c3 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java @@ -6,11 +6,10 @@ import android.graphics.YuvImage; import java.io.ByteArrayOutputStream; -public class CropHelper { +class CropHelper { - // TODO test this. How is YuvImage? Does it come already well rotated? - public static byte[] cropToJpeg(YuvImage yuv, AspectRatio targetRatio, int jpegCompression) { + static byte[] cropToJpeg(YuvImage yuv, AspectRatio targetRatio, int jpegCompression) { Rect crop = computeCrop(yuv.getWidth(), yuv.getHeight(), targetRatio); ByteArrayOutputStream out = new ByteArrayOutputStream(); yuv.compressToJpeg(crop, jpegCompression, out); @@ -20,7 +19,7 @@ public class CropHelper { // This reads a rotated Bitmap thanks to CameraUtils. Then crops and returns a byte array. // In doing so, EXIF data is deleted. - public static byte[] cropToJpeg(byte[] jpeg, AspectRatio targetRatio, int jpegCompression) { + static byte[] cropToJpeg(byte[] jpeg, AspectRatio targetRatio, int jpegCompression) { Bitmap image = CameraUtils.decodeBitmap(jpeg); Rect cropRect = computeCrop(image.getWidth(), image.getHeight(), targetRatio); diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/ExifUtils.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/ExifUtils.java index 4e4e7818..41e3bc44 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/ExifUtils.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/ExifUtils.java @@ -3,9 +3,10 @@ package com.otaliastudios.cameraview; import android.support.media.ExifInterface; +// TODO unused. class ExifUtils { - public static int getOrientationTag(int rotation, boolean flip) { + static int getOrientationTag(int rotation, boolean flip) { switch (rotation) { case 90: return flip ? ExifInterface.ORIENTATION_TRANSPOSE :