From b48358694744e965ed49d5f9b75c88a9e94e2357 Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Sun, 13 Feb 2022 23:56:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86StringHelper.php?= =?UTF-8?q?=E3=80=81Film.php=E3=80=81print.php=E4=B8=89=E4=B8=AA=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/print.php | 9 +---- src/scene/Film.php | 83 ++++---------------------------------- src/utils/StringHelper.php | 7 +++- 3 files changed, 13 insertions(+), 86 deletions(-) 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