Package io.anyline2.view
Class CameraConfig
- java.lang.Object
-
- io.anyline2.view.CameraConfig
-
public class CameraConfig extends java.lang.ObjectClass holds configurations for the camera
-
-
Constructor Summary
Constructors Constructor Description CameraConfig(org.json.JSONObject jsonObject)Create config from the given json object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CameraFeatures.LensFacinggetDefaultLensFacing()java.util.EnumSet<CameraFeatures.LensFacing>getFallbackLensFacings()doublegetFocalLength()doublegetMaxFocalLength()doublegetMaxZoomRatio()intgetPreferredPictureHeight()intgetPreferredPictureWidth()intgetPreferredPreviewHeight()intgetPreferredPreviewWidth()doublegetZoomRatio()booleanisZoomGestureEnabled()voidsetDefaultLensFacing(CameraFeatures.LensFacing defaultLensFacing)Set the default camera used for scanningvoidsetFallbackLensFacings(java.util.EnumSet<CameraFeatures.LensFacing> fallbackLensFacings)Set the fallback camera facings which are used if the default camera facing is not available on the devicevoidsetFocalLength(double focalLength)voidsetMaxFocalLength(double maxFocalLength)voidsetMaxZoomRatio(double maxZoomRatio)voidsetPreferredPictureHeight(int preferredPictureHeight)Set the preferred height when taking a full picture.voidsetPreferredPictureWidth(int preferredPictureWidth)Set the preferred width when taking a full picture.voidsetPreferredPreviewHeight(int preferredPreviewHeight)Set the preferred preview height.voidsetPreferredPreviewWidth(int preferredPreviewWidth)Set the preferred preview width.voidsetZoomGestureEnabled(boolean zoomGestureEnabled)voidsetZoomRatio(double zoomRatio)
-
-
-
Method Detail
-
getPreferredPreviewWidth
public int getPreferredPreviewWidth()
-
setPreferredPreviewWidth
public void setPreferredPreviewWidth(int preferredPreviewWidth)
Set the preferred preview width. When trying to find the best preview size, this is used instead of the views width.- Parameters:
preferredPreviewWidth- the desired preview width
-
getPreferredPreviewHeight
public int getPreferredPreviewHeight()
-
setPreferredPreviewHeight
public void setPreferredPreviewHeight(int preferredPreviewHeight)
Set the preferred preview height. When trying to find the best preview size, this is used instead of the views height.- Parameters:
preferredPreviewHeight- the desired preview height
-
getPreferredPictureWidth
public int getPreferredPictureWidth()
-
setPreferredPictureWidth
public void setPreferredPictureWidth(int preferredPictureWidth)
Set the preferred width when taking a full picture. When trying to find the best picture width, this is used instead of the maximum width.- Parameters:
preferredPictureWidth- the desired picture width
-
getPreferredPictureHeight
public int getPreferredPictureHeight()
-
setPreferredPictureHeight
public void setPreferredPictureHeight(int preferredPictureHeight)
Set the preferred height when taking a full picture. When trying to find the best picture height, this is used instead of the maximum height.- Parameters:
preferredPictureHeight- the desired picture height
-
getDefaultLensFacing
public CameraFeatures.LensFacing getDefaultLensFacing()
- Returns:
- the default camera to use for scanning
-
setDefaultLensFacing
public void setDefaultLensFacing(CameraFeatures.LensFacing defaultLensFacing)
Set the default camera used for scanning- Parameters:
defaultLensFacing- the CameraFacing
-
getFallbackLensFacings
public java.util.EnumSet<CameraFeatures.LensFacing> getFallbackLensFacings()
- Returns:
- the fallback CameraFacings
-
setFallbackLensFacings
public void setFallbackLensFacings(java.util.EnumSet<CameraFeatures.LensFacing> fallbackLensFacings)
Set the fallback camera facings which are used if the default camera facing is not available on the device- Parameters:
fallbackLensFacings- the fallback options for CameraFacing
-
isZoomGestureEnabled
public boolean isZoomGestureEnabled()
-
getFocalLength
public double getFocalLength()
-
getMaxZoomRatio
public double getMaxZoomRatio()
-
setZoomGestureEnabled
public void setZoomGestureEnabled(boolean zoomGestureEnabled)
-
setFocalLength
public void setFocalLength(double focalLength)
-
setMaxZoomRatio
public void setMaxZoomRatio(double maxZoomRatio)
-
getZoomRatio
public double getZoomRatio()
-
setZoomRatio
public void setZoomRatio(double zoomRatio)
-
getMaxFocalLength
public double getMaxFocalLength()
-
setMaxFocalLength
public void setMaxFocalLength(double maxFocalLength)
-
-