Issues (331)

examples/a1-image-sample.php (5 issues)

Labels
Severity
1
<?php
2
3
use Cairo\Antialias;
0 ignored issues
show
The type Cairo\Antialias was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
4
use Cairo\Context;
0 ignored issues
show
The type Cairo\Context was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
5
use Cairo\Filter;
0 ignored issues
show
The type Cairo\Filter was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Cairo\Surface\Image;
0 ignored issues
show
The type Cairo\Surface\Image was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Cairo\Surface\ImageFormat;
0 ignored issues
show
The type Cairo\Surface\ImageFormat was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
9
$points = 10;
10
$step = 1.0 / $points;
11
$pad = 1;
12
$width = ($pad + ($points * 2) + $pad);
13
$height = $width;
14
15
$surface = new Image(ImageFormat::ARGB32, $width, $height);
16
$context = new Context($surface);
17
$context->setSourceRgb(1, 1, 1);
18
$context->paint();
19
$context->setSourceRgb(0, 0, 0);
20
$context->translate($pad, $pad);
21
$context->setAntialias(Antialias::NONE);
22
23
$s = new Image(ImageFormat::ARGB32, 1, 1);
24
$c = new Context($s);
25
$c->setSourceRgb(0, 0, 0);
26
$c->paint();
27
28
for ($i = 0; $i < $points; $i++)
29
{
30
	for ($j = 0; $j < $points; $j++)
31
	{
32
		$t1 = (2 * $i) + (($i + 1) * $step);
33
		$t2 = (2 * $j) + (($j + 1) * $step);
34
		
35
		$context->setSurface($s, $t1, $t2);
36
		$source = $context->getPattern();
37
		$source->setFilter(Filter::NEAREST);
38
		$context->paint();
39
	}
40
}
41
42
$surface->writeToPng(dirname(__FILE__).'/a1-image-sample-php.png');
43