ScaleUpBenchmark.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. use Mike42\GfxPhp\BlackAndWhiteRasterImage;
  3. use Mike42\GfxPhp\GrayscaleRasterImage;
  4. use Mike42\GfxPhp\IndexedRasterImage;
  5. use Mike42\GfxPhp\RgbRasterImage;
  6. /**
  7. * @BeforeMethods({"init"})
  8. * @Revs(10)
  9. */
  10. class ScaleUpBenchmark
  11. {
  12. private static $bw10;
  13. private static $rgb10;
  14. private static $indexed10;
  15. private static $gray10;
  16. public function init()
  17. {
  18. self::$bw10 = BlackAndWhiteRasterImage::create(10, 10);
  19. self::$rgb10 = RgbRasterImage::create(10, 10);
  20. self::$indexed10 = IndexedRasterImage::create(10, 10);
  21. self::$gray10 = GrayscaleRasterImage::create(10, 10);
  22. }
  23. /**
  24. * @Subject
  25. */
  26. public function scaleUpBw()
  27. {
  28. self::$bw10->scale(100, 100);
  29. }
  30. /**
  31. * @Subject
  32. */
  33. public function scaleUpGrayscale()
  34. {
  35. self::$gray10->scale(100, 100);
  36. }
  37. /**
  38. * @Subject
  39. */
  40. public function scaleUpIndexed()
  41. {
  42. self::$indexed10->scale(100, 100);
  43. }
  44. /**
  45. * @Subject
  46. */
  47. public function scaleUpRgb()
  48. {
  49. self::$rgb10->scale(100, 100);
  50. }
  51. }