swf2ass/src/ass/blurEdgesTag.php

32 lines
767 B
PHP

<?php
namespace swf2ass\ass;
use swf2ass\Constants;
use swf2ass\StyleRecord;
class blurEdgesTag implements ASSStyleTag {
private int $strength;
public function __construct(int $strength = 0) {
$this->strength = $strength;
}
public function transitionStyleRecord(StyleRecord $record): ?blurEdgesTag {
return self::fromStyleRecord($record);
}
public function encode(): string {
return "\\be{$this->strength}";
}
public static function fromStyleRecord(StyleRecord $record): ?blurEdgesTag {
//TODO?
return new blurEdgesTag(0);
}
public function equals(ASSTag $tag): bool {
return $tag instanceof $this and abs($this->strength - $tag->strength) <= Constants::EPSILON;
}
}