public class Utils
Helper methods to work with Camera
public static Utils INSTANCE
Helper methods to work with Camera
@JvmStatic
public static boolean isFlashSupported(@Nullable
android.hardware.Camera.Parameters parameters)
parameters - Currently selected camera parameters@JvmStatic
@NotNull
public static android.hardware.Camera.Size getLargestPictureSize(@NotNull
android.hardware.Camera.Parameters parameters)
Returns the biggest size for resulting image
@JvmStatic
@NotNull
public static android.hardware.Camera.Size getLargestSizeWithAspectRatioMatch(@NotNull
java.util.List<? extends android.hardware.Camera.Size> sizes,
double targetAspect)
@JvmStatic
@Nullable
public static android.hardware.Camera.Size findByWidthAndHeight(@NotNull
android.hardware.Camera.Parameters parameters,
int width,
int height)
null if there
is no such supported size.@JvmStatic
@Nullable
public static android.hardware.Camera.Size getBestAspectPictureSize(int displayOrientation,
int width,
int height,
@NotNull
android.hardware.Camera.Parameters parameters,
double closeEnough)
displayOrientation - display orientation angle (0-270)width - target display port widthheight - target display port heightparameters - Camera.Parameters to get supported sizes fromcloseEnough - maximum deviation to stop searching for best size, pass 0 to go through all sizes@JvmStatic
public static void enableContinuousFocus(@Nullable
android.hardware.Camera.Parameters parameters)
Sets focus mode to Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE or Camera.Parameters.FOCUS_MODE_AUTO if supported
parameters - target parameters to set focus mode to@JvmStatic
public static void enableAutoFocus(@Nullable
android.hardware.Camera.Parameters parameters)
Sets focus mode to Camera.Parameters.FOCUS_MODE_AUTO if supported
parameters -