import { ImageFormat } from '../enum';
var _ImageStructure = /** @class */ (function () {
    function _ImageStructure(stream, crossReference, page) {
        this._isImageMasked = false;
        this._isSoftMasked = false;
        this._isImageMask = false;
        this._isImageInterpolated = false;
        this._stream = stream;
        this._crossReference = crossReference;
        this._pageIndex = page._pageIndex;
        this._initialize();
    }
    _ImageStructure.prototype._initialize = function () {
        var dictionary = this._stream.dictionary;
        if (dictionary.has('Width')) {
            this._width = dictionary.get('Width');
        }
        if (dictionary.has('Height')) {
            this._height = dictionary.get('Height');
        }
        if (dictionary.has('Mask')) {
            this._isImageMasked = true;
            this._smask = dictionary.get('Mask');
            this._maskReference = dictionary.getRaw('Mask');
        }
        if (dictionary.has('ImageMask')) {
            this._isImageMask = dictionary.get('ImageMask');
        }
        if (dictionary.has('SMask')) {
            this._isSoftMasked = true;
            this._smask = dictionary.get('SMask');
            this._smaskReference = dictionary.getRaw('SMask');
        }
        if (dictionary.has('isImageInterpolate')) {
            this._isImageInterpolated = true;
        }
        if (this._isImageMasked || this._isSoftMasked || this._isImageMask) {
            this._imageFormat = ImageFormat.png;
        }
        else {
            this._imageFormat = ImageFormat.jpeg;
        }
    };
    return _ImageStructure;
}());
export { _ImageStructure };
