public function __construct(ILazyBitmap $lbm, $red = 0, $green = 0, $blue = 0) { parent::__construct($lbm); if (min($red, $green, $blue) < 0 || max($red, $green, $blue) > 255) { throw new Exception('Colors must be in range from 0 to 255.'); } $this->pixel = new Pixel($red, $green, $blue); }
public function __construct(ILazyBitmap $lbm, $percent = 50) { parent::__construct($lbm); if ($percent < 0 || $percent > 100) { throw new Exception('Percents must be in range from 0 to 100.'); } $this->percent = $percent; }
public function __construct(ILazyBitmap $lbm, $difference) { $this->lbms = func_get_args(); parent::__construct(array_shift($this->lbms)); $this->difference = array_shift($this->lbms); foreach ($this->lbms as $lbm) { if (!$lbm instanceof ILazyBitmap) { throw new Exception('All arguments after \'$difference\' passed to ' . __METHOD__ . ' must implement interface LazyBitmap\\ILazyBitmap.'); } } }
public function __construct(ILazyBitmap $lbm, $method = NULL) { $this->lbms = func_get_args(); parent::__construct(array_shift($this->lbms)); $method = is_string($method) ? array_shift($this->lbms) : 'Normal'; $blend = 'LazyBitmap\\Effect\\Color\\Blend\\' . $method; $this->blend = new $blend($this->lbm); foreach ($this->lbms as $lbm) { if (!$lbm instanceof ILazyBitmap) { throw new Exception('All arguments passed to ' . __METHOD__ . ' must implement interface LazyBitmap\\ILazyBitmap.'); } } }
public function __construct(ILazyBitmap $lbm, $x, $y) { parent::__construct($lbm); $this->x = $x; $this->y = $y; }