def set_image(self, image): """ Set an imlib2 image to the frambuffer. The size of the image must match the current framebuffer resolution. """ if (image.width, image.height) != fb.size(): raise AttributeError('Invalid image size') self.image = image
def size(self): """ Return the size of the framebuffer. """ return fb.size()
def __init__(self, mode=None): _Framebuffer.__init__(self, mode) import kaa.imlib2 self.image = kaa.imlib2.new(fb.size())