This PR intends to make the example using face detection more accurate.
It should give an idea on how to position elements on top of specific points of the preview.
It needs to be tested on iOS @dim-apparence
Checklist
Before creating any Pull Request, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
CameraAwesomeBuilder and AwesomeCameraPreview now include a PreviewDecoratorBuilder:
typedef PreviewDecoratorBuilder = Widget Function(
CameraState state,
PreviewSize previewSize,
/// [previewRect] might be clipped (especially in Ratio 1:1)
Rect previewRect,
);
It is especially useful for drawing elements on top of the preview. With previewRect, one can get exactly the rect of the camera preview and its previewSize (not clipped) for positioning a point calculated through the image analysis.
In the example, it is used to draw outline of a face when one is detected.
I included this builder in the awesome builder as well as in the custom since both can use image analysis (and that's where it will be mainly used).
Description
This PR intends to make the example using face detection more accurate. It should give an idea on how to position elements on top of specific points of the preview.
It needs to be tested on iOS @dim-apparence
Checklist
Before creating any Pull Request, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
).flutter analyze
without any issues.Breaking Change
CameraAwesomeBuilder and AwesomeCameraPreview now include a
PreviewDecoratorBuilder
:It is especially useful for drawing elements on top of the preview. With
previewRect
, one can get exactly the rect of the camera preview and itspreviewSize
(not clipped) for positioning a point calculated through the image analysis. In the example, it is used to draw outline of a face when one is detected.I included this builder in the awesome builder as well as in the custom since both can use image analysis (and that's where it will be mainly used).