예제 #1
0
파일: __init__.py 프로젝트: theFong/pywebp
 def from_buffer(buf):
     ptr = ffi.new('WebPData*')
     lib.WebPDataInit(ptr)
     data_ref = ffi.from_buffer(buf)
     ptr.size = len(buf)
     ptr.bytes = ffi.cast('uint8_t*', data_ref)
     return WebPData(ptr, data_ref)
예제 #2
0
파일: __init__.py 프로젝트: theFong/pywebp
 def __init__(self):
     self.ptr = ffi.new('WebPData*')
     lib.WebPDataInit(self.ptr)