File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ local vips = {
22
22
vobject = require " vips.vobject" ,
23
23
voperation = require " vips.voperation" ,
24
24
Image = require " vips.Image_methods" ,
25
+ Image = require " vips.Interpolate" ,
25
26
}
26
27
27
28
function vips .leak_set (leak )
Original file line number Diff line number Diff line change
1
+ -- make image interpolators, see affine
2
+
3
+ local ffi = require " ffi"
4
+
5
+ local verror = require " vips.verror"
6
+ local vobject = require " vips.vobject"
7
+
8
+ local vips_lib = ffi .load (ffi .os == " Windows" and " libvips-42.dll" or " vips" )
9
+
10
+ local Interpolate = {}
11
+
12
+ Interpolate .vobject = function (self )
13
+ return ffi .cast (vobject .typeof , self )
14
+ end
15
+
16
+ Interpolate .new = function (self )
17
+ return vobject .new (self )
18
+ end
19
+
20
+ Interpolate .new_from_name = function (name )
21
+ -- there could potentially be other params here, but ignore that for now
22
+ local interpolate = vips_lib .vips_interpolate_new (name )
23
+ if interpolate == nil then
24
+ error (" no such interpolator\n " .. verror .get ())
25
+ end
26
+
27
+ return Interpolate .new (interpolate )
28
+ end
29
+
30
+ return ffi .metatype (" Interpolate" , {
31
+ __index = Interpolate
32
+ })
33
+
34
+
Original file line number Diff line number Diff line change @@ -188,6 +188,8 @@ ffi.cdef [[
188
188
// opaque
189
189
} VipsOperation;
190
190
191
+ VipsInterpolate *vips_interpolate_new (const char * name );
192
+
191
193
VipsOperation *vips_operation_new (const char * name );
192
194
193
195
typedef void * (*VipsArgumentMapFn) (VipsOperation *object,
You can’t perform that action at this time.
0 commit comments