芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/xmintal-back/vendor/imagine/imagine/src/Image/Histogram/Bucket.php
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Imagine\Image\Histogram; /** * Bucket histogram. */ final class Bucket implements \Countable { /** * @var \Imagine\Image\Histogram\Range */ private $range; /** * @var int */ private $count; /** * @param \Imagine\Image\Histogram\Range $range * @param int $count */ public function __construct(Range $range, $count = 0) { $this->range = $range; $this->count = $count; } /** * @param int $value * * @return $this */ public function add($value) { if ($this->range->contains($value)) { $this->count++; } return $this; } /** * Get the number of elements in the bucket. * * @return int */ #[\ReturnTypeWillChange] public function count() { return $this->count; } }