swen100 /
cairo
| 1 | <?php |
||
| 2 | |||
| 3 | use Cairo\Context; |
||
|
0 ignored issues
–
show
|
|||
| 4 | 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. 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\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 Loading history...
|
|||
| 6 | 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 Loading history...
|
|||
| 7 | |||
| 8 | $surface = new Image(ImageFormat::ARGB32, 12, 12); |
||
| 9 | $context = new Context($surface); |
||
| 10 | |||
| 11 | $data = ''; |
||
| 12 | |||
| 13 | for ($i = 0; $i < 2; $i++) |
||
| 14 | { |
||
| 15 | $data .= chr(0xff); |
||
| 16 | $data .= chr(0xff); |
||
| 17 | $data .= chr(0xff); |
||
| 18 | $data .= chr(0xff); |
||
| 19 | |||
| 20 | $data .= chr(0xff); |
||
| 21 | $data .= chr(0xff); |
||
| 22 | $data .= chr(0xff); |
||
| 23 | $data .= chr(0xff); |
||
| 24 | |||
| 25 | $data .= chr(0x00); |
||
| 26 | $data .= chr(0x00); |
||
| 27 | $data .= chr(0xff); |
||
| 28 | $data .= chr(0xff); |
||
| 29 | |||
| 30 | $data .= chr(0x00); |
||
| 31 | $data .= chr(0x00); |
||
| 32 | $data .= chr(0xff); |
||
| 33 | $data .= chr(0xff); |
||
| 34 | } |
||
| 35 | |||
| 36 | for ($i = 0; $i < 2; $i++) |
||
| 37 | { |
||
| 38 | $data .= chr(0x00); |
||
| 39 | $data .= chr(0xff); |
||
| 40 | $data .= chr(0x00); |
||
| 41 | $data .= chr(0xff); |
||
| 42 | |||
| 43 | $data .= chr(0x00); |
||
| 44 | $data .= chr(0xff); |
||
| 45 | $data .= chr(0x00); |
||
| 46 | $data .= chr(0xff); |
||
| 47 | |||
| 48 | $data .= chr(0xff); |
||
| 49 | $data .= chr(0x00); |
||
| 50 | $data .= chr(0x00); |
||
| 51 | $data .= chr(0xff); |
||
| 52 | |||
| 53 | $data .= chr(0xff); |
||
| 54 | $data .= chr(0x00); |
||
| 55 | $data .= chr(0x00); |
||
| 56 | $data .= chr(0xff); |
||
| 57 | } |
||
| 58 | |||
| 59 | echo $data; |
||
| 60 | |||
| 61 | $s = new Image(ImageFormat::ARGB32, 100, 100); |
||
| 62 | $s->createForData($data, ImageFormat::RGB24, 4, 4, 16); |
||
| 63 | $context->scale(2, 2); |
||
| 64 | $context->setSurface($s, 1, 1); |
||
| 65 | $pat = $context->getPattern(); |
||
| 66 | $pat->setFilter(Filter::NEAREST); |
||
| 67 | $context->paint(); |
||
| 68 | |||
| 69 | $surface->writeToPng(dirname(__FILE__).'/scale-source-surface-paint-php.png'); |
||
| 70 |
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