class documentation
class Framebuffer:
Get access to the framebuffer at a Context.
| Method | __init__ |
To get a Framebuffer from a Context use Context.framebuffer. |
| Method | __repr__ |
Returns the "official" string representation of this instance. |
| Method | __str__ |
Returns the nicely printable string representation of this instance. |
| Method | image |
Get a screenshot from the Context. |
| Property | memory |
Get the MemoryRange of PhysicalAddresses used by the framebuffer. |
| Method | _read |
Read the framebuffer data from the memory into a bytearray. |
| Instance Variable | _context |
Undocumented |
| Instance Variable | _fb |
Undocumented |
| Property | _display |
The framebuffer display size in pixels, as a tuple (width, height). |
| Property | _pil |
Get the decoder mode for PIL.Image.frombytes or None if the mode is not supported. |
def __init__(self, context):
To get a Framebuffer from a Context use Context.framebuffer.
Examples
>>> fb = trace.first_context.framebuffer >>> image = fb.image() >>> image.show() >>> image.save("/tmp/framebuffer.png")
Information
| Parameters | |
context:_Context | Context from the trace. |
| Raises | |
RuntimeError | if the framebuffer information is missing. |
RuntimeError | if the framebuffer is in text mode. |
def __repr__(self):
Returns the "official" string representation of this instance.
| Returns | |
str | Undocumented |
def __str__(self):
Returns the nicely printable string representation of this instance.
| Returns | |
str | Undocumented |
def image(self):
Get a screenshot from the Context.
Read the framebuffer content from the memory to generate an image.
Examples
>>> image = trace.first_context.framebuffer.image() >>> # display the image in a Jupyter Notebook >>> display(image) >>> # save the image to a file >>> image.save("/tmp/framebuffer.png") >>> # open the image in the system image viewer >>> image.show()
Information
| Returns | |
PIL.Image.Image | a screenshot from the trace as a RGB PIL.Image.Image |
| Raises | |
RuntimeError | if the framebuffer mode is not supported. |
RuntimeError | if the memory cannot be read. |
def _read_raw_data(self):
Read the framebuffer data from the memory into a bytearray.
| Returns | |
bytearray | Undocumented |
| Raises | |
RuntimeError | if the memory cannot be read. |