LSAPI

Laser Studio can be controlled using a REST API.

A Python package is provided to support some instructions.

class laserstudio.lsapi.LSAPI(host='localhost', port: int | None = None)
camera(path: str | None = None) Image | None

Returns the raw image of the camera.

Parameters:

path – If not None, laser studio will save the image at given path on HOST machine.

Returns:

The PIL Image in PNG format if the request is about getting the image data. Otherwise, it returns None.

go_next() dict

Jump to next scan position.

Returns:

A dictionary giving the details about the go_next

screenshot(path: str | None = None) Image | None

Takes a screenshot of the current view of laser studio’s scene.

Parameters:

path – If not None, laser studio will save the image at given path on HOST machine.

Returns:

The PIL Image in PNG format if the request is about getting the image data. Otherwise, it returns nothing.