Browse Source

修改了StringHelper.php、Film.php、print.php三个文件

master
yuanjiajia 3 years ago
parent
commit
b483586947
  1. 9
      examples/print.php
  2. 85
      src/scene/Film.php
  3. 7
      src/utils/StringHelper.php

9
examples/print.php

@ -38,16 +38,9 @@ $filesaver = new FileSaver();
echo $filesaver; echo $filesaver;
$film = new Film();
$film->outputs[3]['index'] = '中国最牛';
echo $film;
*/ */
$img = new ImageSaverNumber();
$img = new Film();
echo $img; echo $img;

85
src/scene/Film.php

@ -54,84 +54,15 @@ class Film extends BaseCfg
public function __construct($config = []) public function __construct($config = [])
{ {
$this->noiseEstimation = new NoiseEstimation($config); $this->noiseEstimation = new NoiseEstimation($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->filter = new Filter($config);
$this->imagepipelines = [];
$this->outputs[] = new ImageSaverBase();
$this->outputs[] = new ImageSaverNumber();
//var_dump($this->outputs);
Base::__construct($config); Base::__construct($config);
} }

7
src/utils/StringHelper.php

@ -45,14 +45,17 @@ class StringHelper
{ {
$retStr[] = "{$key} = \"{$value}\""; $retStr[] = "{$key} = \"{$value}\"";
} }
} }
else if(is_object($value) && $value instanceof BaseCfg) else if(is_object($value) && $value instanceof BaseCfg)
{ {
foreach( explode("\n", $value->toString()) as $value ) foreach( explode("\n", $value->toString()) as $value )
{ {
if(!empty($value))$retStr[] = $value;
if(!empty($value))
{
$value = substr($value,strpos($value,'.'));
$retStr[] = "{$key}{$value}";
}
} }
} }
else else

Loading…
Cancel
Save