Skip to content
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

Add memorization to the bitMatrix class & return the transformation #153

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dist/BitMatrix.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export declare class BitMatrix {
static createEmpty(width: number, height: number): BitMatrix;
static createEmpty(width: number, height: number): any;
private static Memo;
width: number;
height: number;
private data;
Expand Down
9 changes: 2 additions & 7 deletions dist/binarizer/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import { BitMatrix } from "../BitMatrix";
export declare function binarize(data: Uint8ClampedArray, width: number, height: number, returnInverted: boolean): {
binarized: BitMatrix;
inverted: BitMatrix;
} | {
binarized: BitMatrix;
inverted?: undefined;
export declare function binarize(data: Uint8ClampedArray, width: number, height: number): {
binarized: any;
};
2 changes: 1 addition & 1 deletion dist/decoder/decodeData/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export declare enum Mode {
Alphanumeric = "alphanumeric",
Byte = "byte",
Kanji = "kanji",
ECI = "eci",
ECI = "eci"
}
export declare function decode(data: Uint8ClampedArray, version: number): DecodedQR;
15 changes: 14 additions & 1 deletion dist/extractor/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import { BitMatrix } from "../BitMatrix";
import { QRLocation } from "../locator";
interface PerspectiveTransform {
a11: number;
a21: number;
a31: number;
a12: number;
a22: number;
a32: number;
a13: number;
a23: number;
a33: number;
}
export declare function extract(image: BitMatrix, location: QRLocation): {
matrix: BitMatrix;
matrix: any;
transform: PerspectiveTransform;
mappingFunction: (x: number, y: number) => {
x: number;
y: number;
};
};
export {};
6 changes: 2 additions & 4 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface QRCode {
binaryData: number[];
data: string;
chunks: Chunks;
transform: any;
location: {
topRightCorner: Point;
topLeftCorner: Point;
Expand All @@ -15,8 +16,5 @@ export interface QRCode {
bottomRightAlignmentPattern?: Point;
};
}
export interface Options {
inversionAttempts?: "dontInvert" | "onlyInvert" | "attemptBoth" | "invertFirst";
}
declare function jsQR(data: Uint8ClampedArray, width: number, height: number, providedOptions?: Options): QRCode | null;
declare function jsQR(data: Uint8ClampedArray, width: number, height: number): QRCode | null;
export default jsQR;
Loading