1 package kaka.cakelight;
3 public class CakeLight {
4 private Configuration config;
6 private LedController ledController;
8 public CakeLight(Configuration config) {
10 this.ledController = new LedController(config);
13 public void setMode(Mode mode) {
16 mode.setFrameListener(ledController::onFrame);
20 public void cleanup() {
21 if (this.mode != null) {
26 public void startLoop() {
28 // FrameGrabber grabber = FrameGrabber.from(config);
30 // Frame frame = grabber.grabFrame();
32 // for (int i = 0; i < 100; i++) {
33 // time += timeIt("frame", () -> grabber.grabFrame());
35 // System.out.println("time = " + time);
37 // byte[] data = frame.getData();
38 // saveFile(data, "/home/kaka/test.img");