Layer.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * This file is part of Jdenticon for PHP.
  4. * https://github.com/dmester/jdenticon-php/
  5. *
  6. * Copyright (c) 2025 Daniel Mester Pirttijärvi
  7. *
  8. * For full license information, please see the LICENSE file that was
  9. * distributed with this source code.
  10. */
  11. namespace Jdenticon\Canvas\Rasterization;
  12. class Layer
  13. {
  14. public int $polygonId;
  15. public int $color;
  16. public int $winding;
  17. public string $windingRule;
  18. public ?Layer $nextLayer = null;
  19. /**
  20. * Creates a new layer.
  21. *
  22. * @param int $polygonId Unique id for this layer.
  23. * @param int $color Color on the format 0xRRGGBBAA.
  24. * @param int $winding Differential winding value, either 1 or -1.
  25. * @param string $windingRule Winding rule for the polygon, either "evenodd" or "nonzero".
  26. */
  27. public function __construct(int $polygonId, int $color, int $winding, string $windingRule)
  28. {
  29. $this->polygonId = $polygonId;
  30. $this->color = $color;
  31. $this->winding = $winding;
  32. $this->windingRule = $windingRule;
  33. }
  34. }