Skip to content

Commit 22dc0cc

Browse files
committed
fix: multiple fixes
1 parent e5dab8e commit 22dc0cc

File tree

7 files changed

+43
-11
lines changed

7 files changed

+43
-11
lines changed

demo-snippets/platforms/android/cpp/DocumentDetector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ vector<vector<cv::Point>> DocumentDetector::scanPoint(Mat &edged) {
7878
double height;
7979
Mat image = resizeImage();
8080
// convert photo to LUV colorspace to avoid glares caused by lights
81-
cvtColor(image, image, COLOR_BGR2Luv);
81+
cvtColor(image, image, COLOR_BGR2GRAY);
8282
if (imageRotation != 0) {
8383
switch (imageRotation) {
8484
case 90:

demo-snippets/platforms/ios/src/DocumentDetector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ vector<vector<cv::Point>> DocumentDetector::scanPoint(Mat &edged) {
7878
double height;
7979
Mat image = resizeImage();
8080
// convert photo to LUV colorspace to avoid glares caused by lights
81-
cvtColor(image, image, COLOR_BGR2Luv);
81+
cvtColor(image, image, COLOR_BGR2GRAY);
8282
if (imageRotation != 0) {
8383
switch (imageRotation) {
8484
case 90:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.nativescript.cameraview">
3-
3+
<uses-permission android:name="android.permission.CAMERA" />
44
</manifest>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"uses": [
3-
"com.akylas.cameraview.ImageAnalysisCallback",
4-
"com.akylas.cameraview.CameraEventListener",
5-
"com.akylas.cameraview.CameraView",
6-
"com.akylas.cameraview.CameraFlashMode"
3+
"com.akylas.cameraview:ImageAnalysisCallback",
4+
"com.akylas.cameraview:CameraEventListener",
5+
"com.akylas.cameraview:CameraView",
6+
"com.akylas.cameraview:CameraFlashMode"
77
]
88
}

src/ui-cameraview/index.android.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class CameraView extends CameraViewBase {
7777
try {
7878
this.notify({ eventName: 'frame', object: this, image, info, processor });
7979
} catch (err) {
80-
console.log('process error', err, err.stack);
80+
console.error('process error', err, err.stack);
8181
}
8282
}
8383
});
@@ -153,12 +153,10 @@ export class CameraView extends CameraViewBase {
153153
return new Promise((resolve, reject) => {
154154
const myListener = {
155155
onCameraPhoto: (file) => {
156-
console.log('onCameraPhoto', file);
157156
removeListener();
158157
resolve(file);
159158
},
160159
onCameraPhotoImage: (image, info, processor) => {
161-
console.log('onCameraPhotoImage', image, info, processor);
162160
removeListener();
163161
resolve({ image, info, processor });
164162
},

src/ui-cameraview/index.d.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
11
import { GridLayout } from '@nativescript/core';
22

3-
export class CameraView extends GridLayout {}
3+
export class CameraView extends GridLayout {
4+
autoFocus: boolean;
5+
processor;
6+
enablePinchZoom: boolean;
7+
saveToGallery: boolean;
8+
flashMode: string;
9+
stopPreview();
10+
startPreview();
11+
toggleCamera();
12+
takePicture(
13+
options: {
14+
savePhotoToDisk?: boolean;
15+
captureMode?: number;
16+
targetRotation?: number;
17+
flashMode?: number;
18+
pictureSize?: { width: number; height: number };
19+
} = {}
20+
): Promise<any>;
21+
startAutoFocus();
22+
focusAtPoint(x, y);
23+
}

src/ui-cameraview/index.ios.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,20 @@ export class CameraView extends CameraViewBase {
108108
this.previewStarted = false;
109109
this.nativeViewProtected?.stopPreview();
110110
}
111+
focusAtPoint(x, y) {
112+
this.nativeViewProtected?.nextLevel?.focusAtAdjustedPointOfInterest(CGPointMake(x, y));
113+
}
114+
async takePicture(
115+
options: {
116+
savePhotoToDisk?: boolean;
117+
captureMode?: number;
118+
targetRotation?: number;
119+
flashMode?: number;
120+
pictureSize?: { width: number; height: number };
121+
} = {}
122+
) {
123+
throw new Error('not implemented');
124+
}
111125

112126
[flashModeProperty.setNative](value: string | number) {
113127
if (typeof value === 'string') {

0 commit comments

Comments
 (0)