all files / graphics/images/ pdf-bitmap.js

62.16% Statements 23/37
84.62% Branches 11/13
66.67% Functions 8/12
58.82% Lines 20/34
11 statements, 6 functions, 9 branches Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46                                                   
/* 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", "./../../graphics/images/image-decoder", "./../../graphics/images/byte-array", "./../../input-output/pdf-dictionary-properties", "./pdf-image"], function (require, exports, image_decoder_1, byte_array_1, pdf_dictionary_properties_1, pdf_image_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var PdfBitmap = (function (_super) {
        __extends(PdfBitmap, _super);
        function PdfBitmap(encodedString) {
            var _this = _super.call(this) || this;
            _this.imageStatus = true;
            _this.dictionaryProperties = new pdf_dictionary_properties_1.DictionaryProperties();
            _this.loadImage(encodedString);
            return _this;
        }
        PdfBitmap.prototype.loadImage = function (encodedString) {
            var task = this.initializeAsync(encodedString);
        };
        PdfBitmap.prototype.initializeAsync = function (encodedString) {
            var byteArray = new byte_array_1.ByteArray(encodedString.length);
            byteArray.writeFromBase64String(encodedString);
            this.decoder = new image_decoder_1.ImageDecoder(byteArray);
            this.height = this.decoder.height;
            this.width = this.decoder.width;
            this.bitsPerComponent = this.decoder.bitsPerComponent;
        };
        PdfBitmap.prototype.save = function () {
            this.imageStatus = true;
            this.imageStream = this.decoder.getImageDictionary();
        };
        return PdfBitmap;
    }(pdf_image_1.PdfImage));
    exports.PdfBitmap = PdfBitmap;
});