List of utility methods to do Camera Size Get
Size | getOptimalPreviewSize(List get Optimal Preview Size final double ASPECT_TOLERANCE = 0.1; double targetRatio = (double) w / h; if (sizes == null) return null; Size optimalSize = null; double minDiff = Double.MAX_VALUE; int targetHeight = h; for (Size size : sizes) { ... |
Size | getOptimalPreviewSize(List Returns a Size object containing the dimensions for an optimal preview size for the current hardware. final double ASPECT_TOLERANCE = 0.05; double targetRatio = (double) w / h; if (supportedSizes == null) return null; Size optimalSize = null; double minDiff = Double.MAX_VALUE; int targetHeight = h; for (Size size : supportedSizes) { ... |
Camera.Size | getOptimalPreviewSize(int displayOrientation, int width, int height, Camera.Parameters parameters) get Optimal Preview Size double targetRatio = (double) width / height; List<Camera.Size> sizes = parameters.getSupportedPreviewSizes(); Camera.Size optimalSize = null; double minDiff = Double.MAX_VALUE; int targetHeight = height; if (displayOrientation == 90 || displayOrientation == 270) { targetRatio = (double) height / width; for (Size size : sizes) { double ratio = (double) size.width / size.height; if (Math.abs(ratio - targetRatio) <= ASPECT_TOLERANCE) { if (Math.abs(size.height - targetHeight) < minDiff) { optimalSize = size; minDiff = Math.abs(size.height - targetHeight); if (optimalSize == null) { minDiff = Double.MAX_VALUE; for (Size size : sizes) { if (Math.abs(size.height - targetHeight) < minDiff) { optimalSize = size; minDiff = Math.abs(size.height - targetHeight); return (optimalSize); |
Camera.Size | getBiggestPictureSize( Camera.Parameters parameters) get Biggest Picture Size Camera.Size result = null; for (Camera.Size size : parameters.getSupportedPictureSizes()) { if (result == null) { result = size; } else { int resultArea = result.width * result.height; int newArea = size.width * size.height; if (newArea > resultArea) { ... |
String | toString(Iterable to String if (areas == null) { return null; StringBuilder result = new StringBuilder(); for (Camera.Area area : areas) { result.append(area.rect).append(':').append(area.weight) .append(' '); return result.toString(); |
Camera.Size | getSmallestPictureSize( Camera.Parameters parameters) get Smallest Picture Size Camera.Size result = null; for (Camera.Size size : parameters.getSupportedPictureSizes()) { if (result == null) { result = size; } else { int resultArea = result.width * result.height; int newArea = size.width * size.height; if (newArea < resultArea) { ... |
Size | getUsefulSize(List get Useful Size Size size; switch (type) { case SIZE: size = getSizeSIZE(sizes, w, h); break; case RATIO: size = getSizeRATIO(sizes, w, h); break; ... |