image-js 1.6.1 → 1.6.2
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/dist/image-js.esm.js +24 -6
- package/dist/image-js.esm.js.map +1 -1
- package/dist/image-js.esm.min.js +2 -2
- package/dist/image-js.esm.min.js.map +1 -1
- package/dist/image-js.umd.js +28 -8
- package/dist/image-js.umd.js.map +1 -1
- package/dist/image-js.umd.min.js +2 -2
- package/dist/image-js.umd.min.js.map +1 -1
- package/dist-types/image-js.d.ts +2 -4
- package/lib/Stack.d.ts +1 -2
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js.map +1 -1
- package/lib/align/affineTransfrom/getAffineTransform.d.ts +1 -2
- package/lib/align/affineTransfrom/getAffineTransform.d.ts.map +1 -1
- package/lib/align/affineTransfrom/getAffineTransform.js +4 -1
- package/lib/align/affineTransfrom/getAffineTransform.js.map +1 -1
- package/lib/load/decodeBmp.d.ts.map +1 -1
- package/lib/load/decodeBmp.js +17 -0
- package/lib/load/decodeBmp.js.map +1 -1
- package/lib/maskAnalysis/getContourMoore.d.ts.map +1 -1
- package/lib/maskAnalysis/getContourMoore.js +2 -2
- package/lib/maskAnalysis/getContourMoore.js.map +1 -1
- package/package.json +1 -1
- package/src/Stack.ts +1 -3
- package/src/align/affineTransfrom/getAffineTransform.ts +5 -3
- package/src/load/decodeBmp.ts +22 -0
- package/src/maskAnalysis/getContourMoore.ts +2 -3
package/dist/image-js.umd.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* image-js v1.6.
|
|
2
|
+
* image-js v1.6.2
|
|
3
3
|
* Image processing and manipulation in JavaScript
|
|
4
4
|
* https://github.com/image-js/image-js#readme
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the MIT license.
|
|
7
7
|
*/
|
|
8
8
|
(function (global, factory) {
|
|
9
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports
|
|
10
|
-
typeof define === 'function' && define.amd ? define(['exports'
|
|
11
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.IJS = {}
|
|
12
|
-
})(this, (function (exports
|
|
9
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
10
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
11
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.IJS = {}));
|
|
12
|
+
})(this, (function (exports) { 'use strict';
|
|
13
13
|
|
|
14
14
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
15
15
|
function getDefaultExportFromCjs (x) {
|
|
@@ -14088,7 +14088,7 @@ ${indent}columns: ${matrix.columns}
|
|
|
14088
14088
|
contour.push(currentPoint);
|
|
14089
14089
|
}
|
|
14090
14090
|
const next = findNextPoint(mask, currentPoint, backtrackPoint);
|
|
14091
|
-
assert
|
|
14091
|
+
assert(next, 'Next border point is undefined.');
|
|
14092
14092
|
backtrackPoint = next.prevPoint;
|
|
14093
14093
|
currentPoint = next.currPoint;
|
|
14094
14094
|
if (currentPoint.column === startingPoint.column && currentPoint.row === startingPoint.row) {
|
|
@@ -23805,7 +23805,7 @@ ${indent}columns: ${matrix.columns}
|
|
|
23805
23805
|
},
|
|
23806
23806
|
maxRansacNbIterations,
|
|
23807
23807
|
debug = false,
|
|
23808
|
-
debugImagePath
|
|
23808
|
+
debugImagePath
|
|
23809
23809
|
} = options;
|
|
23810
23810
|
if (source.colorModel !== ImageColorModel.GREY) {
|
|
23811
23811
|
source = source.grey();
|
|
@@ -23885,6 +23885,9 @@ ${indent}columns: ${matrix.columns}
|
|
|
23885
23885
|
}
|
|
23886
23886
|
// create debug image
|
|
23887
23887
|
if (debug) {
|
|
23888
|
+
if (!debugImagePath) {
|
|
23889
|
+
throw new RangeError('Debug image file path is not specified.');
|
|
23890
|
+
}
|
|
23888
23891
|
const montage = new Montage(source, destination, {
|
|
23889
23892
|
disposition: MontageDisposition.VERTICAL
|
|
23890
23893
|
});
|
|
@@ -25058,10 +25061,27 @@ ${indent}columns: ${matrix.columns}
|
|
|
25058
25061
|
}
|
|
25059
25062
|
return new Image(decodedData.width, decodedData.height, {
|
|
25060
25063
|
colorModel,
|
|
25061
|
-
data: decodedData.data
|
|
25064
|
+
data: decodedData.data,
|
|
25065
|
+
resolution: getBmpResolution(decodedData)
|
|
25062
25066
|
});
|
|
25063
25067
|
}
|
|
25064
25068
|
}
|
|
25069
|
+
/**
|
|
25070
|
+
* Gets image's resolution from its parsed data. BMP stores resolution in
|
|
25071
|
+
* pixels per meter.
|
|
25072
|
+
* @param bmp - Parsed BMP image.
|
|
25073
|
+
* @returns Object with resolution data if it is defined.
|
|
25074
|
+
*/
|
|
25075
|
+
function getBmpResolution(bmp) {
|
|
25076
|
+
if (!bmp.xPixelsPerMeter || !bmp.yPixelsPerMeter) {
|
|
25077
|
+
return undefined;
|
|
25078
|
+
}
|
|
25079
|
+
return {
|
|
25080
|
+
x: bmp.xPixelsPerMeter,
|
|
25081
|
+
y: bmp.yPixelsPerMeter,
|
|
25082
|
+
unit: 'meter'
|
|
25083
|
+
};
|
|
25084
|
+
}
|
|
25065
25085
|
|
|
25066
25086
|
const tagsById$2 = {
|
|
25067
25087
|
0x829a: 'ExposureTime',
|