1 | ;
|
2 |
|
3 | let SyncReader = require("./sync-reader");
|
4 | let Filter = require("./filter-parse");
|
5 |
|
6 | exports.process = function (inBuffer, bitmapInfo) {
|
7 | let outBuffers = [];
|
8 | let reader = new SyncReader(inBuffer);
|
9 | let filter = new Filter(bitmapInfo, {
|
10 | read: reader.read.bind(reader),
|
11 | write: function (bufferPart) {
|
12 | outBuffers.push(bufferPart);
|
13 | },
|
14 | complete: function () {},
|
15 | });
|
16 |
|
17 | filter.start();
|
18 | reader.process();
|
19 |
|
20 | return Buffer.concat(outBuffers);
|
21 | };
|