mirror of
https://github.com/danbulant/pngjs
synced 2026-05-19 12:18:51 +00:00
24 lines
No EOL
552 B
JavaScript
24 lines
No EOL
552 B
JavaScript
import ChunkStream from "./chunkstream.js";
|
|
import Filter from "./filter-parse.js";
|
|
let util = require("util");
|
|
|
|
let FilterAsync = function (bitmapInfo) {
|
|
ChunkStream.call(this);
|
|
|
|
let buffers = [];
|
|
let that = this;
|
|
this._filter = new Filter(bitmapInfo, {
|
|
read: this.read.bind(this),
|
|
write: function (buffer) {
|
|
buffers.push(buffer);
|
|
},
|
|
complete: function () {
|
|
that.emit("complete", Buffer.concat(buffers));
|
|
},
|
|
});
|
|
|
|
this._filter.start();
|
|
};
|
|
util.inherits(FilterAsync, ChunkStream);
|
|
|
|
export default FilterAsync; |