/* istanbul ignore next */
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
define(["require", "exports", "../decode-stream", "../graphics/images/pdf-fax-decoder", "../pdf-primitives"], function (require, exports, decode_stream_1, pdf_fax_decoder_1, pdf_primitives_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var _PdfFaxStream = (function (_super) {
__extends(_PdfFaxStream, _super);
function _PdfFaxStream(str, maybeLength, params) {
var _this = _super.call(this, maybeLength) || this;
_this.stream = str;
if (!(params instanceof pdf_primitives_1._PdfDictionary)) {
params = new pdf_primitives_1._PdfDictionary(null);
}
var source = {
next: function () {
return str.getByte();
}
};
_this.ccittFaxDecoder = new pdf_fax_decoder_1._PdfFaxDecoder(source, {
K: params.get('K'),
EndOfLine: params.get('EndOfLine'),
EncodedByteAlign: params.get('EncodedByteAlign'),
Columns: params.get('Columns'),
Rows: params.get('Rows'),
EndOfBlock: params.get('EndOfBlock'),
BlackIs1: params.get('BlackIs1')
});
return _this;
}
_PdfFaxStream.prototype.readBlock = function () {
while (!this.eof) {
var c = this.ccittFaxDecoder.readNextChar();
if (c === -1) {
this.eof = true;
return;
}
this.ensureBuffer(this.bufferLength + 1);
this.buffer[this.bufferLength++] = c;
}
};
return _PdfFaxStream;
}(decode_stream_1._PdfDecodeStream));
exports._PdfFaxStream = _PdfFaxStream;
});
|