Adding config file for sharing.
[iot2.git] / benchmarks / original_interfaces / Camera.java
1 package iotcode.interfaces;
2
3 // Standard Java Packages
4 import java.util.ArrayList;
5 import java.awt.image.BufferedImage;
6 import java.util.Date;
7 import java.util.List;
8 import java.util.ArrayList;
9
10 //RMI packages
11 import java.rmi.Remote;
12 import java.rmi.RemoteException;
13
14 // Checker annotations
15 import iotchecker.qual.NonLocalRemote;
16
17 /** Class Camera interface for camera devices.
18  *  This Interface supports single lens cameras, can only produce 1 frame at a time
19  *
20  * @author      Ali Younis <ayounis @ uci.edu>
21  * @version     1.0
22  * @since       2016-01-27
23  */
24
25 public interface Camera extends Remote {
26
27         /** Enumeration of the standard resolutions supported by general cameras
28          *
29          */
30         public enum Resolution {
31                 RES_1080P,
32                 RES_720P,
33                 RES_VGA
34         };
35
36
37         /** Method to get the latest image frame data of the camera.
38          *
39          *   @param None.
40          *
41          *   @return [byte[]] Image frame byte data of buffered image.
42          */
43         public byte[] getLatestFrame() throws RemoteException;
44
45
46         /** Method to get the time-stamp of when the image was taken.
47          *
48          *   @param None.
49          *
50          *   @return [Date] Time-stamp of when the image was taken.
51          */
52         public Date getTimestamp() throws RemoteException;
53
54         /** Method to start the camera.
55          *
56          *   @param None.
57          *
58          *   @return None
59          */
60         public void start() throws RemoteException;
61
62
63         /** Method to stop the camera.
64          *
65          *   @param None.
66          *
67          *   @return None
68          */
69         public void stop() throws RemoteException;
70
71         /** Method to set the resolution of the camera.
72          *
73          *   @param _res [Camera.Resolution]: the new resolution of the camera
74          *
75          *   @return true if the resolution was set
76          */
77         public boolean setResolution(Camera.Resolution _res) throws RemoteException;
78
79
80         /** Method to set the frames per second of the camera.
81          *
82          *   @param _fps [int]: the new frames per second of the camera
83          *
84          *   @return true if the frames per second was set
85          */
86         public boolean setFPS(int _fps) throws RemoteException;
87
88
89         /** Method to get the max supported frames per second by the camera.
90          *
91          *   @param None.
92          *
93          *   @return [int] the max frames per second supported by the camera.
94          */
95         public int getMaxFPS() throws RemoteException;
96
97
98         /** Method to get the min supported frames per second by the camera.
99          *
100          *   @param None.
101          *
102          *   @return [int] the min frames per second supported by the camera.
103          */
104         public int getMinFPS() throws RemoteException;
105
106
107         /** Method to get the supported resolutions of the camera.
108          *
109          *   @param None.
110          *
111          *   @return [List<Camera.Resolution>] the supported resolutions of the camera.
112          */
113         public List<Camera.Resolution> getSupportedResolutions() throws RemoteException;
114
115
116         /** Register an object to retrieve callbacks when new camera data is available.
117          *
118          *   @param _callbackTo [CameraCallback].
119          *
120          *   @return [void] None.
121          */
122         public void registerCallback(@NonLocalRemote CameraCallback _callbackTo) throws RemoteException;
123
124
125         /** Method to initialize the camera, if the bulb needs to be camera.
126          *
127          *   @return [void] None.
128          */
129         public void init() throws RemoteException;
130
131 }
132
133
134
135
136
137
138
139
140
141
142
143
144
145