diff --git a/examples/print.php b/examples/print.php index ef5335d..636490a 100644 --- a/examples/print.php +++ b/examples/print.php @@ -38,16 +38,9 @@ $filesaver = new FileSaver(); echo $filesaver; - - -$film = new Film(); -$film->outputs[3]['index'] = '中国最牛'; - -echo $film; - */ -$img = new ImageSaverNumber(); +$img = new Film(); echo $img; diff --git a/src/scene/Film.php b/src/scene/Film.php index 2e70b36..01e9586 100644 --- a/src/scene/Film.php +++ b/src/scene/Film.php @@ -54,84 +54,15 @@ class Film extends BaseCfg public function __construct($config = []) { $this->noiseEstimation = new NoiseEstimation($config); - //$this->filter = new Filter($config); + $this->filter = new Filter($config); - $this->imagepipelines = array( - '000' =>array( - '0' => array( - new Filter($config), - ), - '1' => array( - 'type' => "TONEMAP_LINEAR", - 'scales' => 1 - ), - '2' => array( - 'type' => "GAMMA_CORRECTION", - 'value' => 2.2 - ), - 'radiancescales' => array( - '0' => array( - 'enabled' => 1, - 'globalscale' => 1, - 'rgbscale' => '1 1 1' - ) - ) - ), - - '001' =>array( - '0' => array( - 'type' => "BCD_DENOISER", - 'scales' => 3, - 'histdistthresh' => 1, - 'patchradius' => 1, - 'searchwindowradius' => 6, - 'filterspikes' => 0 - ), - '1' => array( - 'type' => "NOP" - ), - '2' => array( - 'type' => "TONEMAP_LINEAR", - 'scales' => 1 - ), - '3' => array( - 'type' => "GAMMA_CORRECTION", - 'value' => 2.2 - ), - 'radiancescales' => array( - '0' => array( - 'enabled' => 1, - 'globalscale' => 1, - 'rgbscale' => '0.99 0.5 0.8' - ) - ) - ) - ); - - $this->outputs = array( - '0' => array( - 'type' => 'RGB_IMAGEPIPELINE', - 'index' => 0, - 'filename' => 'RGB_IMAGEPIPELINE_0.png' - ), - - '1' => array( - 'type' => 'ALBEDO', - 'filename' => 'ALBEDO.exr' - ), - - '2' => array( - 'type' => 'AVG_SHADING_NORMAL', - 'filename' => 'AVG_SHADING_NORMAL.exr' - ), - - '3' => array( - 'type' => 'RGB_IMAGEPIPELINE', - 'index' => 1, - 'filename' => 'RGB_IMAGEPIPELINE_1.png' - ) - ); + $this->imagepipelines = []; + $this->outputs[] = new ImageSaverBase(); + $this->outputs[] = new ImageSaverNumber(); + + + //var_dump($this->outputs); Base::__construct($config); } diff --git a/src/utils/StringHelper.php b/src/utils/StringHelper.php index 67fed09..739a883 100644 --- a/src/utils/StringHelper.php +++ b/src/utils/StringHelper.php @@ -45,14 +45,17 @@ class StringHelper { $retStr[] = "{$key} = \"{$value}\""; } - } else if(is_object($value) && $value instanceof BaseCfg) { foreach( explode("\n", $value->toString()) as $value ) { - if(!empty($value))$retStr[] = $value; + if(!empty($value)) + { + $value = substr($value,strpos($value,'.')); + $retStr[] = "{$key}{$value}"; + } } } else