Skip to content

Commit 1364a52

Browse files
committed
Interpolate.new_from_name -> Interpolate.new
1 parent 9b3a9e8 commit 1364a52

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

spec/interpolate_spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe("image interpolation", function()
77
end)
88

99
it("can rotate an image using nearest interpolator", function()
10-
local interpolate = vips.Interpolate.new_from_name("nearest")
10+
local interpolate = vips.Interpolate.new("nearest")
1111
local original = {
1212
{ 1, 2, 3 },
1313
{ 4, 5, 6 },

src/vips/Interpolate.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@ Interpolate.vobject = function(self)
1313
return ffi.cast(vobject.typeof, self)
1414
end
1515

16-
Interpolate.new = function(self)
17-
return vobject.new(self)
18-
end
19-
20-
Interpolate.new_from_name = function(name)
16+
Interpolate.new = function(name)
2117
-- there could potentially be other params here, but ignore that for now
2218
local interpolate = vips_lib.vips_interpolate_new(name)
2319
if interpolate == nil then
2420
error("no such interpolator\n" .. verror.get())
2521
end
2622

27-
return Interpolate.new(interpolate)
23+
return vobject.new(interpolate)
2824
end
2925

3026
return ffi.metatype("VipsInterpolate", {

0 commit comments

Comments
 (0)