Issues (331)

examples/bilevel-image.php (3 issues)

Labels
Severity
1
<?php
2
3
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...
4
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...
5
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...
6
7
$width = 12;
8
$height = 4;
9
$string = '';
10
11
$surface = new Image(ImageFormat::ARGB32, $width, $height);
12
$context = new Context($surface);
13
14
$s = new Image(ImageFormat::ARGB32, $width, $height);
15
$stride = $s->getStride();
16
17
for ($i = 0; $i < 12; $i++)
18
{
19
	$string = $string.chr(0x00); // blue
20
	$string = $string.chr(0x00); // green
21
	$string = $string.chr(0xff); // red
22
	$string = $string.chr(0xff); // alpha
23
	$string = $string.chr(0x00);
24
	$string = $string.chr(0xff);
25
	$string = $string.chr(0x00);
26
	$string = $string.chr(0xff);
27
	$string = $string.chr(0xff);
28
	$string = $string.chr(0x00);
29
	$string = $string.chr(0x00);
30
	$string = $string.chr(0xff);
31
	$string = $string.chr(0xff);
32
	$string = $string.chr(0xff);
33
	$string = $string.chr(0xff);
34
	$string = $string.chr(0xff);
35
}
36
37
$s->createForData($string, ImageFormat::ARGB32, $width, $height);
38
$context->setSourceRgb(1, 1, 1);
39
$context->paint();
40
41
$context->setSurface($s, 0, 0);
42
$context->paint();
43
$surface->writeToPng(dirname(__FILE__).'/bilevel-image-php.png');
44