lib/renderer.js
function BaseRenderer(generator, config, logger, document) {
        this._generator = generator;
        this._document = document;
        this._logger = logger;

        if (config.hasOwnProperty("use-jpg-encoding")) {
            this._useJPGEncoding = config["use-jpg-encoding"];
        }

        if (config.hasOwnProperty("use-smart-scaling")) {
            this._useSmartScaling = !!config["use-smart-scaling"];
        }

        if (config.hasOwnProperty("include-ancestor-masks")) {
            this._includeAncestorMasks = !!config["include-ancestor-masks"];
        }

        if (config.hasOwnProperty("convert-color-space")) {
            this._convertColorSpace = !!config["convert-color-space"];
        }
        
        if (config.hasOwnProperty("icc-profile")) {
            this._useICCProfile = config["icc-profile"];
        }
        
        if (config.hasOwnProperty("embed-icc-profile")) {
            this._embedICCProfile = config["embed-icc-profile"];
        }

        if (config.hasOwnProperty("allow-dither")) {
            this._allowDither = !!config["allow-dither"];
        }

        if (config.hasOwnProperty("use-psd-smart-object-pixel-scaling")) {
            this._forceSmartPSDPixelScaling = !!config["use-psd-smart-object-pixel-scaling"];
        }

        if (config.hasOwnProperty("use-pngquant")) {
            this._usePngquant = !!config["use-pngquant"];
        }
        
        if (config.hasOwnProperty("use-flite")) {
            this._useFlite = !!config["use-flite"];
        }

        if (config.hasOwnProperty("webp-lossless")) {
            this._webpLossless = !!config["webp-lossless"];
        }

        if (config.hasOwnProperty("clip-all-images-to-document-bounds")) {
            this._clipAllImagesToDocumentBounds = !!config["clip-all-images-to-document-bounds"];
        }

        if (config.hasOwnProperty("clip-all-images-to-artboard-bounds")) {
            this._clipAllImagesToArtboardBounds = !!config["clip-all-images-to-artboard-bounds"];
        }

        if (config.hasOwnProperty("mask-adds-padding")) {
            this._masksAddPadding = !!config["mask-adds-padding"];
        }
        
        if (config.hasOwnProperty("expand-max-dimensions")) {
            this._expandMaxDimensions = !!config["expand-max-dimensions"];
        }
    }
function BaseRenderer(generator, config, logger, document) {
        this._generator = generator;
        this._document = document;
        this._logger = logger;

        if (config.hasOwnProperty("use-jpg-encoding")) {
            this._useJPGEncoding = config["use-jpg-encoding"];
        }

        if (config.hasOwnProperty("use-smart-scaling")) {
            this._useSmartScaling = !!config["use-smart-scaling"];
        }

        if (config.hasOwnProperty("include-ancestor-masks")) {
            this._includeAncestorMasks = !!config["include-ancestor-masks"];
        }

        if (config.hasOwnProperty("convert-color-space")) {
            this._convertColorSpace = !!config["convert-color-space"];
        }
        
        if (config.hasOwnProperty("icc-profile")) {
            this._useICCProfile = config["icc-profile"];
        }
        
        if (config.hasOwnProperty("embed-icc-profile")) {
            this._embedICCProfile = config["embed-icc-profile"];
        }

        if (config.hasOwnProperty("allow-dither")) {
            this._allowDither = !!config["allow-dither"];
        }

        if (config.hasOwnProperty("use-psd-smart-object-pixel-scaling")) {
            this._forceSmartPSDPixelScaling = !!config["use-psd-smart-object-pixel-scaling"];
        }

        if (config.hasOwnProperty("use-pngquant")) {
            this._usePngquant = !!config["use-pngquant"];
        }
        
        if (config.hasOwnProperty("use-flite")) {
            this._useFlite = !!config["use-flite"];
        }

        if (config.hasOwnProperty("webp-lossless")) {
            this._webpLossless = !!config["webp-lossless"];
        }

        if (config.hasOwnProperty("clip-all-images-to-document-bounds")) {
            this._clipAllImagesToDocumentBounds = !!config["clip-all-images-to-document-bounds"];
        }

        if (config.hasOwnProperty("clip-all-images-to-artboard-bounds")) {
            this._clipAllImagesToArtboardBounds = !!config["clip-all-images-to-artboard-bounds"];
        }

        if (config.hasOwnProperty("mask-adds-padding")) {
            this._masksAddPadding = !!config["mask-adds-padding"];
        }
        
        if (config.hasOwnProperty("expand-max-dimensions")) {
            this._expandMaxDimensions = !!config["expand-max-dimensions"];
        }
    }
function BaseRenderer ( generator , config , logger , document ) { this . _generator = generator ; this . _document = document ; this . _logger = logger ; if ( config . hasOwnProperty ( "use-jpg-encoding" ) ) { this . _useJPGEncoding = config [ "use-jpg-encoding" ] ; } if ( config . hasOwnProperty ( "use-smart-scaling" ) ) { this . _useSmartScaling = ! ! config [ "use-smart-scaling" ] ; } if ( config . hasOwnProperty ( "include-ancestor-masks" ) ) { this . _includeAncestorMasks = ! ! config [ "include-ancestor-masks" ] ; } if ( config . hasOwnProperty ( "convert-color-space" ) ) { this . _convertColorSpace = ! ! config [ "convert-color-space" ] ; } if ( config . hasOwnProperty ( "icc-profile" ) ) { this . _useICCProfile = config [ "icc-profile" ] ; } if ( config . hasOwnProperty ( "embed-icc-profile" ) ) { this . _embedICCProfile = config [ "embed-icc-profile" ] ; } if ( config . hasOwnProperty ( "allow-dither" ) ) { this . _allowDither = ! ! config [ "allow-dither" ] ; } if ( config . hasOwnProperty ( "use-psd-smart-object-pixel-scaling" ) ) { this . _forceSmartPSDPixelScaling = ! ! config [ "use-psd-smart-object-pixel-scaling" ] ; } if ( config . hasOwnProperty ( "use-pngquant" ) ) { this . _usePngquant = ! ! config [ "use-pngquant" ] ; } if ( config . hasOwnProperty ( "use-flite" ) ) { this . _useFlite = ! ! config [ "use-flite" ] ; } if ( config . hasOwnProperty ( "webp-lossless" ) ) { this . _webpLossless = ! ! config [ "webp-lossless" ] ; } if ( config . hasOwnProperty ( "clip-all-images-to-document-bounds" ) ) { this . _clipAllImagesToDocumentBounds = ! ! config [ "clip-all-images-to-document-bounds" ] ; } if ( config . hasOwnProperty ( "clip-all-images-to-artboard-bounds" ) ) { this . _clipAllImagesToArtboardBounds = ! ! config [ "clip-all-images-to-artboard-bounds" ] ; } if ( config . hasOwnProperty ( "mask-adds-padding" ) ) { this . _masksAddPadding = ! ! config [ "mask-adds-padding" ] ; } if ( config . hasOwnProperty ( "expand-max-dimensions" ) ) { this . _expandMaxDimensions = ! ! config [ "expand-max-dimensions" ] ; } }
Abstract renderer class for a given document. Converts components to assets on disk.

@constructor
@param {Generator} generator
@param {object} config
@param {Logger} logger
@param {Document} document
Abstract renderer class for a given document . Converts components to assets on disk .