Class CameraConfig
-
- All Implemented Interfaces:
public class CameraConfigClass holds configurations for the camera
-
-
Field Summary
Fields Modifier and Type Field Description public intpreferredPreviewWidthpublic intpreferredPreviewHeightpublic intpreferredPictureWidthpublic intpreferredPictureHeightpublic CameraFeatures.LensFacingdefaultLensFacingpublic EnumSet<CameraFeatures.LensFacing>fallbackLensFacingspublic doublefocalLengthpublic doublezoomRatiopublic doublemaxZoomRatiopublic doublemaxFocalLength
-
Constructor Summary
Constructors Constructor Description CameraConfig(JSONObject jsonObject)Create config from the given json object.
-
Method Summary
Modifier and Type Method Description intgetPreferredPreviewWidth()voidsetPreferredPreviewWidth(int preferredPreviewWidth)Set the preferred preview width. intgetPreferredPreviewHeight()voidsetPreferredPreviewHeight(int preferredPreviewHeight)Set the preferred preview height. intgetPreferredPictureWidth()voidsetPreferredPictureWidth(int preferredPictureWidth)Set the preferred width when taking a full picture. intgetPreferredPictureHeight()voidsetPreferredPictureHeight(int preferredPictureHeight)Set the preferred height when taking a full picture. CameraFeatures.LensFacinggetDefaultLensFacing()voidsetDefaultLensFacing(CameraFeatures.LensFacing defaultLensFacing)Set the default camera used for scanning EnumSet<CameraFeatures.LensFacing>getFallbackLensFacings()voidsetFallbackLensFacings(EnumSet<CameraFeatures.LensFacing> fallbackLensFacings)Set the fallback camera facings which are used if the default camera facing is not available on the device doublegetFocalLength()voidsetFocalLength(double focalLength)doublegetZoomRatio()voidsetZoomRatio(double zoomRatio)doublegetMaxZoomRatio()voidsetMaxZoomRatio(double maxZoomRatio)doublegetMaxFocalLength()voidsetMaxFocalLength(double maxFocalLength)booleanisZoomGestureEnabled()voidsetZoomGestureEnabled(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)
-
-
-
-