@qr-platform/qr-code.js 0.8.17
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/.github/workflows/publish.yml +18 -0
- package/CHANGELOG.md +233 -0
- package/LICENSE.md +77 -0
- package/README.md +188 -0
- package/docs/advanced-examples.md +523 -0
- package/docs/api-reference-guide.md +254 -0
- package/docs/documentation.md +1592 -0
- package/docs/examples.md +322 -0
- package/docs/license-management.md +501 -0
- package/docs/typescript-types-definitions.md +372 -0
- package/docs/usage-guide.md +622 -0
- package/lib/core/qr-code-js.d.ts +48 -0
- package/lib/core/qr-constant.d.ts +9 -0
- package/lib/core/qr-options-validation.d.ts +13 -0
- package/lib/core/qr-svg.d.ts +76 -0
- package/lib/core/qr-templates.d.ts +6 -0
- package/lib/figures/corner-dot.d.ts +24 -0
- package/lib/figures/corner-square.d.ts +24 -0
- package/lib/figures/dot.d.ts +31 -0
- package/lib/index.d.ts +52 -0
- package/lib/lib/image/GIFImage.d.ts +19 -0
- package/lib/lib/io/Base64.d.ts +10 -0
- package/lib/lib/io/Base64DecodeInputStream.d.ts +15 -0
- package/lib/lib/io/Base64EncodeOutputStream.d.ts +17 -0
- package/lib/lib/io/ByteArrayInputStream.d.ts +12 -0
- package/lib/lib/io/ByteArrayOutputStream.d.ts +12 -0
- package/lib/lib/io/InputStream.d.ts +10 -0
- package/lib/lib/io/OutputStream.d.ts +12 -0
- package/lib/lib/qr-code.d.ts +5 -0
- package/lib/lib/qrcode/BitBuffer.d.ts +11 -0
- package/lib/lib/qrcode/ErrorCorrectLevel.d.ts +23 -0
- package/lib/lib/qrcode/MaskPattern.d.ts +39 -0
- package/lib/lib/qrcode/Mode.d.ts +23 -0
- package/lib/lib/qrcode/Polynomial.d.ts +15 -0
- package/lib/lib/qrcode/QR8BitByte.d.ts +13 -0
- package/lib/lib/qrcode/QRAlphaNum.d.ts +13 -0
- package/lib/lib/qrcode/QRCode.d.ts +22 -0
- package/lib/lib/qrcode/QRCodeMinimal.d.ts +58 -0
- package/lib/lib/qrcode/QRData.d.ts +17 -0
- package/lib/lib/qrcode/QRKanji.d.ts +13 -0
- package/lib/lib/qrcode/QRMath.d.ts +13 -0
- package/lib/lib/qrcode/QRNumber.d.ts +14 -0
- package/lib/lib/qrcode/QRUtil.d.ts +25 -0
- package/lib/lib/qrcode/RSBlock.d.ts +16 -0
- package/lib/lib/text/createStringToBytes.d.ts +9 -0
- package/lib/lib/text/stringToBytes_SJIS.d.ts +8 -0
- package/lib/lib/text/stringToBytes_UTF8.d.ts +7 -0
- package/lib/lib/zbar-wasm/index.d.ts +1 -0
- package/lib/lib/zxing-js/src/browser/BrowserCodeReader.d.ts +410 -0
- package/lib/lib/zxing-js/src/browser/BrowserQRCodeReader.d.ts +29 -0
- package/lib/lib/zxing-js/src/browser/BrowserQRCodeSvgWriter.d.ts +46 -0
- package/lib/lib/zxing-js/src/browser/BrowserSvgCodeWriter.d.ts +49 -0
- package/lib/lib/zxing-js/src/browser/DecodeContinuouslyCallback.d.ts +6 -0
- package/lib/lib/zxing-js/src/browser/HTMLCanvasElementLuminanceSource.d.ts +27 -0
- package/lib/lib/zxing-js/src/browser/HTMLVisualMediaElement.d.ts +4 -0
- package/lib/lib/zxing-js/src/browser/VideoInputDevice.d.ts +22 -0
- package/lib/lib/zxing-js/src/browser.d.ts +3 -0
- package/lib/lib/zxing-js/src/core/ArgumentException.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/ArithmeticException.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/ArrayIndexOutOfBoundsException.d.ts +10 -0
- package/lib/lib/zxing-js/src/core/BarcodeFormat.d.ts +42 -0
- package/lib/lib/zxing-js/src/core/Binarizer.d.ts +53 -0
- package/lib/lib/zxing-js/src/core/BinaryBitmap.d.ts +78 -0
- package/lib/lib/zxing-js/src/core/ChecksumException.d.ts +8 -0
- package/lib/lib/zxing-js/src/core/DecodeHintType.d.ts +91 -0
- package/lib/lib/zxing-js/src/core/Dimension.d.ts +13 -0
- package/lib/lib/zxing-js/src/core/EncodeHintType.d.ts +99 -0
- package/lib/lib/zxing-js/src/core/Exception.d.ts +17 -0
- package/lib/lib/zxing-js/src/core/FormatException.d.ts +8 -0
- package/lib/lib/zxing-js/src/core/HighContrastLuminanceSource.d.ts +27 -0
- package/lib/lib/zxing-js/src/core/IllegalArgumentException.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/IllegalStateException.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/IndexOutOfBoundsException.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/InvertedLuminanceSource.d.ts +22 -0
- package/lib/lib/zxing-js/src/core/LuminanceSource.d.ts +84 -0
- package/lib/lib/zxing-js/src/core/NodeLuminanceSource.d.ts +36 -0
- package/lib/lib/zxing-js/src/core/NotFoundException.d.ts +8 -0
- package/lib/lib/zxing-js/src/core/NullPointerException.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/OutOfMemoryError.d.ts +6 -0
- package/lib/lib/zxing-js/src/core/PlanarYUVLuminanceSource.d.ts +35 -0
- package/lib/lib/zxing-js/src/core/RGBLuminanceSource.d.ts +21 -0
- package/lib/lib/zxing-js/src/core/Reader.d.ts +49 -0
- package/lib/lib/zxing-js/src/core/ReaderException.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/ReedSolomonException.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/Result.d.ts +52 -0
- package/lib/lib/zxing-js/src/core/ResultMetadataType.d.ts +68 -0
- package/lib/lib/zxing-js/src/core/ResultPoint.d.ts +34 -0
- package/lib/lib/zxing-js/src/core/ResultPointCallback.d.ts +11 -0
- package/lib/lib/zxing-js/src/core/UniversalLuminanceSource.d.ts +46 -0
- package/lib/lib/zxing-js/src/core/UnsupportedOperationException.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/Writer.d.ts +30 -0
- package/lib/lib/zxing-js/src/core/WriterException.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/common/BitArray.d.ts +111 -0
- package/lib/lib/zxing-js/src/core/common/BitMatrix.d.ts +98 -0
- package/lib/lib/zxing-js/src/core/common/BitSource.d.ts +38 -0
- package/lib/lib/zxing-js/src/core/common/CharacterSetECI.d.ts +89 -0
- package/lib/lib/zxing-js/src/core/common/DecoderResult.d.ts +64 -0
- package/lib/lib/zxing-js/src/core/common/DefaultGridSampler.d.ts +10 -0
- package/lib/lib/zxing-js/src/core/common/DetectorResult.d.ts +16 -0
- package/lib/lib/zxing-js/src/core/common/ECIEncoderSet.d.ts +37 -0
- package/lib/lib/zxing-js/src/core/common/ECIInput.d.ts +79 -0
- package/lib/lib/zxing-js/src/core/common/GlobalHistogramBinarizer.d.ts +29 -0
- package/lib/lib/zxing-js/src/core/common/GridSampler.d.ts +36 -0
- package/lib/lib/zxing-js/src/core/common/GridSamplerInstance.d.ts +18 -0
- package/lib/lib/zxing-js/src/core/common/HybridBinarizer.d.ts +54 -0
- package/lib/lib/zxing-js/src/core/common/MinimalECIInput.d.ts +123 -0
- package/lib/lib/zxing-js/src/core/common/PerspectiveTransform.d.ts +26 -0
- package/lib/lib/zxing-js/src/core/common/StringUtils.d.ts +48 -0
- package/lib/lib/zxing-js/src/core/common/detector/CornerDetector.d.ts +35 -0
- package/lib/lib/zxing-js/src/core/common/detector/MathUtils.d.ts +36 -0
- package/lib/lib/zxing-js/src/core/common/detector/WhiteRectangleDetector.d.ts +71 -0
- package/lib/lib/zxing-js/src/core/common/reedsolomon/AbstractGenericGF.d.ts +34 -0
- package/lib/lib/zxing-js/src/core/common/reedsolomon/AbstractGenericGFPoly.d.ts +36 -0
- package/lib/lib/zxing-js/src/core/common/reedsolomon/GenericGF.d.ts +58 -0
- package/lib/lib/zxing-js/src/core/common/reedsolomon/GenericGFPoly.d.ts +47 -0
- package/lib/lib/zxing-js/src/core/common/reedsolomon/ReedSolomonDecoder.d.ts +40 -0
- package/lib/lib/zxing-js/src/core/common/reedsolomon/ReedSolomonEncoder.d.ts +41 -0
- package/lib/lib/zxing-js/src/core/qrcode/QRCodeReader.d.ts +35 -0
- package/lib/lib/zxing-js/src/core/qrcode/QRCodeWriter.d.ts +13 -0
- package/lib/lib/zxing-js/src/core/qrcode/decoder/BitMatrixParser.d.ts +58 -0
- package/lib/lib/zxing-js/src/core/qrcode/decoder/DataBlock.d.ts +28 -0
- package/lib/lib/zxing-js/src/core/qrcode/decoder/DataMask.d.ts +36 -0
- package/lib/lib/zxing-js/src/core/qrcode/decoder/DecodedBitStreamParser.d.ts +30 -0
- package/lib/lib/zxing-js/src/core/qrcode/decoder/Decoder.d.ts +44 -0
- package/lib/lib/zxing-js/src/core/qrcode/decoder/ECB.d.ts +12 -0
- package/lib/lib/zxing-js/src/core/qrcode/decoder/ECBlocks.d.ts +16 -0
- package/lib/lib/zxing-js/src/core/qrcode/decoder/ErrorCorrectionLevel.d.ts +38 -0
- package/lib/lib/zxing-js/src/core/qrcode/decoder/FormatInformation.d.ts +33 -0
- package/lib/lib/zxing-js/src/core/qrcode/decoder/Mode.d.ts +56 -0
- package/lib/lib/zxing-js/src/core/qrcode/decoder/QRCodeDecoderMetaData.d.ts +21 -0
- package/lib/lib/zxing-js/src/core/qrcode/decoder/Version.d.ts +44 -0
- package/lib/lib/zxing-js/src/core/qrcode/detector/AlignmentPattern.d.ts +21 -0
- package/lib/lib/zxing-js/src/core/qrcode/detector/AlignmentPatternFinder.d.ts +82 -0
- package/lib/lib/zxing-js/src/core/qrcode/detector/Detector.d.ts +87 -0
- package/lib/lib/zxing-js/src/core/qrcode/detector/FinderPattern.d.ts +26 -0
- package/lib/lib/zxing-js/src/core/qrcode/detector/FinderPatternFinder.d.ts +114 -0
- package/lib/lib/zxing-js/src/core/qrcode/detector/FinderPatternInfo.d.ts +16 -0
- package/lib/lib/zxing-js/src/core/qrcode/encoder/BlockPair.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/qrcode/encoder/ByteMatrix.d.ts +24 -0
- package/lib/lib/zxing-js/src/core/qrcode/encoder/Encoder.d.ts +85 -0
- package/lib/lib/zxing-js/src/core/qrcode/encoder/MaskUtil.d.ts +47 -0
- package/lib/lib/zxing-js/src/core/qrcode/encoder/MatrixUtil.d.ts +37 -0
- package/lib/lib/zxing-js/src/core/qrcode/encoder/QRCode.d.ts +29 -0
- package/lib/lib/zxing-js/src/core/util/Arrays.d.ts +45 -0
- package/lib/lib/zxing-js/src/core/util/ByteArrayOutputStream.d.ts +174 -0
- package/lib/lib/zxing-js/src/core/util/Charset.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/util/Collections.d.ts +11 -0
- package/lib/lib/zxing-js/src/core/util/Float.d.ts +14 -0
- package/lib/lib/zxing-js/src/core/util/Formatter.d.ts +28 -0
- package/lib/lib/zxing-js/src/core/util/Integer.d.ts +19 -0
- package/lib/lib/zxing-js/src/core/util/Long.d.ts +12 -0
- package/lib/lib/zxing-js/src/core/util/OutputStream.d.ts +106 -0
- package/lib/lib/zxing-js/src/core/util/StandardCharsets.d.ts +7 -0
- package/lib/lib/zxing-js/src/core/util/StringBuilder.d.ts +21 -0
- package/lib/lib/zxing-js/src/core/util/StringEncoding.d.ts +51 -0
- package/lib/lib/zxing-js/src/core/util/System.d.ts +10 -0
- package/lib/lib/zxing-js/src/customTypings.d.ts +16 -0
- package/lib/lib/zxing-js/src/index.d.ts +5 -0
- package/lib/lib/zxing-js/src/node.d.ts +1 -0
- package/lib/license/LicenseManager.d.ts +69 -0
- package/lib/license/LicenseManagerNode.d.ts +64 -0
- package/lib/node.d.ts +37 -0
- package/lib/options-demo.d.ts +239 -0
- package/lib/plugins/QRBorderHelpers.d.ts +32 -0
- package/lib/plugins/QRBorderPlugin.d.ts +35 -0
- package/lib/plugins/QRValidatorZbar.d.ts +38 -0
- package/lib/plugins/QRValidatorZbarNode.d.ts +60 -0
- package/lib/plugins/QRValidatorZbarNodeSharp.d.ts +83 -0
- package/lib/qr-code-js-node.js +1 -0
- package/lib/qr-code-js.js +1 -0
- package/lib/templates/borders-inner-outter.d.ts +129 -0
- package/lib/templates/borders-inner-scale-offset.d.ts +497 -0
- package/lib/templates/borders-inner.d.ts +129 -0
- package/lib/templates/borders-no-license.d.ts +129 -0
- package/lib/templates/borders-outter.d.ts +129 -0
- package/lib/templates/borders-text-auto-curved.d.ts +129 -0
- package/lib/templates/borders-text-full-curved.d.ts +133 -0
- package/lib/templates/borders.d.ts +129 -0
- package/lib/templates/scales.d.ts +130 -0
- package/lib/templates/scan-validators/index.d.ts +1 -0
- package/lib/templates/scan-validators/tests/cases/basic-inverted.d.ts +9 -0
- package/lib/templates/scan-validators/tests/cases/basic-no-license.d.ts +3 -0
- package/lib/templates/scan-validators/tests/cases/basic.d.ts +3 -0
- package/lib/templates/scan-validators/tests/cases/colors-inverted.d.ts +2 -0
- package/lib/templates/scan-validators/tests/cases/colors.d.ts +58 -0
- package/lib/templates/scan-validators/tests/cases/out-of-borders-inverted.d.ts +9 -0
- package/lib/templates/scan-validators/tests/cases/out-of-borders.d.ts +9 -0
- package/lib/templates/scan-validators/tests/cases/position-inverted.d.ts +9 -0
- package/lib/templates/scan-validators/tests/cases/position.d.ts +3 -0
- package/lib/templates/scan-validators/tests/index.d.ts +27 -0
- package/lib/tools/browser-image-tools.d.ts +7 -0
- package/lib/tools/browser-utils.d.ts +18 -0
- package/lib/types/helper.d.ts +23 -0
- package/lib/utils/canvas-options.d.ts +7 -0
- package/lib/utils/color.d.ts +4 -0
- package/lib/utils/gradient.d.ts +26 -0
- package/lib/utils/image.d.ts +16 -0
- package/lib/utils/merge.d.ts +5 -0
- package/lib/utils/options.d.ts +220 -0
- package/lib/utils/qrcode.d.ts +8 -0
- package/lib/utils/scan-validator-node.d.ts +15 -0
- package/lib/utils/scan-validators/abstract-scan-validator.d.ts +43 -0
- package/lib/utils/scan-validators/zbar-scan-validator.d.ts +8 -0
- package/lib/utils/scan-validators/zxing-canvas-scan-validator.d.ts +10 -0
- package/lib/utils/scan-validators/zxing-scan-validator.d.ts +8 -0
- package/lib/utils/svg.d.ts +2 -0
- package/lib/utils/token-validator.d.ts +19 -0
- package/package.json +80 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
import IndexOutOfBoundsException from './IndexOutOfBoundsException';
|
2
|
+
/**
|
3
|
+
* Custom Error class of type Exception.
|
4
|
+
*/
|
5
|
+
export default class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException {
|
6
|
+
index: number;
|
7
|
+
message: string;
|
8
|
+
static readonly kind: string;
|
9
|
+
constructor(index: number, message: string);
|
10
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/**
|
2
|
+
* Enumerates barcode formats known to this package. Please keep alphabetized.
|
3
|
+
*
|
4
|
+
* @author Sean Owen
|
5
|
+
*/
|
6
|
+
declare enum BarcodeFormat {
|
7
|
+
/** Aztec 2D barcode format. */
|
8
|
+
AZTEC = 0,
|
9
|
+
/** CODABAR 1D format. */
|
10
|
+
CODABAR = 1,
|
11
|
+
/** Code 39 1D format. */
|
12
|
+
CODE_39 = 2,
|
13
|
+
/** Code 93 1D format. */
|
14
|
+
CODE_93 = 3,
|
15
|
+
/** Code 128 1D format. */
|
16
|
+
CODE_128 = 4,
|
17
|
+
/** Data Matrix 2D barcode format. */
|
18
|
+
DATA_MATRIX = 5,
|
19
|
+
/** EAN-8 1D format. */
|
20
|
+
EAN_8 = 6,
|
21
|
+
/** EAN-13 1D format. */
|
22
|
+
EAN_13 = 7,
|
23
|
+
/** ITF (Interleaved Two of Five) 1D format. */
|
24
|
+
ITF = 8,
|
25
|
+
/** MaxiCode 2D barcode format. */
|
26
|
+
MAXICODE = 9,
|
27
|
+
/** PDF417 format. */
|
28
|
+
PDF_417 = 10,
|
29
|
+
/** QR Code 2D barcode format. */
|
30
|
+
QR_CODE = 11,
|
31
|
+
/** RSS 14 */
|
32
|
+
RSS_14 = 12,
|
33
|
+
/** RSS EXPANDED */
|
34
|
+
RSS_EXPANDED = 13,
|
35
|
+
/** UPC-A 1D format. */
|
36
|
+
UPC_A = 14,
|
37
|
+
/** UPC-E 1D format. */
|
38
|
+
UPC_E = 15,
|
39
|
+
/** UPC/EAN extension format. Not a stand-alone format. */
|
40
|
+
UPC_EAN_EXTENSION = 16
|
41
|
+
}
|
42
|
+
export default BarcodeFormat;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import BitArray from './common/BitArray';
|
2
|
+
import BitMatrix from './common/BitMatrix';
|
3
|
+
import LuminanceSource from './LuminanceSource';
|
4
|
+
/**
|
5
|
+
* This class hierarchy provides a set of methods to convert luminance data to 1 bit data.
|
6
|
+
* It allows the algorithm to vary polymorphically, for example allowing a very expensive
|
7
|
+
* thresholding technique for servers and a fast one for mobile. It also permits the implementation
|
8
|
+
* to vary, e.g. a JNI version for Android and a Java fallback version for other platforms.
|
9
|
+
*
|
10
|
+
* @author dswitkin@google.com (Daniel Switkin)
|
11
|
+
*/
|
12
|
+
declare abstract class Binarizer {
|
13
|
+
private source;
|
14
|
+
protected constructor(source: LuminanceSource);
|
15
|
+
getLuminanceSource(): LuminanceSource;
|
16
|
+
/**
|
17
|
+
* Converts one row of luminance data to 1 bit data. May actually do the conversion, or return
|
18
|
+
* cached data. Callers should assume this method is expensive and call it as seldom as possible.
|
19
|
+
* This method is intended for decoding 1D barcodes and may choose to apply sharpening.
|
20
|
+
* For callers which only examine one row of pixels at a time, the same BitArray should be reused
|
21
|
+
* and passed in with each call for performance. However it is legal to keep more than one row
|
22
|
+
* at a time if needed.
|
23
|
+
*
|
24
|
+
* @param y The row to fetch, which must be in [0, bitmap height)
|
25
|
+
* @param row An optional preallocated array. If null or too small, it will be ignored.
|
26
|
+
* If used, the Binarizer will call BitArray.clear(). Always use the returned object.
|
27
|
+
* @return The array of bits for this row (true means black).
|
28
|
+
* @throws NotFoundException if row can't be binarized
|
29
|
+
*/
|
30
|
+
abstract getBlackRow(y: number, row: BitArray): BitArray;
|
31
|
+
/**
|
32
|
+
* Converts a 2D array of luminance data to 1 bit data. As above, assume this method is expensive
|
33
|
+
* and do not call it repeatedly. This method is intended for decoding 2D barcodes and may or
|
34
|
+
* may not apply sharpening. Therefore, a row from this matrix may not be identical to one
|
35
|
+
* fetched using getBlackRow(), so don't mix and match between them.
|
36
|
+
*
|
37
|
+
* @return The 2D array of bits for the image (true means black).
|
38
|
+
* @throws NotFoundException if image can't be binarized to make a matrix
|
39
|
+
*/
|
40
|
+
abstract getBlackMatrix(): BitMatrix;
|
41
|
+
/**
|
42
|
+
* Creates a new object with the same type as this Binarizer implementation, but with pristine
|
43
|
+
* state. This is needed because Binarizer implementations may be stateful, e.g. keeping a cache
|
44
|
+
* of 1 bit data. See Effective Java for why we can't use Java's clone() method.
|
45
|
+
*
|
46
|
+
* @param source The LuminanceSource this Binarizer will operate on.
|
47
|
+
* @return A new concrete Binarizer implementation object.
|
48
|
+
*/
|
49
|
+
abstract createBinarizer(source: LuminanceSource): Binarizer;
|
50
|
+
getWidth(): number;
|
51
|
+
getHeight(): number;
|
52
|
+
}
|
53
|
+
export default Binarizer;
|
@@ -0,0 +1,78 @@
|
|
1
|
+
/**
|
2
|
+
* This class is the core bitmap class used by ZXing to represent 1 bit data. Reader objects
|
3
|
+
* accept a BinaryBitmap and attempt to decode it.
|
4
|
+
*
|
5
|
+
* @author dswitkin@google.com (Daniel Switkin)
|
6
|
+
*/
|
7
|
+
import Binarizer from './Binarizer';
|
8
|
+
import BitArray from './common/BitArray';
|
9
|
+
import BitMatrix from './common/BitMatrix';
|
10
|
+
export default class BinaryBitmap {
|
11
|
+
private binarizer;
|
12
|
+
private matrix;
|
13
|
+
constructor(binarizer: Binarizer);
|
14
|
+
/**
|
15
|
+
* @return The width of the bitmap.
|
16
|
+
*/
|
17
|
+
getWidth(): number;
|
18
|
+
/**
|
19
|
+
* @return The height of the bitmap.
|
20
|
+
*/
|
21
|
+
getHeight(): number;
|
22
|
+
/**
|
23
|
+
* Converts one row of luminance data to 1 bit data. May actually do the conversion, or return
|
24
|
+
* cached data. Callers should assume this method is expensive and call it as seldom as possible.
|
25
|
+
* This method is intended for decoding 1D barcodes and may choose to apply sharpening.
|
26
|
+
*
|
27
|
+
* @param y The row to fetch, which must be in [0, bitmap height)
|
28
|
+
* @param row An optional preallocated array. If null or too small, it will be ignored.
|
29
|
+
* If used, the Binarizer will call BitArray.clear(). Always use the returned object.
|
30
|
+
* @return The array of bits for this row (true means black).
|
31
|
+
* @throws NotFoundException if row can't be binarized
|
32
|
+
*/
|
33
|
+
getBlackRow(y: number, row: BitArray): BitArray;
|
34
|
+
/**
|
35
|
+
* Converts a 2D array of luminance data to 1 bit. As above, assume this method is expensive
|
36
|
+
* and do not call it repeatedly. This method is intended for decoding 2D barcodes and may or
|
37
|
+
* may not apply sharpening. Therefore, a row from this matrix may not be identical to one
|
38
|
+
* fetched using getBlackRow(), so don't mix and match between them.
|
39
|
+
*
|
40
|
+
* @return The 2D array of bits for the image (true means black).
|
41
|
+
* @throws NotFoundException if image can't be binarized to make a matrix
|
42
|
+
*/
|
43
|
+
getBlackMatrix(): BitMatrix;
|
44
|
+
/**
|
45
|
+
* @return Whether this bitmap can be cropped.
|
46
|
+
*/
|
47
|
+
isCropSupported(): boolean;
|
48
|
+
/**
|
49
|
+
* Returns a new object with cropped image data. Implementations may keep a reference to the
|
50
|
+
* original data rather than a copy. Only callable if isCropSupported() is true.
|
51
|
+
*
|
52
|
+
* @param left The left coordinate, which must be in [0,getWidth())
|
53
|
+
* @param top The top coordinate, which must be in [0,getHeight())
|
54
|
+
* @param width The width of the rectangle to crop.
|
55
|
+
* @param height The height of the rectangle to crop.
|
56
|
+
* @return A cropped version of this object.
|
57
|
+
*/
|
58
|
+
crop(left: number, top: number, width: number, height: number): BinaryBitmap;
|
59
|
+
/**
|
60
|
+
* @return Whether this bitmap supports counter-clockwise rotation.
|
61
|
+
*/
|
62
|
+
isRotateSupported(): boolean;
|
63
|
+
/**
|
64
|
+
* Returns a new object with rotated image data by 90 degrees counterclockwise.
|
65
|
+
* Only callable if {@link #isRotateSupported()} is true.
|
66
|
+
*
|
67
|
+
* @return A rotated version of this object.
|
68
|
+
*/
|
69
|
+
rotateCounterClockwise(): BinaryBitmap;
|
70
|
+
/**
|
71
|
+
* Returns a new object with rotated image data by 45 degrees counterclockwise.
|
72
|
+
* Only callable if {@link #isRotateSupported()} is true.
|
73
|
+
*
|
74
|
+
* @return A rotated version of this object.
|
75
|
+
*/
|
76
|
+
rotateCounterClockwise45(): BinaryBitmap;
|
77
|
+
toString(): string;
|
78
|
+
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
/**
|
2
|
+
* Encapsulates a type of hint that a caller may pass to a barcode reader to help it
|
3
|
+
* more quickly or accurately decode it. It is up to implementations to decide what,
|
4
|
+
* if anything, to do with the information that is supplied.
|
5
|
+
*
|
6
|
+
* @author Sean Owen
|
7
|
+
* @author dswitkin@google.com (Daniel Switkin)
|
8
|
+
* @see Reader#decode(BinaryBitmap,java.util.Map)
|
9
|
+
*/
|
10
|
+
declare enum DecodeHintType {
|
11
|
+
/**
|
12
|
+
* Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
|
13
|
+
*/
|
14
|
+
OTHER = 0,
|
15
|
+
/**
|
16
|
+
* Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
|
17
|
+
* use {@link Boolean#TRUE}.
|
18
|
+
*/
|
19
|
+
PURE_BARCODE = 1,
|
20
|
+
/**
|
21
|
+
* Image is known to be of one of a few possible formats.
|
22
|
+
* Maps to a {@link List} of {@link BarcodeFormat}s.
|
23
|
+
*/
|
24
|
+
POSSIBLE_FORMATS = 2,
|
25
|
+
/**
|
26
|
+
* Spend more time to try to find a barcode; optimize for accuracy, not speed.
|
27
|
+
* Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
28
|
+
*/
|
29
|
+
TRY_HARDER = 3,
|
30
|
+
/**
|
31
|
+
* Specifies what character encoding to use when decoding, where applicable (type String)
|
32
|
+
*/
|
33
|
+
CHARACTER_SET = 4,
|
34
|
+
/**
|
35
|
+
* Allowed lengths of encoded data -- reject anything else. Maps to an {@code Int32Array}.
|
36
|
+
*/
|
37
|
+
ALLOWED_LENGTHS = 5,
|
38
|
+
/**
|
39
|
+
* Assume Code 39 codes employ a check digit. Doesn't matter what it maps to;
|
40
|
+
* use {@link Boolean#TRUE}.
|
41
|
+
*/
|
42
|
+
ASSUME_CODE_39_CHECK_DIGIT = 6,
|
43
|
+
/**
|
44
|
+
* Enable extended mode for Code 39 codes. Doesn't matter what it maps to;
|
45
|
+
* use {@link Boolean#TRUE}.
|
46
|
+
*/
|
47
|
+
ENABLE_CODE_39_EXTENDED_MODE = 7,
|
48
|
+
/**
|
49
|
+
* Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed.
|
50
|
+
* For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to;
|
51
|
+
* use {@link Boolean#TRUE}.
|
52
|
+
*/
|
53
|
+
ASSUME_GS1 = 8,
|
54
|
+
/**
|
55
|
+
* If true, return the start and end digits in a Codabar barcode instead of stripping them. They
|
56
|
+
* are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them
|
57
|
+
* to not be. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
58
|
+
*/
|
59
|
+
RETURN_CODABAR_START_END = 9,
|
60
|
+
/**
|
61
|
+
* The caller needs to be notified via callback when a possible {@link ResultPoint}
|
62
|
+
* is found. Maps to a {@link ResultPointCallback}.
|
63
|
+
*/
|
64
|
+
NEED_RESULT_POINT_CALLBACK = 10,
|
65
|
+
/**
|
66
|
+
* Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.
|
67
|
+
* Maps to an {@code Int32Array} of the allowed extension lengths, for example [2], [5], or [2, 5].
|
68
|
+
* If it is optional to have an extension, do not set this hint. If this is set,
|
69
|
+
* and a UPC or EAN barcode is found but an extension is not, then no result will be returned
|
70
|
+
* at all.
|
71
|
+
*/
|
72
|
+
ALLOWED_EAN_EXTENSIONS
|
73
|
+
/**
|
74
|
+
* Data type the hint is expecting.
|
75
|
+
* Among the possible values the {@link Void} stands out as being used for
|
76
|
+
* hints that do not expect a value to be supplied (flag hints). Such hints
|
77
|
+
* will possibly have their value ignored, or replaced by a
|
78
|
+
* {@link Boolean#TRUE}. Hint suppliers should probably use
|
79
|
+
* {@link Boolean#TRUE} as directed by the actual hint documentation.
|
80
|
+
*/
|
81
|
+
= 11
|
82
|
+
/**
|
83
|
+
* Data type the hint is expecting.
|
84
|
+
* Among the possible values the {@link Void} stands out as being used for
|
85
|
+
* hints that do not expect a value to be supplied (flag hints). Such hints
|
86
|
+
* will possibly have their value ignored, or replaced by a
|
87
|
+
* {@link Boolean#TRUE}. Hint suppliers should probably use
|
88
|
+
* {@link Boolean#TRUE} as directed by the actual hint documentation.
|
89
|
+
*/
|
90
|
+
}
|
91
|
+
export default DecodeHintType;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* Simply encapsulates a width and height.
|
3
|
+
*/
|
4
|
+
export default class Dimension {
|
5
|
+
private width;
|
6
|
+
private height;
|
7
|
+
constructor(width: number, height: number);
|
8
|
+
getWidth(): number;
|
9
|
+
getHeight(): number;
|
10
|
+
equals(other: any): boolean;
|
11
|
+
hashCode(): number;
|
12
|
+
toString(): string;
|
13
|
+
}
|
@@ -0,0 +1,99 @@
|
|
1
|
+
/**
|
2
|
+
* These are a set of hints that you may pass to Writers to specify their behavior.
|
3
|
+
*
|
4
|
+
* @author dswitkin@google.com (Daniel Switkin)
|
5
|
+
*/
|
6
|
+
declare enum EncodeHintType {
|
7
|
+
/**
|
8
|
+
* Specifies what degree of error correction to use, for example in QR Codes.
|
9
|
+
* Type depends on the encoder. For example for QR codes it's type
|
10
|
+
* {@link com.google.zxing.qrcode.decoder.ErrorCorrectionLevel ErrorCorrectionLevel}.
|
11
|
+
* For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words.
|
12
|
+
* For PDF417 it is of type {@link Integer}, valid values being 0 to 8.
|
13
|
+
* In all cases, it can also be a {@link String} representation of the desired value as well.
|
14
|
+
* Note: an Aztec symbol should have a minimum of 25% EC words.
|
15
|
+
*/
|
16
|
+
ERROR_CORRECTION = 0,
|
17
|
+
/**
|
18
|
+
* Specifies what character encoding to use where applicable (type {@link String})
|
19
|
+
*/
|
20
|
+
CHARACTER_SET = 1,
|
21
|
+
/**
|
22
|
+
* Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})
|
23
|
+
*/
|
24
|
+
DATA_MATRIX_SHAPE = 2,
|
25
|
+
/**
|
26
|
+
* Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or "true" or "false"
|
27
|
+
* {@link String } value).
|
28
|
+
* The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1
|
29
|
+
* character set via ECIs.
|
30
|
+
* Please note that in that case, the most compact character encoding is chosen for characters in
|
31
|
+
* the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
32
|
+
* support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
33
|
+
* means of the {@link #CHARACTER_SET} encoding hint.
|
34
|
+
* Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case
|
35
|
+
* group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords
|
36
|
+
* for the purpose of delimiting AIs.
|
37
|
+
* This option and {@link #FORCE_C40} are mutually exclusive.
|
38
|
+
*/
|
39
|
+
DATA_MATRIX_COMPACT = 3,
|
40
|
+
/**
|
41
|
+
* Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
42
|
+
*
|
43
|
+
* @deprecated use width/height params in
|
44
|
+
* {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, int, int)}
|
45
|
+
*/
|
46
|
+
MIN_SIZE = 4,
|
47
|
+
/**
|
48
|
+
* Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
49
|
+
*
|
50
|
+
* @deprecated without replacement
|
51
|
+
*/
|
52
|
+
MAX_SIZE = 5,
|
53
|
+
/**
|
54
|
+
* Specifies margin, in pixels, to use when generating the barcode. The meaning can vary
|
55
|
+
* by format; for example it controls margin before and after the barcode horizontally for
|
56
|
+
* most 1D formats. (Type {@link Integer}, or {@link String} representation of the integer value).
|
57
|
+
*/
|
58
|
+
MARGIN = 6,
|
59
|
+
/**
|
60
|
+
* Specifies whether to use compact mode for PDF417 (type {@link Boolean}, or "true" or "false"
|
61
|
+
* {@link String} value).
|
62
|
+
*/
|
63
|
+
PDF417_COMPACT = 7,
|
64
|
+
/**
|
65
|
+
* Specifies what compaction mode to use for PDF417 (type
|
66
|
+
* {@link com.google.zxing.pdf417.encoder.Compaction Compaction} or {@link String} value of one of its
|
67
|
+
* enum values).
|
68
|
+
*/
|
69
|
+
PDF417_COMPACTION = 8,
|
70
|
+
/**
|
71
|
+
* Specifies the minimum and maximum number of rows and columns for PDF417 (type
|
72
|
+
* {@link com.google.zxing.pdf417.encoder.Dimensions Dimensions}).
|
73
|
+
*/
|
74
|
+
PDF417_DIMENSIONS = 9,
|
75
|
+
/**
|
76
|
+
* Specifies the required number of layers for an Aztec code.
|
77
|
+
* A negative number (-1, -2, -3, -4) specifies a compact Aztec code.
|
78
|
+
* 0 indicates to use the minimum number of layers (the default).
|
79
|
+
* A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code.
|
80
|
+
* (Type {@link Integer}, or {@link String} representation of the integer value).
|
81
|
+
*/
|
82
|
+
AZTEC_LAYERS = 10,
|
83
|
+
/**
|
84
|
+
* Specifies the exact version of QR code to be encoded.
|
85
|
+
* (Type {@link Integer}, or {@link String} representation of the integer value).
|
86
|
+
*/
|
87
|
+
QR_VERSION = 11,
|
88
|
+
/**
|
89
|
+
* Specifies whether the data should be encoded to the GS1 standard (type {@link Boolean}, or "true" or "false"
|
90
|
+
* {@link String } value).
|
91
|
+
*/
|
92
|
+
GS1_FORMAT = 12,
|
93
|
+
/**
|
94
|
+
* Forces C40 encoding for data-matrix (type {@link Boolean}, or "true" or "false") {@link String } value). This
|
95
|
+
* option and {@link #DATA_MATRIX_COMPACT} are mutually exclusive.
|
96
|
+
*/
|
97
|
+
FORCE_C40 = 13
|
98
|
+
}
|
99
|
+
export default EncodeHintType;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { CustomError } from 'ts-custom-error';
|
2
|
+
/**
|
3
|
+
* Custom Error class of type Exception.
|
4
|
+
*/
|
5
|
+
export default class Exception extends CustomError {
|
6
|
+
message: string | undefined;
|
7
|
+
/**
|
8
|
+
* It's typed as string so it can be extended and overriden.
|
9
|
+
*/
|
10
|
+
static readonly kind: string;
|
11
|
+
/**
|
12
|
+
* Allows Exception to be constructed directly
|
13
|
+
* with some message and prototype definition.
|
14
|
+
*/
|
15
|
+
constructor(message?: string | undefined);
|
16
|
+
getKind(): string;
|
17
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import LuminanceSource from './LuminanceSource';
|
2
|
+
/**
|
3
|
+
* A wrapper implementation of LuminanceSource which converts the source image
|
4
|
+
* into a high contrast (binary) image using a fixed threshold. Pixels with a value
|
5
|
+
* below the threshold become black (0) and those equal to or above become white (255).
|
6
|
+
*/
|
7
|
+
export default class HighContrastLuminanceSource extends LuminanceSource {
|
8
|
+
private delegate;
|
9
|
+
private threshold;
|
10
|
+
constructor(delegate: LuminanceSource, threshold?: number);
|
11
|
+
getRow(y: number, row?: Uint8ClampedArray): Uint8ClampedArray;
|
12
|
+
getMatrix(): Uint8ClampedArray;
|
13
|
+
isCropSupported(): boolean;
|
14
|
+
crop(left: number, top: number, width: number, height: number): LuminanceSource;
|
15
|
+
isRotateSupported(): boolean;
|
16
|
+
rotateCounterClockwise(): LuminanceSource;
|
17
|
+
rotateCounterClockwise45(): LuminanceSource;
|
18
|
+
/**
|
19
|
+
* Inverts the high contrast image. This wraps the current instance with InvertedLuminanceSource,
|
20
|
+
* which effectively swaps black and white.
|
21
|
+
*/
|
22
|
+
invert(): LuminanceSource;
|
23
|
+
/**
|
24
|
+
* Since this source is already high contrast, calling highContrast() returns itself.
|
25
|
+
*/
|
26
|
+
highContrast(): LuminanceSource;
|
27
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import LuminanceSource from './LuminanceSource';
|
2
|
+
/**
|
3
|
+
* A wrapper implementation of {@link LuminanceSource} which inverts the luminances it returns -- black becomes
|
4
|
+
* white and vice versa, and each value becomes (255-value).
|
5
|
+
*
|
6
|
+
* @author Sean Owen
|
7
|
+
*/
|
8
|
+
export default class InvertedLuminanceSource extends LuminanceSource {
|
9
|
+
private delegate;
|
10
|
+
constructor(delegate: LuminanceSource);
|
11
|
+
getRow(y: number, row?: Uint8ClampedArray): Uint8ClampedArray;
|
12
|
+
getMatrix(): Uint8ClampedArray;
|
13
|
+
isCropSupported(): boolean;
|
14
|
+
crop(left: number, top: number, width: number, height: number): LuminanceSource;
|
15
|
+
isRotateSupported(): boolean;
|
16
|
+
/**
|
17
|
+
* @return original delegate {@link LuminanceSource} since invert undoes itself
|
18
|
+
*/
|
19
|
+
invert(): LuminanceSource;
|
20
|
+
rotateCounterClockwise(): LuminanceSource;
|
21
|
+
rotateCounterClockwise45(): LuminanceSource;
|
22
|
+
}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
/**
|
2
|
+
* The purpose of this class hierarchy is to abstract different bitmap implementations across
|
3
|
+
* platforms into a standard interface for requesting greyscale luminance values. The interface
|
4
|
+
* only provides immutable methods; therefore crop and rotation create copies. This is to ensure
|
5
|
+
* that one Reader does not modify the original luminance source and leave it in an unknown state
|
6
|
+
* for other Readers in the chain.
|
7
|
+
*
|
8
|
+
* @author dswitkin@google.com (Daniel Switkin)
|
9
|
+
*/
|
10
|
+
declare abstract class LuminanceSource {
|
11
|
+
private width;
|
12
|
+
private height;
|
13
|
+
protected constructor(width: number, height: number);
|
14
|
+
/**
|
15
|
+
* Fetches one row of luminance data from the underlying platform's bitmap. Values range from
|
16
|
+
* 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have
|
17
|
+
* to bitwise and with 0xff for each value. It is preferable for implementations of this method
|
18
|
+
* to only fetch this row rather than the whole image, since no 2D Readers may be installed and
|
19
|
+
* getMatrix() may never be called.
|
20
|
+
*
|
21
|
+
* @param y The row to fetch, which must be in [0,getHeight())
|
22
|
+
* @param row An optional preallocated array. If null or too small, it will be ignored.
|
23
|
+
* Always use the returned object, and ignore the .length of the array.
|
24
|
+
* @return An array containing the luminance data.
|
25
|
+
*/
|
26
|
+
abstract getRow(y: number, row?: Uint8ClampedArray): Uint8ClampedArray;
|
27
|
+
/**
|
28
|
+
* Fetches luminance data for the underlying bitmap. Values should be fetched using:
|
29
|
+
* {@code int luminance = array[y * width + x] & 0xff}
|
30
|
+
*
|
31
|
+
* @return A row-major 2D array of luminance values. Do not use result.length as it may be
|
32
|
+
* larger than width * height bytes on some platforms. Do not modify the contents
|
33
|
+
* of the result.
|
34
|
+
*/
|
35
|
+
abstract getMatrix(): Uint8ClampedArray;
|
36
|
+
/**
|
37
|
+
* @return The width of the bitmap.
|
38
|
+
*/
|
39
|
+
getWidth(): number;
|
40
|
+
/**
|
41
|
+
* @return The height of the bitmap.
|
42
|
+
*/
|
43
|
+
getHeight(): number;
|
44
|
+
/**
|
45
|
+
* @return Whether this subclass supports cropping.
|
46
|
+
*/
|
47
|
+
isCropSupported(): boolean;
|
48
|
+
/**
|
49
|
+
* Returns a new object with cropped image data. Implementations may keep a reference to the
|
50
|
+
* original data rather than a copy. Only callable if isCropSupported() is true.
|
51
|
+
*
|
52
|
+
* @param left The left coordinate, which must be in [0,getWidth())
|
53
|
+
* @param top The top coordinate, which must be in [0,getHeight())
|
54
|
+
* @param width The width of the rectangle to crop.
|
55
|
+
* @param height The height of the rectangle to crop.
|
56
|
+
* @return A cropped version of this object.
|
57
|
+
*/
|
58
|
+
crop(left: number, top: number, width: number, height: number): LuminanceSource;
|
59
|
+
/**
|
60
|
+
* @return Whether this subclass supports counter-clockwise rotation.
|
61
|
+
*/
|
62
|
+
isRotateSupported(): boolean;
|
63
|
+
/**
|
64
|
+
* @return a wrapper of this {@code LuminanceSource} which inverts the luminances it returns -- black becomes
|
65
|
+
* white and vice versa, and each value becomes (255-value).
|
66
|
+
*/
|
67
|
+
abstract invert(): LuminanceSource;
|
68
|
+
/**
|
69
|
+
* Returns a new object with rotated image data by 90 degrees counterclockwise.
|
70
|
+
* Only callable if {@link #isRotateSupported()} is true.
|
71
|
+
*
|
72
|
+
* @return A rotated version of this object.
|
73
|
+
*/
|
74
|
+
rotateCounterClockwise(): LuminanceSource;
|
75
|
+
/**
|
76
|
+
* Returns a new object with rotated image data by 45 degrees counterclockwise.
|
77
|
+
* Only callable if {@link #isRotateSupported()} is true.
|
78
|
+
*
|
79
|
+
* @return A rotated version of this object.
|
80
|
+
*/
|
81
|
+
rotateCounterClockwise45(): LuminanceSource;
|
82
|
+
toString(): string;
|
83
|
+
}
|
84
|
+
export default LuminanceSource;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import LuminanceSource from './LuminanceSource';
|
2
|
+
/**
|
3
|
+
* NodeLuminanceSource replicates the behavior of HTMLCanvasElementLuminanceSource
|
4
|
+
* but uses Sharp to obtain image data from a Buffer.
|
5
|
+
*/
|
6
|
+
export declare class NodeLuminanceSource extends LuminanceSource {
|
7
|
+
private buffer;
|
8
|
+
private _width;
|
9
|
+
private _height;
|
10
|
+
private constructor();
|
11
|
+
/**
|
12
|
+
* Asynchronously creates a NodeLuminanceSource from an image buffer.
|
13
|
+
* @param imageBuffer - The image data (e.g. from fs.readFile) as a Buffer.
|
14
|
+
* @param doAutoInvert - If true, computes an inverted grayscale buffer.
|
15
|
+
*/
|
16
|
+
static create(imageBuffer: Buffer, doAutoInvert?: boolean): Promise<NodeLuminanceSource>;
|
17
|
+
/**
|
18
|
+
* Converts raw RGBA data to a grayscale buffer.
|
19
|
+
* If doAutoInvert is true, each computed luminance is inverted.
|
20
|
+
*/
|
21
|
+
private static toGrayscaleBuffer;
|
22
|
+
getRow(y: number, row?: Uint8ClampedArray): Uint8ClampedArray;
|
23
|
+
getMatrix(): Uint8ClampedArray;
|
24
|
+
isCropSupported(): boolean;
|
25
|
+
crop(left: number, top: number, width: number, height: number): LuminanceSource;
|
26
|
+
isRotateSupported(): boolean;
|
27
|
+
rotateCounterClockwise(): LuminanceSource;
|
28
|
+
rotateCounterClockwise45(): LuminanceSource;
|
29
|
+
/**
|
30
|
+
* Rotates the image by the specified angle (in degrees) using Sharp.
|
31
|
+
* This method creates a temporary RGBA image from the grayscale data,
|
32
|
+
* rotates it, then re-converts to grayscale.
|
33
|
+
*/
|
34
|
+
private rotate;
|
35
|
+
invert(): LuminanceSource;
|
36
|
+
}
|