33 lines
819 B
PHP
33 lines
819 B
PHP
<?php
|
|
|
|
namespace swf2ass\ass;
|
|
|
|
use swf2ass\Constants;
|
|
use swf2ass\StyleRecord;
|
|
|
|
class blurEdgesGaussianTag implements ASSStyleTag {
|
|
|
|
/** @var int|float */
|
|
private $strength;
|
|
|
|
public function __construct($strength = 0) {
|
|
$this->strength = $strength;
|
|
}
|
|
|
|
public function transitionStyleRecord(StyleRecord $record): ?blurEdgesGaussianTag {
|
|
return self::fromStyleRecord($record);
|
|
}
|
|
|
|
public function encode(): string {
|
|
return "\\blur{$this->strength}";
|
|
}
|
|
|
|
public static function fromStyleRecord(StyleRecord $record): ?blurEdgesGaussianTag {
|
|
//TODO?
|
|
return new blurEdgesGaussianTag(0);
|
|
}
|
|
|
|
public function equals(ASSTag $tag): bool {
|
|
return $tag instanceof $this and abs($this->strength - $tag->strength) <= Constants::EPSILON;
|
|
}
|
|
} |