es.ucm.look.ar.util
Class CameraParametersHelper
java.lang.Object
es.ucm.look.ar.util.CameraParametersHelper
public class CameraParametersHelper
- extends java.lang.Object
Only the newer versions of the SDK support querying the available preview
sizes. This class and it descendants encapsulate this functionality, so that
no verify exception is thrown on older(1.6) mobile phones.
Method Summary |
static boolean |
containsSize(java.util.List<Size> sizes,
Size size)
|
static int |
getBestSupportedFormat(java.util.List<java.lang.Integer> listOfFormats)
Returns the best pixel format of the list or -1 if none suites. |
static Size |
getOptimalPreviewSize(java.util.List<Size> sizes,
int screenWidth,
int screenHeight)
Get the optimal preview size for the given screen size. |
static Size |
getSmallestSize(java.util.List<Size> sizes)
|
static void |
setCameraParameters(Camera camera,
int width,
int height)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CameraParametersHelper
public CameraParametersHelper()
containsSize
public static boolean containsSize(java.util.List<Size> sizes,
Size size)
getBestSupportedFormat
public static int getBestSupportedFormat(java.util.List<java.lang.Integer> listOfFormats)
- Returns the best pixel format of the list or -1 if none suites.
- Parameters:
listOfFormats
-
- Returns:
getOptimalPreviewSize
public static Size getOptimalPreviewSize(java.util.List<Size> sizes,
int screenWidth,
int screenHeight)
- Get the optimal preview size for the given screen size.
- Parameters:
sizes
- screenWidth
- screenHeight
-
- Returns:
getSmallestSize
public static Size getSmallestSize(java.util.List<Size> sizes)
setCameraParameters
public static void setCameraParameters(Camera camera,
int width,
int height)