in image forEach, use Ox.nonblockingForEach
This commit is contained in:
parent
9137607045
commit
de30af0656
1 changed files with 9 additions and 7 deletions
|
@ -525,13 +525,15 @@ Ox.load.Image = function(options, callback) {
|
||||||
i <n> Pixel index
|
i <n> Pixel index
|
||||||
callback <f> Callback function (if present, forEach is async)
|
callback <f> Callback function (if present, forEach is async)
|
||||||
@*/
|
@*/
|
||||||
that.forEach = function(fn, callback) {
|
that.forEach = function(iterator, callback) {
|
||||||
var data = self.data;
|
var data = self.data,
|
||||||
Ox._loop(0, data.length, 4, function(i) {
|
forEach = callback ? Ox.nonblockingForEach : Ox.forEach;
|
||||||
return fn([
|
forEach(Ox.range(0, data.length, 4), function(i) {
|
||||||
data[i], data[i + 1], data[i + 2], data[i + 3]
|
return iterator([
|
||||||
], getXY(i), i);
|
data[i], data[i + 1], data[i + 2], data[i + 3]
|
||||||
}, 10000, callback);
|
], getXY(i), i);
|
||||||
|
}, callback);
|
||||||
|
}
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue