Skip to content

Commit

Permalink
Merge branch 'QuickCapture-V3' of https://github.com/ExtrieveTechnolo…
Browse files Browse the repository at this point in the history
…gies/QuickCapture_Android into QuickCapture-V3
  • Loading branch information
Amalkarunakaran committed Jun 21, 2023
2 parents 425b1d0 + 6d655eb commit 4b25399
Showing 1 changed file with 55 additions and 50 deletions.
105 changes: 55 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Based on the requirement any one or all classes can be used. And need to import
//OR : can import only required classes as per use cases.
import com.extrieve.quickcapture.sdk.ImgHelper;
import com.extrieve.quickcapture.sdk.CameraHelper;
import com.extrieve.quickcapture.sdk.CameraSupport;
import com.extrieve.quickcapture.sdk.Config;
import com.extrieve.quickcapture.sdk.ImgException;
```
---
Expand All @@ -70,7 +70,7 @@ This class will be implemented as an activity. This class can be ini
```

```java
Intent CameraIntent = new Intent(this,Class.forName("com.extrieve.quickcapture.sdk.CameraHelper")); UriphotoURI = Uri.parse(CameraSupport.CamConfigClass.OutputPath);
Intent CameraIntent = new Intent(this,Class.forName("com.extrieve.quickcapture.sdk.CameraHelper")); UriphotoURI = Uri.parse(Config.CaptureSupport.OutputPath);
this.grantUriPermission(this.getPackageName(),photoURI,Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP) {
CameraIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
Expand All @@ -93,12 +93,13 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable
finishActivity(REQUEST_CODE_FILE_RETURN);
}
```
Camera Helper having a supporting class with static configuration
CameraSupport.CamConfigClass.CamConfigClass : contains various configurations as follows:
SDK included a a supporting class with static configuration - which includes all configurations related to SDK.
- Confg contains a sub configuration collection **CaptureSupport** - contains all the Capture & review related configurations.
Config.CaptureSupport : contains various configurations as follows:

- **OutputPath** - To set the output directory in which the captured images will be saved. Base app should have rights to write to the provided path.
```java
CameraSupport.CamConfigClass.OutputPath = pass output path as string;
Config.CaptureSupport.OutputPath = "pass output path sd string";
```
- **MaxPage** - To set the number of captures to do on each camera session. And this can also control whether the capture mode is single or multi i.e
> if MaxPage <= 0 / not set: means unlimited.If MaxPage >= 1:
Expand All @@ -109,61 +110,35 @@ CameraSupport.CamConfigClass.CamConfigClass : contains various configuration
// MaxPage > 1 : Limited Multi Capture Mode
public static int MaxPage = 0;
```
- **ColorMode** - To Set the capture color mode- supporting color and grayscale.
- **EnableFlash** - Enable Document capture specific flash control for SDK camera.
- **ColorMode** - To Set the capture color mode - supporting color and grayscale.
```java
CameraSupport.CamConfigClass.EnableFlash = true;
Config.CaptureSupport.ColorMode = Config.CaptureSupport.ColorModes.RBG;
//RBG (1) - Use capture flow in color mode.
//GREY (2) - Use capture flow in grey scale mode.
```
- **EnableFlash** - Enable Document capture specific flash control for SDK camera.
```java
Config.CaptureSupport.EnableFlash = true;
```
- **CaptureSound** - To Enable camera capture sound.
```java
CameraSupport.CamConfigClass.CaptureSound = true;
Config.CaptureSupport.CaptureSound = true;
```
- **DeviceInfo** - Will share all general information about the device.
```java
CameraSupport.CamConfigClass.DeviceInfo;
Config.CaptureSupport.DeviceInfo;
```
- **SDKInfo** - Contains all version related information on SDK.
```java
CameraSupport.CamConfigClass.SDKInfo;
Config.CaptureSupport.SDKInfo;
```

- CameraToggle - Toggle camera between front and back.
```java
CameraSupport.CamConfigClass.CameraToggle = 2;
//0-Disable camera toggle option.
//1-Enable camera toggle option with Front camera by default.
//2-Enable camera toggle option with Back camera by default.
```

- **GetTiffForLastCapture** - Build Tiff file output file from last captured set of images.
```java
CameraHelper.GetTiffForLastCapture(outPutFileWithpath);
//on success, will respond with string : "SUCCESS:::TiffFilePath";
//use ":::" char. key to split the response.
//on failure,will respond with string : "FAILED:::Reason for failure";
//use ":::" char. key to split the response.
//on failure, error details can collect from CameraSupport.CamConfigClass.LastLogInfo
```
- **GetPDFForLastCapture** - Build PDF file output file from last captured set of images.
- **CameraToggle** - Toggle camera between front and back.
```java
CameraHelper.GetPDFForLastCapture(outPutFileWithpath);
//on success, will respond with string : "SUCCESS:::PdfFilePath";
//use ":::" char. key to split the response.
//on failure,will respond with string : "FAILED:::Reason for failure";
//use ":::" char. key to split the response.
//on failure, error details can collect from CameraSupport.CamConfigClass.LastLogInfo
```
- **BuildTiff** - Build .tiff file output from the list of images shared.
```java
CameraHelper.BuildTiff(ArrayList<String> ImageCol, String OutputTiffFilePath)
*@param "Image File path collection as ArrayList<String>"
*@return on failure = "FAILED:::REASON" || on success = "SUCCESS:::TIFF file path".
```
- **BuildPDF** - Build PDF file output file from last captured set of images.
```java
CameraHelper.BuildPDF(outPutFileWithpath);
*@param "Image File path collection as ArrayList<String>"
*@return on failure = "FAILED:::REASON" || on success = "SUCCESS:::PDF file path".
Config.CaptureSupport.CameraToggle = CameraToggleType.ENABLE_BACK_DEFAULT;
//DISABLED (0) -Disable camera toggle option.
//ENABLE_BACK_DEFAULT (1) -Enable camera toggle option with Front camera by default.
//ENABLE_FRONT_DEFAULT (2) -Enable camera toggle option with Back camera by default.
```
## ImgHelper
Following are the options/methods available from class **ImgHelper** :
Expand Down Expand Up @@ -217,7 +192,7 @@ ImgHelper ImageHelper = new ImgHelper(this);
- ***CompressToJPEG*** - *This method will Compress the provided bitmap image and will save to given path..*
```java

