qr 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/decode.d.ts DELETED
@@ -1,62 +0,0 @@
1
- /*!
2
- Copyright (c) 2023 Paul Miller (paulmillr.com)
3
- The library paulmillr-qr is dual-licensed under the Apache 2.0 OR MIT license.
4
- You can select a license of your choice.
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
- */
17
- /**
18
- * Methods for decoding (reading) QR code patterns.
19
- * @module
20
- * @example
21
- ```js
22
-
23
- ```
24
- */
25
- import type { Image, Point } from './index.ts';
26
- import { Bitmap } from './index.ts';
27
- export type FinderPoints = [Pattern, Pattern, Point, Pattern];
28
- /**
29
- * Convert to grayscale. The function is the most expensive part of decoding:
30
- * it takes up to 90% of time. TODO: check gamma correction / sqr.
31
- */
32
- declare function toBitmap(img: Image): Bitmap;
33
- type Pattern = Point & {
34
- moduleSize: number;
35
- count: number;
36
- };
37
- declare function findFinder(b: Bitmap): {
38
- bl: Pattern;
39
- tl: Pattern;
40
- tr: Pattern;
41
- };
42
- declare function detect(b: Bitmap): {
43
- bits: Bitmap;
44
- points: FinderPoints;
45
- };
46
- declare function decodeBitmap(b: Bitmap): string;
47
- export type DecodeOpts = {
48
- cropToSquare?: boolean;
49
- pointsOnDetect?: (points: FinderPoints) => void;
50
- imageOnBitmap?: (img: Image) => void;
51
- imageOnDetect?: (img: Image) => void;
52
- imageOnResult?: (img: Image) => void;
53
- };
54
- export declare function decodeQR(img: Image, opts?: DecodeOpts): string;
55
- export default decodeQR;
56
- export declare const _tests: {
57
- toBitmap: typeof toBitmap;
58
- decodeBitmap: typeof decodeBitmap;
59
- findFinder: typeof findFinder;
60
- detect: typeof detect;
61
- };
62
- //# sourceMappingURL=decode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../src/decode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;EAeE;AACF;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAiC,KAAK,EAAQ,KAAK,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,MAAM,EAAS,MAAM,YAAY,CAAC;AAgB3C,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AA2B9D;;;GAGG;AACH,iBAAS,QAAQ,CAAC,GAAG,EAAE,KAAK,GAAG,MAAM,CAwEpC;AAGD,KAAK,OAAO,GAAG,KAAK,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AA6I7D,iBAAS,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,OAAO,CAAC;CACb,CA8HA;AAoHD,iBAAS,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;CACtB,CAkDA;AAyJD,iBAAS,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAgFvC;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAChD,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,K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