jsqr
Advanced tools
Comparing version 1.1.1 to 1.2.0
import { BitMatrix } from "../BitMatrix"; | ||
export declare function binarize(data: Uint8ClampedArray, width: number, height: number): BitMatrix; | ||
export declare function binarize(data: Uint8ClampedArray, width: number, height: number, returnInverted: boolean): { | ||
binarized: BitMatrix; | ||
inverted: BitMatrix; | ||
} | { | ||
binarized: BitMatrix; | ||
inverted?: undefined; | ||
}; |
@@ -10,3 +10,2 @@ export declare class BitMatrix { | ||
setRegion(left: number, top: number, width: number, height: number, v: boolean): void; | ||
getInverted(): BitMatrix; | ||
} |
@@ -18,3 +18,6 @@ import { Chunks } from "./decoder/decodeData"; | ||
} | ||
declare function jsQR(data: Uint8ClampedArray, width: number, height: number): QRCode | null; | ||
export interface Options { | ||
inversionAttempts?: "dontInvert" | "onlyInvert" | "attemptBoth" | "invertFirst"; | ||
} | ||
declare function jsQR(data: Uint8ClampedArray, width: number, height: number, providedOptions?: Options): QRCode | null; | ||
export default jsQR; |
{ | ||
"name": "jsqr", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "A pure javascript QR code reading library that takes in raw images and will locate, extract and parse any QR code found within.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/cozmo/jsQR", |
@@ -49,6 +49,6 @@ # jsQR | ||
jsQR exports a method that takes in 3 arguments representing the image data you wish to decode. | ||
jsQR exports a method that takes in 3 arguments representing the image data you wish to decode. Additionally can take an options object to further configure scanning behavior. | ||
```javascript | ||
const code = jsQR(imageData, width, height); | ||
const code = jsQR(imageData, width, height, options?); | ||
@@ -65,3 +65,5 @@ if (code) { | ||
- `width` - The width of the image you wish to decode. | ||
- `height` The height of the image you wish to decode. | ||
- `height` - The height of the image you wish to decode. | ||
- `options` (optional) - Additional options. | ||
- `inversionAttempts` - (`attemptBoth` (default), `dontInvert`, `onlyInvert`, or `invertFirst`) - Should jsQR attempt to invert the image to find QR codes with white modules on black backgrounds instead of the black modules on white background. This option defaults to `attemptBoth` for backwards compatibility but causes a ~50% performance hit, and will probably be default to `dontInvert` in future versions. | ||
@@ -68,0 +70,0 @@ ### Return value |
Sorry, the diff of this file is too big to display
276305
10136
106