Boolean Iscompressed = CompressToJPEG(bitmap,outputFilePath);
Boolean Iscompressed = ImageHelper.CompressToJPEG(bitmap,outputFilePath);
/*
Boolean CompressToJPEG(Bitmap bm,String outputFilePath)
throws ImgException
Expand All @@ -228,12 +203,42 @@ ImgHelper ImageHelper = new ImgHelper(this);
- ***rotateBitmap*** - *This method will rotate the image to preferred orientation.*
```java

Bitmap rotatedBm = rotateBitmapDegree(nBm, RotationDegree);
Bitmap rotatedBm = ImageHelper.rotateBitmapDegree(nBm, RotationDegree);
/*
Bitmap rotateBitmapDegree(Bitmap bitmap,int Degree)
throws ImgException
*/
```
```
- **GetTiffForLastCapture** - Build Tiff file output file from last captured set of images.
```java
ImageHelper.GetTiffForLastCapture(outPutFileWithpath);
//on success, will respond with string : "SUCCESS:::TiffFilePath";
//use ":::" char. key to split the response.
//on failure,will respond with string : "FAILED:::Reason for failure";
//use ":::" char. key to split the response.
//on failure, error details can collect from CameraSupport.CamConfigClass.LastLogInfo
```
- **GetPDFForLastCapture** - Build PDF file output file from last captured set of images.
```java
ImageHelper.GetPDFForLastCapture(outPutFileWithpath);
//on success, will respond with string : "SUCCESS:::PdfFilePath";
//use ":::" char. key to split the response.
//on failure,will respond with string : "FAILED:::Reason for failure";
//use ":::" char. key to split the response.
//on failure, error details can collect from CameraSupport.CamConfigClass.LastLogInfo
```
- **BuildTiff** - Build .tiff file output from the list of images shared.
```java
ImageHelper.BuildTiff(ArrayList<String> ImageCol, String OutputTiffFilePath)
*@param "Image File path collection as ArrayList<String>"
*@return on failure = "FAILED:::REASON" || on success = "SUCCESS:::TIFF file path".
```
- **BuildPDF** - Build PDF file output file from last captured set of images.
```java
ImageHelper.BuildPDF(outPutFileWithpath);
*@param "Image File path collection as ArrayList<String>"
*@return on failure = "FAILED:::REASON" || on success = "SUCCESS:::PDF file path".
```

## ImgException
As a part of exceptional error handling **ImgException** class is available.
Expand Down

0 comments on commit 4b25399

Please sign in to comment.