v2.0.0
💥 Breaking Changes
Unify methods setFaceNumberOfImages
and setFrameNumberOfImages
into setNumberOfImages
:
- Changed for better understanding and usage;
- The number of images is used to capture face and frame;
- The number of images value "0" still capture unlimited number of images;
- Add validation: the number of images value can not be negative;
Unify methods setFaceTimeBetweenImages
and setFrameTimeBetweenImages
into setTimeBetweenImages
;
- Changed for better understanding and usage simplification;
- The time between of images is used to capture face and frame;
- The time between of images value is still in milliseconds;
- Add validation: the time between of images value can not be negative;
Split methods setFaceImageSize
in setOutputImageWidth
and setOutputImageHeight
;
- Changed for better understanding;
- Add validation: the output image width value can not be negative;
- Add validation: the output image height value can not be negative;
Unify events onFaceImageCreated
and onFrameImageCreated
into onImageCaptured
;
- Changed for better understanding and usage simplification;
- The number of images is used to capture face and frame;
- The event is used when a face or frame image is saved;
Refactor face region of interest inputs into four new methods:
- Remove method
setFaceROIOffset
; - Add new method
setFaceROITopOffset
; - Add new method
setFaceROIRightOffset
; - Add new method
setFaceROIBottomOffset
; - Add new method
setFaceROILeftOffset
;
Some others changes:
- Change event name from
onBarcodeScanned
toonQRCodeScanned
; - Change method name from
setFaceSaveImages
tosetSaveImageCaptured
; - Change method
startCaptureType
input from "barcode" to "qrcode";
✨ New Feature
Now the component accepts props. Internally the component call the functions related and delegate if necessary.
Props | Function Called |
---|---|
initialLens |
setLens |
captureType |
startCapture |
numberOfImages |
setNumberOfImages |
timeBetweenImages |
setTimeBetweenImages |
outputImageWidth |
setOutputImageWidth |
outputImageHeight |
setOutputImageHeight |
faceMinSize |
setFaceCaptureMinSize |
faceMaxSize |
setFaceCaptureMaxSize |
faceDetectionBox |
setFaceDetectionBox |
saveImageCaptured |
setSaveImageCaptured |
faceROI |
setFaceROIEnable |
faceROITopOffset |
setFaceROITopOffset |
faceROIRightOffset |
setFaceROIRightOffset |
faceROIBottomOffset |
setFaceROIBottomOffset |
faceROILeftOffset |
setFaceROILeftOffset |
faceROIMinSize |
setFaceROIMinSize |
🥅 Catch Errors
Add validation when inputing value in the following methods:
startCapture
: Valid values "none", "face", "frame" and "qrcode";setLens
: Valid values "front" and "back";setNumberOfImages
: Value can not be negative;setTimeBetweenImages
: Value can not be negative;setOutputImageWidth
: Format must be "NNpx";setOutputImageHeight
: Format must be "NNpx";setFacePaddingPercent
: Format must be "NN%";setFaceCaptureMinSize
: Format must be "NN%";setFaceCaptureMaxSize
: Format must be "NN%";setFaceDetectionBox
: Must be a boolean;setSaveImageCaptured
: Must be a boolean;setFaceROIEnable
: Must be a boolean;setFaceROITopOffset
: Format must be "NN%";setFaceROIRightOffset
: Format must be "NN%";setFaceROIBottomOffset
: Format must be "NN%";setFaceROILeftOffset
: Format must be "NN%";setFaceROIMinSize
: Value must be between 0 and 1;
🏗️ Architectural Changes
With the new ios-yoonit-camera
version 2.0.2
it is possible to use iOS functions like Android.
That means all the native functions implementations in Yoonit.Camera.android.ts
and Yoonit.Camera.ios.ts
moved to the Yoonit.Camera.common.ts
.
- No more duplicated (android & ios) native functions implementations maintenance;
- No more duplicated (android & ios) native functions code review;
- Reduce many (many, many...) lines of codes;
📝 Update Readme
- Add new method
setNumberOfImages
definition; - Add new method
setTimeBetweenImages
definition; - Add new method
setOutputImageHeight
definition; - Add new method
onImageCaptured
definition; - Add new method
setFaceROITopOffset
; - Add new method
setFaceROIRightOffset
; - Add new method
setFaceROIBottomOffset
; - Add new method
setFaceROILeftOffset
; - Add new event
onQRCodeScanned
definition; - Remove event
onFaceImageCreated
definition; - Remove event
onFrameImageCreated
definition; - Remove method
setFaceROIOffset
;
Add new section, the Props:
Props | Input/Format | Default value | Description |
---|---|---|---|
initialLens |
`"front" | "back"` | "front" |
captureType |
`"none" | "front" | "frame" |
numberOfImages |
number | 0 |
The number of images to be captured. |
timeBetweenImages |
number | 1000 |
The time interval in milliseconds to capture between images. |
outputImageWidth |
NNpx |
"200px" |
The output image width in pixels to be captured. |
outputImageHeight |
NNpx |
"200px" |
The output image height in pixels to be captured. |
faceMinSize |
NN% |
"0%" |
The face minimum size percentage to be captured. |
faceMaxSize |
NN% |
"100%" |
The face maximum size percentage to be captured. |
faceDetectionBox |
boolean | false |
The indicator to show/hide the face detection box. |
saveImageCaptured |
boolean | false |
The indicator to enable/disabled when an image captured. |
faceROI |
boolean | false |
The indicator to enable.disable the region of interest. |
faceROITopOffset |
NN% |
"0%" |
The "top" offset percentage region of interest. |
faceROIRightOffset |
NN% |
"0%" |
The "right" offset percentage region of interest. |
faceROIBottomOffset |
NN% |
"0%" |
The "bottom" offset percentage region of interest. |
faceROILeftOffset |
NN% |
"0%" |
The "left" offset percentage region of interest. |
faceROIMinSize |
NN% |
"0%" |
The minimum face related with the ROI. |
⬆️ Upgrade Dependencies
- android-yoonit-camera update from
1.5.0
to2.0.2
; - ios-yoonit-camera update from
1.6.0
to2.0.2
;
➕ New Dependencies
- Add new dependency:
reflect-metadata
version^0.1.13
. Used to implement decorators.