Skip to content

Commit

Permalink
fixed pointer error
Browse files Browse the repository at this point in the history
  • Loading branch information
DewiKimC committed Jan 9, 2025
1 parent c6ffab5 commit e264673
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/wrappers/javascript/contourwall.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

import { cv, cvTranslateError } from 'https://deno.land/x/[email protected]/mod.ts';
import { sleep } from "https://deno.land/x/sleep/mod.ts"
import { Mat } from "https://unpkg.com/[email protected]/types/opencv.ts";


export class ContourWall {
private lib
Expand Down Expand Up @@ -42,9 +44,10 @@ export class ContourWall {
);
this.cw_core_ptr = null;
this.baudrate = baudrate


this.pixels = new cv.Mat(40, 60, cv.CV_8UC3);
this.pixels.set([0, 0, 0]);
this.pixels.setTo(new cv.Scalar(0, 0, 0));
}

new(){
Expand Down
5 changes: 4 additions & 1 deletion lib/wrappers/javascript/demo.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { cv, cvTranslateError } from 'https://deno.land/x/[email protected]/mod.ts';
import { Mat } from "https://unpkg.com/[email protected]/types/opencv.ts";
import { ContourWall } from "./contourwall.ts";

const cw = new ContourWall();
Expand All @@ -12,6 +14,7 @@ import { ContourWall } from "./contourwall.ts";
"/dev/cu.usbmodem578E0073651"
);

cw.pixels.set([255, 255, 255]); // Set all pixels to white
cw.pixels.setTo(new cv.Scalar(255, 255, 255)); // Set all pixels to white
cw.show(100);


0 comments on commit e264673

Please sign in to comment.