def _marshal_write(source_custom, pointer, length, handle): buf = ffi.buffer(pointer, length) callback = ffi.from_handle(handle) return callback(buf)
def _marshal_image_progress(vi, pointer, handle): gobject_lib.g_object_ref(vi) image = pyvips.Image(vi) callback = ffi.from_handle(handle) progress = ffi.cast('VipsProgress*', pointer) callback(image, progress)
def _marshal_seek(source_custom, offset, whence, handle): callback = ffi.from_handle(handle) return callback(offset, whence)
def _marshal_finish(source_custom, handle): callback = ffi.from_handle(handle) callback()