Picam v0.4.1 Picam.FakeCamera View Source
A fake version of Picam.Camera
that can be used in test and development
when a real Raspberry Pi Camera isn't available.
All the normal configuration commands are accepted and silently ignored, except that:
size
can be set to one of 1920x1080, 1280x720, or 640x480. This will result in a static image of that size being displayed on each frame.fps
can be set, which will result in the static images being displayed at roughtly the requested rate.
In addition, a custom image can be set using set_image/1
, which is be
displayed on each frame until a new image is set or the size
is changed.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Set the image that is being displayed by the fake camera on each frame. This is intended for development or testing things that depend on the content of the image seen by the camera.
Link to this section Functions
child_spec(init_arg) View Source
Returns a specification to start this module under a supervisor.
See Supervisor
.
set_image(jpg) View Source
Set the image that is being displayed by the fake camera on each frame. This is intended for development or testing things that depend on the content of the image seen by the camera.
jpg
should be a JPEG-encoded binary, for example:
"image.jpg"
|> File.read!()
|> Picam.FakeCamera.set_image()