recreate project

This commit is contained in:
root
2026-02-10 22:11:06 -05:00
commit 663c0cdbda
10149 changed files with 1379710 additions and 0 deletions
@@ -0,0 +1,151 @@
<?php
use Mike42\GfxPhp\Image;
/**
* @BeforeMethods({"init"})
* @Revs(1000)
*/
class ConvertRasterImageBenchmark
{
private static $bw100;
private static $gray100;
private static $indexed100;
private static $rgb100;
public function init()
{
self::$rgb100 = Image::fromFile(__DIR__ . "/../../resources/pngsuite/z09n2c08.png");
self::$bw100 = self::$rgb100 -> toBlackAndWhite();
self::$indexed100 = self::$rgb100 -> toIndexed();
self::$gray100 = self::$rgb100 -> toGrayscale();
}
/**
* @Subject
*/
public function convertBwToBw()
{
self::$bw100->toBlackAndWhite();
}
/**
* @Subject
*/
public function convertBwToGray()
{
self::$bw100->toGrayscale();
}
/**
* @Subject
*/
public function convertBwToIndexed()
{
self::$bw100->toIndexed();
}
/**
* @Subject
*/
public function convertBwToRgb()
{
self::$bw100->toRgb();
}
/**
* @Subject
*/
public function convertGrayToBw()
{
self::$gray100->toBlackAndWhite();
}
/**
* @Subject
*/
public function convertGrayToGray()
{
self::$gray100->toGrayscale();
}
/**
* @Subject
*/
public function convertGrayToIndexed()
{
self::$gray100->toIndexed();
}
/**
* @Subject
*/
public function convertGrayToRgb()
{
self::$gray100->toRgb();
}
/**
* @Subject
*/
public function convertIndexedToBw()
{
self::$indexed100->toBlackAndWhite();
}
/**
* @Subject
*/
public function convertIndexedToGray()
{
self::$indexed100->toGrayscale();
}
/**
* @Subject
*/
public function convertIndexedToIndexed()
{
self::$indexed100->toIndexed();
}
/**
* @Subject
*/
public function convertIndexedToRgb()
{
self::$indexed100->toRgb();
}
/**
* @Subject
*/
public function convertRgbToBw()
{
self::$rgb100->toBlackAndWhite();
}
/**
* @Subject
*/
public function convertRgbToGray()
{
self::$rgb100->toGrayscale();
}
/**
* @Subject
*/
public function convertRgbToIndexed()
{
self::$rgb100->toIndexed();
}
/**
* @Subject
*/
public function convertRgbToRgb()
{
self::$rgb100->toRgb();
}
}
@@ -0,0 +1,58 @@
<?php
use Mike42\GfxPhp\BlackAndWhiteRasterImage;
use Mike42\GfxPhp\GrayscaleRasterImage;
use Mike42\GfxPhp\IndexedRasterImage;
use Mike42\GfxPhp\RgbRasterImage;
/**
* @BeforeMethods({"init"})
* @Revs(10000)
*/
class ScaleDownBenchmark
{
private static $bw100;
private static $rgb100;
private static $indexed100;
private static $gray100;
public function init()
{
self::$bw100 = BlackAndWhiteRasterImage::create(100, 100);
self::$rgb100 = RgbRasterImage::create(100, 100);
self::$indexed100 = IndexedRasterImage::create(100, 100);
self::$gray100 = GrayscaleRasterImage::create(100, 100);
}
/**
* @Subject
*/
public function scaleDownBw()
{
self::$bw100->scale(10, 10);
}
/**
* @Subject
*/
public function scaleDownGrayscale()
{
self::$gray100->scale(10, 10);
}
/**
* @Subject
*/
public function scaleDownIndexed()
{
self::$indexed100->scale(10, 10);
}
/**
* @Subject
*/
public function scaleDownRgb()
{
self::$rgb100->scale(10, 10);
}
}
@@ -0,0 +1,58 @@
<?php
use Mike42\GfxPhp\BlackAndWhiteRasterImage;
use Mike42\GfxPhp\GrayscaleRasterImage;
use Mike42\GfxPhp\IndexedRasterImage;
use Mike42\GfxPhp\RgbRasterImage;
/**
* @BeforeMethods({"init"})
* @Revs(10)
*/
class ScaleUpBenchmark
{
private static $bw10;
private static $rgb10;
private static $indexed10;
private static $gray10;
public function init()
{
self::$bw10 = BlackAndWhiteRasterImage::create(10, 10);
self::$rgb10 = RgbRasterImage::create(10, 10);
self::$indexed10 = IndexedRasterImage::create(10, 10);
self::$gray10 = GrayscaleRasterImage::create(10, 10);
}
/**
* @Subject
*/
public function scaleUpBw()
{
self::$bw10->scale(100, 100);
}
/**
* @Subject
*/
public function scaleUpGrayscale()
{
self::$gray10->scale(100, 100);
}
/**
* @Subject
*/
public function scaleUpIndexed()
{
self::$indexed10->scale(100, 100);
}
/**
* @Subject
*/
public function scaleUpRgb()
{
self::$rgb10->scale(100, 100);
}
}