Create.php 628 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace Gregwar\Image\Source;
  3. /**
  4. * Creates a new image from scratch.
  5. */
  6. class Create extends Source
  7. {
  8. protected $width;
  9. protected $height;
  10. public function __construct($width, $height)
  11. {
  12. $this->width = $width;
  13. $this->height = $height;
  14. }
  15. public function getWidth()
  16. {
  17. return $this->width;
  18. }
  19. public function getHeight()
  20. {
  21. return $this->height;
  22. }
  23. public function getInfos()
  24. {
  25. return array($this->width, $this->height);
  26. }
  27. public function correct()
  28. {
  29. return $this->width > 0 && $this->height > 0;
  30. }
  31. }