yuanjiajia
3 years ago
2 changed files with 97 additions and 2 deletions
@ -0,0 +1,95 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Remap extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:重映射(将一张输入的纹理重新映射) |
||||
|
*/ |
||||
|
const TYPE_REMAP = 'remap'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 输入源(颜色通道),一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $value = "0.5"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 源最小色值,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $sourcemin = "0"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 源最大色值,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $sourcemax = "1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 目标最小色值,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $targetmin = "0"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 目标最大色值,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $targetmax = "1"; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_REMAP; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道(输入源) |
||||
|
*/ |
||||
|
public function setTexture($color) |
||||
|
{ |
||||
|
$this->value = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置源最小色值 |
||||
|
*/ |
||||
|
public function setSourcemin($color) |
||||
|
{ |
||||
|
$this->sourcemin = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置源最大色值 |
||||
|
*/ |
||||
|
public function setSourcemax($color) |
||||
|
{ |
||||
|
$this->sourcemax = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置目标最小色值 |
||||
|
*/ |
||||
|
public function setTargetmin($color) |
||||
|
{ |
||||
|
$this->targetmin = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置目标最大色值 |
||||
|
*/ |
||||
|
public function setTargetmax($color) |
||||
|
{ |
||||
|
$this->targetmax = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue