compute(sColorFog, sColorFilter, fAmbLightness) {
		const pp = this._prevShadingParams;
		// remember shading parameters
		pp.fog = sColorFog;
		pp.filter = sColorFilter;
		pp.amb = fAmbLightness;
		let sl = this._bEconomize ? 1 : this.getShadingLayerCount();
		const oOrigImg = this._originalImage;
		const oImg = CanvasHelper.createCanvas(oOrigImg.width, oOrigImg.height * sl);
		const ctx = oImg.getContext('2d');
		const h = oOrigImg.height;
		this._aFogStyles = [];
		for (let i = 0; i < this.getShadingLayerCount(); ++i) {
			const fFactor = Math.min(i / (this.getShadingLayerCount() - 1), 1) * (1 - fAmbLightness);
			this._aFogStyles[i] = this.computeFogStyle(sColorFog, fFactor);
		}
		for (let i = 0; i < sl; ++i) {
			ctx.drawImage(this.shadeImage(oOrigImg, i, sColorFog, sColorFilter), 0, i * h);
		}
		this._image = oImg;
	}
/**
	 * run shading computation. Original tileset must have been set
     * @param sColorFog {string} color of fog
     * @param sColorFilter {boolean|string} color filter
     * @param fAmbLightness {number}
     */
run shading computation. Original tileset must have been set
@param sColorFog {string} color of fog
@param sColorFilter {boolean|string} color filter
@param fAmbLightness {number}
run shading computation . Original tileset must have been set @param sColorFog { string } color of fog @param sColorFilter { boolean|string } color filter @param fAmbLightness { number }
compute(sColorFog, sColorFilter, fAmbLightness) {
		const pp = this._prevShadingParams;
		pp.fog = sColorFog;
		pp.filter = sColorFilter;
		pp.amb = fAmbLightness;
		let sl = this._bEconomize ? 1 : this.getShadingLayerCount();
		const oOrigImg = this._originalImage;
		const oImg = CanvasHelper.createCanvas(oOrigImg.width, oOrigImg.height * sl);
		const ctx = oImg.getContext('2d');
		const h = oOrigImg.height;
		this._aFogStyles = [];
		for (let i = 0; i < this.getShadingLayerCount(); ++i) {
			const fFactor = Math.min(i / (this.getShadingLayerCount() - 1), 1) * (1 - fAmbLightness);
			this._aFogStyles[i] = this.computeFogStyle(sColorFog, fFactor);
		}
		for (let i = 0; i < sl; ++i) {
			ctx.drawImage(this.shadeImage(oOrigImg, i, sColorFog, sColorFilter), 0, i * h);
		}
		this._image = oImg;
	}
compute ( sColorFog , sColorFilter , fAmbLightness ) { const pp = this . _prevShadingParams ; pp . fog = sColorFog ; pp . filter = sColorFilter ; pp . amb = fAmbLightness ; let sl = this . _bEconomize ? 1 : this . getShadingLayerCount ( ) ; const oOrigImg = this . _originalImage ; const oImg = CanvasHelper . createCanvas ( oOrigImg . width , oOrigImg . height * sl ) ; const ctx = oImg . getContext ( '2d' ) ; const h = oOrigImg . height ; this . _aFogStyles = [ ] ; for ( let i = 0 ; i < this . getShadingLayerCount ( ) ; ++ i ) { const fFactor = Math . min ( i / ( this . getShadingLayerCount ( ) - 1 ) , 1 ) * ( 1 - fAmbLightness ) ; this . _aFogStyles [ i ] = this . computeFogStyle ( sColorFog , fFactor ) ; } for ( let i = 0 ; i < sl ; ++ i ) { ctx . drawImage ( this . shadeImage ( oOrigImg , i , sColorFog , sColorFilter ) , 0 , i * h ) ; } this . _image = oImg ; }
run shading computation.
run shading computation .
// remember shading parameters