rpi_fb_capture v0.3.0 RpiFbCapture View Source
Capture the Raspberry Pi's frame buffer
Link to this section Summary
Functions
Return the name of the active capture backend
Capture the screen in the specified format.
Returns a specification to start this module under a supervisor.
Helper method for saving a screen capture to a file
Set dithering algorithm.
Adjust the value that pixels are on for monochromatic conversion.
Start up the capture process
Stop the capture process
Link to this section Types
dithering()
View Sourcedithering() :: :none | :floyd_steinberg | :sierra | :sierra_2row | :sierra_lite
format()
View Sourceformat() :: :ppm | :rgb24 | :rgb565 | :mono | :mono_column_scan
option()
View Sourceoption() ::
{:width, non_neg_integer()}
| {:height, non_neg_integer()}
| {:display, non_neg_integer()}
Link to this section Functions
Return the name of the active capture backend
Example backend names:
"sim"for the simulator"dispmanx"for the Raspberry Pi"unknown"if the backend hasn't reported its name
capture(server, format)
View Sourcecapture(GenServer.server(), format()) :: {:ok, RpiFbCapture.Capture.t()} | {:error, atom()}
Capture the screen in the specified format.
Formats include:
:ppm- PPM-formatted data:rgb24- Raw 24-bit RGB data 8-bits R, G, then B:rgb565- Raw 16-bit data 5-bits R, 6-bits G, 5-bits B:mono- Raw 1-bpp data:mono_column_scan- Raw 1-bpp data, but scanned down columns
Returns a specification to start this module under a supervisor.
See Supervisor.
save(server, path, format \\ :ppm)
View Sourcesave(GenServer.server(), Path.t(), format()) :: :ok | {:error, atom()}
Helper method for saving a screen capture to a file
Example:
iex> {:ok, cap} = RpiFbCapture.start_link()
iex> RpiRbCapture(cap, "/tmp/capture.ppm")
:ok
set_dithering(server, algorithm)
View Sourceset_dithering(GenServer.server(), dithering()) :: :ok | {:error, atom()}
Set dithering algorithm.
Algorithms include:
:none- No dithering applied:floyd_steinberg- Floyd–Steinberg:sierra- Sierra (also called Sierra-3):sierra_2row- Two-row Sierra:sierra_lite- Sierra Lite
set_mono_threshold(server, threshold)
View Sourceset_mono_threshold(GenServer.server(), byte()) :: :ok | {:error, atom()}
Adjust the value that pixels are on for monochromatic conversion.
The threshold should be 8-bits. The capture buffer is rgb565, so the threshold will be reduced to 5 or 6 bits for the actual comparisons.
Start up the capture process
NOTE: The Raspberry Pi capture hardware has limitations on the window size. In general, capturing the whole display is fine. Keeping the width as a multiple of 16 appears to be good.
Options:
:width- the width of the capture window (0 for the display width):height- the height of the capture window (0 for the display width):display- which display to capture (defaults to 0)
Stop the capture process