@jimp/core
Advanced tools
Comparing version
@@ -914,2 +914,24 @@ "use strict"; | ||
} | ||
/** | ||
* Iterate scan through a region of the bitmap | ||
* @param {number} x the x coordinate to begin the scan at | ||
* @param {number} y the y coordinate to begin the scan at | ||
* @param w the width of the scan region | ||
* @param h the height of the scan region | ||
* @returns {IterableIterator<{x: number, y: number, idx: number, image: Jimp}>} | ||
*/ | ||
}, { | ||
key: "scanIterator", | ||
value: function scanIterator(x, y, w, h) { | ||
if (typeof x !== 'number' || typeof y !== 'number') { | ||
return _utils.throwError.call(this, 'x and y must be numbers'); | ||
} | ||
if (typeof w !== 'number' || typeof h !== 'number') { | ||
return _utils.throwError.call(this, 'w and h must be numbers'); | ||
} | ||
return (0, _utils.scanIterator)(this, x, y, w, h); | ||
} | ||
}]); | ||
@@ -916,0 +938,0 @@ |
@@ -36,3 +36,3 @@ function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
import EventEmitter from 'events'; | ||
import { isNodePattern, throwError, scan } from '@jimp/utils'; | ||
import { isNodePattern, throwError, scan, scanIterator as _scanIterator } from '@jimp/utils'; | ||
import anyBase from 'any-base'; | ||
@@ -831,2 +831,24 @@ import mkdirp from 'mkdirp'; | ||
} | ||
/** | ||
* Iterate scan through a region of the bitmap | ||
* @param {number} x the x coordinate to begin the scan at | ||
* @param {number} y the y coordinate to begin the scan at | ||
* @param w the width of the scan region | ||
* @param h the height of the scan region | ||
* @returns {IterableIterator<{x: number, y: number, idx: number, image: Jimp}>} | ||
*/ | ||
}, { | ||
key: "scanIterator", | ||
value: function scanIterator(x, y, w, h) { | ||
if (typeof x !== 'number' || typeof y !== 'number') { | ||
return throwError.call(this, 'x and y must be numbers'); | ||
} | ||
if (typeof w !== 'number' || typeof h !== 'number') { | ||
return throwError.call(this, 'w and h must be numbers'); | ||
} | ||
return _scanIterator(this, x, y, w, h); | ||
} | ||
}]); | ||
@@ -833,0 +855,0 @@ |
{ | ||
"name": "@jimp/core", | ||
"version": "0.6.8", | ||
"version": "0.7.0", | ||
"description": "Jimp core", | ||
@@ -35,3 +35,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@jimp/utils": "^0.6.8", | ||
"@jimp/utils": "^0.7.0", | ||
"any-base": "^1.1.0", | ||
@@ -55,3 +55,3 @@ "buffer": "^5.2.0", | ||
}, | ||
"gitHead": "aa937725a7db4f33c68cbab36ab5cf942f4b90ff" | ||
"gitHead": "cd5ff6a525c0e547fb0b8172a864d98c4ed7d5fd" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
380578
1.03%3470
1.11%+ Added
- Removed
Updated