class documentation

class Framebuffer:

View In Hierarchy

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_range Get the MemoryRange of PhysicalAddresses used by the framebuffer.
Method _read_raw_data Read the framebuffer data from the memory into a bytearray.
Instance Variable _context Undocumented
Instance Variable _fb Undocumented
Property _display_size The framebuffer display size in pixels, as a tuple (width, height).
Property _pil_decoder_mode 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:_ContextContext from the trace.
Raises
RuntimeErrorif the framebuffer information is missing.
RuntimeErrorif the framebuffer is in text mode.
def __repr__(self):

Returns the "official" string representation of this instance.

Returns
strUndocumented
def __str__(self):

Returns the nicely printable string representation of this instance.

Returns
strUndocumented
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.Imagea screenshot from the trace as a RGB PIL.Image.Image
Raises
RuntimeErrorif the framebuffer mode is not supported.
RuntimeErrorif the memory cannot be read.
@property
memory_range: _MemoryRange =

Get the MemoryRange of PhysicalAddresses used by the framebuffer.

def _read_raw_data(self):

Read the framebuffer data from the memory into a bytearray.

Returns
bytearrayUndocumented
Raises
RuntimeErrorif the memory cannot be read.
_context =

Undocumented

_fb =

Undocumented

@property
_display_size: tuple[int, int] =

The framebuffer display size in pixels, as a tuple (width, height).

@property
_pil_decoder_mode: _Optional[str] =

Get the decoder mode for PIL.Image.frombytes or None if the mode is not supported.