1 | <?php |
||
2 | |||
3 | use Cairo\Context; |
||
0 ignored issues
–
show
|
|||
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
6 | |||
7 | $width = 10; |
||
8 | $height = 8; |
||
9 | $string = ''; |
||
10 | |||
11 | $surface = new Image(ImageFormat::ARGB32, $width, $height); |
||
12 | $context = new Context($surface); |
||
13 | |||
14 | $s = new Image(ImageFormat::A1, $width, $height); |
||
15 | $stride = $s->getStride(); |
||
16 | |||
17 | echo 'Stride: '.$stride.PHP_EOL; |
||
18 | |||
19 | for ($i = 0; $i < 8; $i++) |
||
20 | { |
||
21 | $string = $string.chr(0x14); |
||
22 | $string = $string.chr(0xAA); |
||
23 | } |
||
24 | |||
25 | echo $string; |
||
26 | |||
27 | $s->createForData($string, ImageFormat::A1, $width, $height); |
||
28 | |||
29 | $context->setSourceRgb(0, 0, 1); |
||
30 | $context->paint(); |
||
31 | $context->setSourceRgb(1, 0, 0); |
||
32 | $context->maskSurface($s, 0, 0); |
||
33 | |||
34 | $surface->writeToPng(dirname(__FILE__).'/a1-mask-php.png'); |
||
35 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths