Skip to content

Commit 813a92b

Browse files
committed
Wrap get_gainmap
1 parent 6959cc9 commit 813a92b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/vips/Image_methods.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,16 @@ function Image_method:remove(name)
497497
return vips_lib.vips_image_remove(self.vimage, name) ~= 0
498498
end
499499

500+
function Image_method:get_gainmap()
501+
collectgarbage("stop")
502+
local vimage = vips_lib.vips_image_get_gainmap(self.vimage)
503+
if vimage == ffi.NULL then
504+
return nil
505+
end
506+
507+
collectgarbage("restart")
508+
return Image.new(vimage)
509+
end
500510
-- standard header fields
501511

502512
function Image_method:width()

src/vips/cdefs.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ ffi.cdef [[
166166
// opaque
167167
} VipsImage;
168168

169+
VipsImage *vips_image_get_gainmap(VipsImage *image);
170+
169171
typedef struct _VipsConnection {
170172
VipsObject parent_instance;
171173

0 commit comments

Comments
 (0)