diff --git a/examples/print.php b/examples/print.php index 061fd88..06e5021 100644 --- a/examples/print.php +++ b/examples/print.php @@ -27,13 +27,20 @@ echo $path; $sampler = new Sampler(['imagemutationrate' => 0.888]); $sampler->random->overlapping = 32; echo $sampler; + + +$lightStrategy = new LightStrategy(); +echo $lightStrategy; + */ +$filesaver = new FileSaver(); + +echo $filesaver; -$film = new Film(); -echo "$film\n"; +$film = new Film(); $film->outputs[3]['index'] = '中国最牛'; echo $film; diff --git a/src/scene/BaseCfg.php b/src/scene/BaseCfg.php index 9191c71..b6989d2 100644 --- a/src/scene/BaseCfg.php +++ b/src/scene/BaseCfg.php @@ -30,7 +30,6 @@ class BaseCfg extends Base $object = new \ReflectionClass($this); $properties = $object->getProperties(); - //var_dump($properties); //获取类名 -> 去除命名空间 -> 转成全小写 @@ -40,6 +39,7 @@ class BaseCfg extends Base $className = "{$parentClassName}.$className"; } + $ret = ""; foreach ($properties as $item) { @@ -51,7 +51,7 @@ class BaseCfg extends Base $name = implode(".", array_map('strtolower', StringHelper::camelStrToArray($name))); $value = $item->getValue($this); - if (is_string($value)) + if (is_string($value)) { $ret .= "{$className}.{$name} = \"{$value}\"\n"; } @@ -64,7 +64,7 @@ class BaseCfg extends Base $value = $value ? 1 : 0; $ret .= "{$className}.{$name} = {$value}\n"; } - else if (is_object($value) && $value instanceof BaseCfg) + else if (is_object($value) && $value instanceof BaseCfg) { $ret .= $value->toString($className); } diff --git a/src/scene/FileSaver.php b/src/scene/FileSaver.php new file mode 100644 index 0000000..e6b3bf9 --- /dev/null +++ b/src/scene/FileSaver.php @@ -0,0 +1,20 @@ + diff --git a/src/scene/Film.php b/src/scene/Film.php index 81a274d..dcf51c4 100644 --- a/src/scene/Film.php +++ b/src/scene/Film.php @@ -54,12 +54,12 @@ 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( - 'type' => "NOP", + new Filter($config), ), '1' => array( 'type' => "TONEMAP_LINEAR", @@ -106,9 +106,8 @@ class Film extends BaseCfg ) ) ) - ); - - + ); + $this->outputs = array( '0' => array( 'type' => 'RGB_IMAGEPIPELINE', diff --git a/src/scene/Filter.php b/src/scene/Filter.php index f9222ff..e8f1ab2 100644 --- a/src/scene/Filter.php +++ b/src/scene/Filter.php @@ -1,7 +1,6 @@ toString()) as $value ) + { + if(!empty($value))$retStr[] = $value; + } + } else { - $retStr[] = "{$key} = {$value}"; + $retStr[] = "{$key} = {$value}"; } } return $retStr;