@@ -500,7 +500,7 @@ class Image extends ImageAutodoc implements \ArrayAccess
500
500
*/
501
501
public function __construct (\FFI \CData $ pointer )
502
502
{
503
- $ this ->pointer = \ FFI ::cast (FFI ::ctypes ("VipsImage " ), $ pointer );
503
+ $ this ->pointer = FFI ::vips ()-> cast (FFI ::ctypes ("VipsImage " ), $ pointer );
504
504
parent ::__construct ($ pointer );
505
505
}
506
506
@@ -807,7 +807,7 @@ public static function newFromArray(
807
807
$ width = count ($ array [0 ]);
808
808
809
809
$ n = $ width * $ height ;
810
- $ a = \ FFI ::new ("double[ $ n] " , true , true );
810
+ $ a = FFI ::vips ()-> new ("double[ $ n] " , true , true );
811
811
for ($ y = 0 ; $ y < $ height ; $ y ++) {
812
812
for ($ x = 0 ; $ x < $ width ; $ x ++) {
813
813
$ a [$ x + $ y * $ width ] = $ array [$ y ][$ x ];
@@ -921,7 +921,9 @@ public function newFromImage($value): Image
921
921
*/
922
922
public static function findLoadSource (Source $ source ): ?string
923
923
{
924
- return FFI ::vips ()->vips_foreign_find_load_source (\FFI ::cast (FFI ::ctypes ('VipsSource ' ), $ source ->pointer ));
924
+ return FFI ::vips ()->vips_foreign_find_load_source (
925
+ FFI ::vips ()->cast (FFI ::ctypes ('VipsSource ' ), $ source ->pointer )
926
+ );
925
927
}
926
928
927
929
/**
@@ -1043,7 +1045,7 @@ public function writeToBuffer(string $suffix, array $options = []): string
1043
1045
*/
1044
1046
public function writeToMemory (): string
1045
1047
{
1046
- $ p_size = \ FFI ::new ("size_t[1] " );
1048
+ $ p_size = FFI ::vips ()-> new ("size_t[1] " );
1047
1049
1048
1050
$ pointer = FFI ::vips ()->
1049
1051
vips_image_write_to_memory ($ this ->pointer , $ p_size );
@@ -1084,7 +1086,7 @@ public function writeToMemory(): string
1084
1086
*/
1085
1087
public function writeToArray (): array
1086
1088
{
1087
- $ p_size = \ FFI ::new ("size_t[1] " );
1089
+ $ p_size = FFI ::vips ()-> new ("size_t[1] " );
1088
1090
1089
1091
$ pointer = FFI ::vips ()->
1090
1092
vips_image_write_to_memory ($ this ->pointer , $ p_size );
@@ -1095,7 +1097,7 @@ public function writeToArray(): array
1095
1097
// wrap pointer up as a C array of the right type
1096
1098
$ type_name = FFI ::ftypes ($ this ->format );
1097
1099
$ n = $ this ->width * $ this ->height * $ this ->bands ;
1098
- $ array = \ FFI ::cast ("{$ type_name }[ $ n] " , $ pointer );
1100
+ $ array = FFI ::vips ()-> cast ("{$ type_name }[ $ n] " , $ pointer );
1099
1101
1100
1102
// copy to PHP memory as a flat array
1101
1103
$ result = [];
0 commit comments