Package io.anyline2.view
Class CameraConfig
- java.lang.Object
-
- io.anyline2.view.CameraConfig
-
public class CameraConfig extends java.lang.Object
Class 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.LensFacing
getDefaultLensFacing()
java.util.EnumSet<CameraFeatures.LensFacing>
getFallbackLensFacings()
double
getFocalLength()
double
getMaxFocalLength()
double
getMaxZoomRatio()
int
getPreferredPictureHeight()
int
getPreferredPictureWidth()
int
getPreferredPreviewHeight()
int
getPreferredPreviewWidth()
double
getZoomRatio()
boolean
isZoomGestureEnabled()
void
setDefaultLensFacing(CameraFeatures.LensFacing defaultLensFacing)
Set the default camera used for scanningvoid
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 devicevoid
setFocalLength(double focalLength)
void
setMaxFocalLength(double maxFocalLength)
void
setMaxZoomRatio(double maxZoomRatio)
void
setPreferredPictureHeight(int preferredPictureHeight)
Set the preferred height when taking a full picture.void
setPreferredPictureWidth(int preferredPictureWidth)
Set the preferred width when taking a full picture.void
setPreferredPreviewHeight(int preferredPreviewHeight)
Set the preferred preview height.void
setPreferredPreviewWidth(int preferredPreviewWidth)
Set the preferred preview width.void
setZoomGestureEnabled(boolean zoomGestureEnabled)
void
setZoomRatio(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)
-
-