UNPKG

483 BJavaScriptView Raw
1"use strict";
2
3let SyncReader = require("./sync-reader");
4let Filter = require("./filter-parse");
5
6exports.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};