Move to package protected in some classes

pull/1/head
Mattia Iavarone 7 years ago
parent f6d296f5f5
commit 455e3522e9
  1. 4
      README.md
  2. 1
      cameraview/src/main/options/com/otaliastudios/cameraview/Flash.java
  3. 7
      cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java
  4. 3
      cameraview/src/main/utils/com/otaliastudios/cameraview/ExifUtils.java

@ -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.| |`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.| |`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.| |`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`.| |`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.| |`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.| |`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.| |`getSnapshotSize()`|Returns `getPreviewSize()`, since a snapshot is a preview frame.|

@ -32,7 +32,6 @@ public enum Flash {
/** /**
* TODO: is this true?
* Flash is always on, working as a torch. * Flash is always on, working as a torch.
* This is not guaranteed to be supported. * This is not guaranteed to be supported.
* *

@ -6,11 +6,10 @@ import android.graphics.YuvImage;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
public class CropHelper { class CropHelper {
// TODO test this. How is YuvImage? Does it come already well rotated? static byte[] cropToJpeg(YuvImage yuv, AspectRatio targetRatio, int jpegCompression) {
public static byte[] cropToJpeg(YuvImage yuv, AspectRatio targetRatio, int jpegCompression) {
Rect crop = computeCrop(yuv.getWidth(), yuv.getHeight(), targetRatio); Rect crop = computeCrop(yuv.getWidth(), yuv.getHeight(), targetRatio);
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
yuv.compressToJpeg(crop, jpegCompression, out); 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. // This reads a rotated Bitmap thanks to CameraUtils. Then crops and returns a byte array.
// In doing so, EXIF data is deleted. // 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); Bitmap image = CameraUtils.decodeBitmap(jpeg);
Rect cropRect = computeCrop(image.getWidth(), image.getHeight(), targetRatio); Rect cropRect = computeCrop(image.getWidth(), image.getHeight(), targetRatio);

@ -3,9 +3,10 @@ package com.otaliastudios.cameraview;
import android.support.media.ExifInterface; import android.support.media.ExifInterface;
// TODO unused.
class ExifUtils { class ExifUtils {
public static int getOrientationTag(int rotation, boolean flip) { static int getOrientationTag(int rotation, boolean flip) {
switch (rotation) { switch (rotation) {
case 90: case 90:
return flip ? ExifInterface.ORIENTATION_TRANSPOSE : return flip ? ExifInterface.ORIENTATION_TRANSPOSE :

Loading…
Cancel
Save