1 package iotcode.interfaces;
3 // Standard Java Packages
4 import java.util.ArrayList;
5 import java.awt.image.BufferedImage;
8 import java.util.ArrayList;
11 import java.rmi.Remote;
12 import java.rmi.RemoteException;
14 // Checker annotations
15 import iotchecker.qual.NonLocalRemote;
17 /** Class Camera interface for camera devices.
18 * This Interface supports single lens cameras, can only produce 1 frame at a time
20 * @author Ali Younis <ayounis @ uci.edu>
25 public interface Camera extends Remote {
27 /** Enumeration of the standard resolutions supported by general cameras
30 public enum Resolution {
37 /** Method to get the latest image frame data of the camera.
41 * @return [byte[]] Image frame byte data of buffered image.
43 public byte[] getLatestFrame() throws RemoteException;
46 /** Method to get the time-stamp of when the image was taken.
50 * @return [Date] Time-stamp of when the image was taken.
52 public Date getTimestamp() throws RemoteException;
54 /** Method to start the camera.
60 public void start() throws RemoteException;
63 /** Method to stop the camera.
69 public void stop() throws RemoteException;
71 /** Method to set the resolution of the camera.
73 * @param _res [Camera.Resolution]: the new resolution of the camera
75 * @return true if the resolution was set
77 public boolean setResolution(Camera.Resolution _res) throws RemoteException;
80 /** Method to set the frames per second of the camera.
82 * @param _fps [int]: the new frames per second of the camera
84 * @return true if the frames per second was set
86 public boolean setFPS(int _fps) throws RemoteException;
89 /** Method to get the max supported frames per second by the camera.
93 * @return [int] the max frames per second supported by the camera.
95 public int getMaxFPS() throws RemoteException;
98 /** Method to get the min supported frames per second by the camera.
102 * @return [int] the min frames per second supported by the camera.
104 public int getMinFPS() throws RemoteException;
107 /** Method to get the supported resolutions of the camera.
111 * @return [List<Camera.Resolution>] the supported resolutions of the camera.
113 public List<Camera.Resolution> getSupportedResolutions() throws RemoteException;
116 /** Register an object to retrieve callbacks when new camera data is available.
118 * @param _callbackTo [CameraCallback].
120 * @return [void] None.
122 public void registerCallback(@NonLocalRemote CameraCallback _callbackTo) throws RemoteException;
125 /** Method to initialize the camera, if the bulb needs to be camera.
127 * @return [void] None.
129 public void init() throws RemoteException;