Issues (331)

examples/mask-surface-ctm.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
$data = '';
8
9
$surface = new Image(ImageFormat::ARGB32, 10, 10);
10
$context = new Context($surface);
11
12
for ($i = 0; $i < 4; $i++)
13
{
14
	$data = $data.chr(0x80);
15
	$data = $data.chr(0x00);
16
	$data = $data.chr(0x00);
17
	$data = $data.chr(0x00);
18
}
19
20
$s = new Image(ImageFormat::ARGB32, 1, 1);
21
$s->createForData($data, ImageFormat::ARGB32, 2, 2, 8);
22
23
$context->setSourceRgb(1, 0, 0);
24
$context->save();
25
$context->translate(2, 2);
26
$context->maskSurface($s, 0, 0);
27
$context->restore();
28
$context->maskSurface($s, 4, 4);
29
$context->translate(2, 2);
30
$context->maskSurface($s, 4, 4);
31
32
$surface->writeToPng(dirname(__FILE__).'/mask-surface-ctm-php.png');
33