Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | 4x 4x 4x 4x 5x 5x 5x 3x 2x 2x 6x 5x 3x 2x 3x 2x 3x 2x 2x 216x 214x | import { CppObject } from './CppObject';
import { Image } from './Image';
import { getInstance } from './instance';
import { Symbol } from './Symbol';
import { ZBarSymbolType, ZBarConfigType } from './enum';
export class ImageScanner extends CppObject {
static async create(): Promise<ImageScanner> {
const inst = await getInstance();
const ptr = inst.ImageScanner_create();
return new this(ptr, inst);
}
destory(): void {
this.checkAlive();
this.inst.ImageScanner_destory(this.ptr);
this.ptr = 0;
}
setConfig(sym: ZBarSymbolType, conf: ZBarConfigType, value: number): number {
this.checkAlive();
return this.inst.ImageScanner_set_config(this.ptr, sym, conf, value);
}
enableCache(enable: boolean = true): void {
this.checkAlive();
this.inst.ImageScanner_enable_cache(this.ptr, enable);
}
recycleImage(image: Image): void {
this.checkAlive();
this.inst.ImageScanner_recycle_image(this.ptr, image.getPointer());
}
getResults(): Array<Symbol> {
this.checkAlive();
const res = this.inst.ImageScanner_get_results(this.ptr);
return Symbol.createSymbolsFromPtr(res, this.inst.memory.buffer);
}
scan(image: Image): number {
this.checkAlive();
return this.inst.ImageScanner_scan(this.ptr, image.getPointer());
}
}
|