Class CameraConfig
-
- All Implemented Interfaces:
public class CameraConfig
Class holds configurations for the camera
-
-
Field Summary
Fields Modifier and Type Field Description public int
preferredPreviewWidth
public int
preferredPreviewHeight
public int
preferredPictureWidth
public int
preferredPictureHeight
public CameraFeatures.LensFacing
defaultLensFacing
public EnumSet<CameraFeatures.LensFacing>
fallbackLensFacings
public double
focalLength
public double
zoomRatio
public double
maxZoomRatio
public double
maxFocalLength
-
Constructor Summary
Constructors Constructor Description CameraConfig(JSONObject jsonObject)
Create config from the given json object.
-
Method Summary
Modifier and Type Method Description int
getPreferredPreviewWidth()
void
setPreferredPreviewWidth(int preferredPreviewWidth)
Set the preferred preview width. int
getPreferredPreviewHeight()
void
setPreferredPreviewHeight(int preferredPreviewHeight)
Set the preferred preview height. int
getPreferredPictureWidth()
void
setPreferredPictureWidth(int preferredPictureWidth)
Set the preferred width when taking a full picture. int
getPreferredPictureHeight()
void
setPreferredPictureHeight(int preferredPictureHeight)
Set the preferred height when taking a full picture. CameraFeatures.LensFacing
getDefaultLensFacing()
void
setDefaultLensFacing(CameraFeatures.LensFacing defaultLensFacing)
Set the default camera used for scanning EnumSet<CameraFeatures.LensFacing>
getFallbackLensFacings()
void
setFallbackLensFacings(EnumSet<CameraFeatures.LensFacing> fallbackLensFacings)
Set the fallback camera facings which are used if the default camera facing is not available on the device double
getFocalLength()
void
setFocalLength(double focalLength)
double
getZoomRatio()
void
setZoomRatio(double zoomRatio)
double
getMaxZoomRatio()
void
setMaxZoomRatio(double maxZoomRatio)
double
getMaxFocalLength()
void
setMaxFocalLength(double maxFocalLength)
boolean
isZoomGestureEnabled()
void
setZoomGestureEnabled(boolean zoomGestureEnabled)
-
-
Constructor Detail
-
CameraConfig
CameraConfig(JSONObject jsonObject)
Create config from the given json object.- Parameters:
jsonObject
- the json object with the settings
-
-
Method Detail
-
getPreferredPreviewWidth
int getPreferredPreviewWidth()
-
setPreferredPreviewWidth
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
int getPreferredPreviewHeight()
-
setPreferredPreviewHeight
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
int getPreferredPictureWidth()
-
setPreferredPictureWidth
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
int getPreferredPictureHeight()
-
setPreferredPictureHeight
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
CameraFeatures.LensFacing getDefaultLensFacing()
- Returns:
the default camera to use for scanning
-
setDefaultLensFacing
void setDefaultLensFacing(CameraFeatures.LensFacing defaultLensFacing)
Set the default camera used for scanning
- Parameters:
defaultLensFacing
- the CameraFacing
-
getFallbackLensFacings
EnumSet<CameraFeatures.LensFacing> getFallbackLensFacings()
- Returns:
the fallback CameraFacings
-
setFallbackLensFacings
void setFallbackLensFacings(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
-
getFocalLength
double getFocalLength()
-
setFocalLength
void setFocalLength(double focalLength)
-
getZoomRatio
double getZoomRatio()
-
setZoomRatio
void setZoomRatio(double zoomRatio)
-
getMaxZoomRatio
double getMaxZoomRatio()
-
setMaxZoomRatio
void setMaxZoomRatio(double maxZoomRatio)
-
getMaxFocalLength
double getMaxFocalLength()
-
setMaxFocalLength
void setMaxFocalLength(double maxFocalLength)
-
isZoomGestureEnabled
boolean isZoomGestureEnabled()
-
setZoomGestureEnabled
void setZoomGestureEnabled(boolean zoomGestureEnabled)
-
-
-
-