-
-
Notifications
You must be signed in to change notification settings - Fork 80
feat: Manual Focus point #284 #285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
249e7cb
849a5e7
ad2cab4
099491d
0cf0d35
8b5971c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@capacitor-mlkit/barcode-scanning': minor | ||
| --- | ||
|
|
||
| feat: add `setFocusPoint(...)` method |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package io.capawesome.capacitorjs.plugins.mlkit.barcodescanning.classes.options; | ||
|
|
||
| public class SetFocusPointOptions { | ||
|
|
||
| private float x; | ||
| private float y; | ||
|
|
||
| public SetFocusPointOptions(float x, float y) { | ||
| this.x = x; | ||
| this.y = y; | ||
| } | ||
|
|
||
| public float getX() { | ||
| return x; | ||
| } | ||
|
|
||
| public float getY() { | ||
| return y; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /** | ||
| * Copyright (c) 2023 Robin Genz | ||
| */ | ||
| import Foundation | ||
|
|
||
| @objc public class SetFocusPointOptions: NSObject { | ||
| private let x: Float | ||
| private let y: Float | ||
|
|
||
| init(x: Float, y: Float) { | ||
| self.x = x | ||
| self.y = y | ||
| } | ||
|
|
||
| func getX() -> Float { | ||
| return x | ||
| } | ||
|
|
||
| func getY() -> Float { | ||
| return y | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,6 +116,14 @@ export interface BarcodeScannerPlugin { | |
| * @since 5.4.0 | ||
| */ | ||
| getMaxZoomRatio(): Promise<GetMaxZoomRatioResult>; | ||
| /** | ||
| * Set the camera's focus point using normalized coordinates. | ||
| * | ||
| * Only available on Android and iOS. | ||
| * | ||
| * @since 8.0.0 | ||
| */ | ||
| setFocusPoint(options: SetFocusPointOptions): Promise<void>; | ||
| /** | ||
| * Open the settings of the app so that the user can grant the camera permission. | ||
| * | ||
|
|
@@ -382,6 +390,24 @@ export interface GetMaxZoomRatioResult { | |
| zoomRatio: number; | ||
| } | ||
|
|
||
| /** | ||
| * @since 8.0.0 | ||
| */ | ||
| export interface SetFocusPointOptions { | ||
| /** | ||
| * X coordinate (0.0 = left, 1.0 = right) | ||
| * | ||
| * @since 8.0.0 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| */ | ||
| x: number; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's make this property optional and the default value should be 0.5. What do you think? Then we can remove a few checks and exceptions in the native layer.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's a great idea - will do |
||
| /** | ||
| * Y coordinate (0.0 = top, 1.0 = bottom) | ||
| * | ||
| * @since 8.0.0 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| */ | ||
| y: number; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's make this property optional and the default value should be 0.5. What do you think? Then we can remove a few checks and exceptions in the native layer. |
||
| } | ||
|
|
||
| /** | ||
| * @since 5.1.0 | ||
| */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run
npm run docgenagain.