1 
2 //
3 // This file is auto-generated. Please don't modify it!
4 //
5 package org.opencv.videoio;
6 
7 import java.lang.String;
8 import org.opencv.core.Mat;
9 
10 // C++: class VideoCapture
11 //javadoc: VideoCapture
12 public class VideoCapture {
13 
14     protected final long nativeObj;
VideoCapture(long addr)15     protected VideoCapture(long addr) { nativeObj = addr; }
16 
17 
18     //
19     // C++:   VideoCapture()
20     //
21 
22     //javadoc: VideoCapture::VideoCapture()
VideoCapture()23     public   VideoCapture()
24     {
25 
26         nativeObj = VideoCapture_0();
27 
28         return;
29     }
30 
31 
32     //
33     // C++:   VideoCapture(String filename)
34     //
35 
36     //javadoc: VideoCapture::VideoCapture(filename)
VideoCapture(String filename)37     public   VideoCapture(String filename)
38     {
39 
40         nativeObj = VideoCapture_1(filename);
41 
42         return;
43     }
44 
45 
46     //
47     // C++:   VideoCapture(int device)
48     //
49 
50     //javadoc: VideoCapture::VideoCapture(device)
VideoCapture(int device)51     public   VideoCapture(int device)
52     {
53 
54         nativeObj = VideoCapture_2(device);
55 
56         return;
57     }
58 
59 
60     //
61     // C++:  bool open(String filename)
62     //
63 
64     //javadoc: VideoCapture::open(filename)
open(String filename)65     public  boolean open(String filename)
66     {
67 
68         boolean retVal = open_0(nativeObj, filename);
69 
70         return retVal;
71     }
72 
73 
74     //
75     // C++:  bool open(int device)
76     //
77 
78     //javadoc: VideoCapture::open(device)
open(int device)79     public  boolean open(int device)
80     {
81 
82         boolean retVal = open_1(nativeObj, device);
83 
84         return retVal;
85     }
86 
87 
88     //
89     // C++:  bool isOpened()
90     //
91 
92     //javadoc: VideoCapture::isOpened()
isOpened()93     public  boolean isOpened()
94     {
95 
96         boolean retVal = isOpened_0(nativeObj);
97 
98         return retVal;
99     }
100 
101 
102     //
103     // C++:  void release()
104     //
105 
106     //javadoc: VideoCapture::release()
release()107     public  void release()
108     {
109 
110         release_0(nativeObj);
111 
112         return;
113     }
114 
115 
116     //
117     // C++:  bool grab()
118     //
119 
120     //javadoc: VideoCapture::grab()
grab()121     public  boolean grab()
122     {
123 
124         boolean retVal = grab_0(nativeObj);
125 
126         return retVal;
127     }
128 
129 
130     //
131     // C++:  bool retrieve(Mat& image, int flag = 0)
132     //
133 
134     //javadoc: VideoCapture::retrieve(image, flag)
retrieve(Mat image, int flag)135     public  boolean retrieve(Mat image, int flag)
136     {
137 
138         boolean retVal = retrieve_0(nativeObj, image.nativeObj, flag);
139 
140         return retVal;
141     }
142 
143     //javadoc: VideoCapture::retrieve(image)
retrieve(Mat image)144     public  boolean retrieve(Mat image)
145     {
146 
147         boolean retVal = retrieve_1(nativeObj, image.nativeObj);
148 
149         return retVal;
150     }
151 
152 
153     //
154     // C++:  bool read(Mat& image)
155     //
156 
157     //javadoc: VideoCapture::read(image)
read(Mat image)158     public  boolean read(Mat image)
159     {
160 
161         boolean retVal = read_0(nativeObj, image.nativeObj);
162 
163         return retVal;
164     }
165 
166 
167     //
168     // C++:  bool set(int propId, double value)
169     //
170 
171     //javadoc: VideoCapture::set(propId, value)
set(int propId, double value)172     public  boolean set(int propId, double value)
173     {
174 
175         boolean retVal = set_0(nativeObj, propId, value);
176 
177         return retVal;
178     }
179 
180 
181     //
182     // C++:  double get(int propId)
183     //
184 
185     //javadoc: VideoCapture::get(propId)
get(int propId)186     public  double get(int propId)
187     {
188 
189         double retVal = get_0(nativeObj, propId);
190 
191         return retVal;
192     }
193 
194 
getSupportedPreviewSizes()195     public java.util.List<org.opencv.core.Size> getSupportedPreviewSizes()
196     {
197         String[] sizes_str = getSupportedPreviewSizes_0(nativeObj).split(",");
198         java.util.List<org.opencv.core.Size> sizes = new java.util.ArrayList<org.opencv.core.Size>(sizes_str.length);
199 
200         for (String str : sizes_str) {
201             String[] wh = str.split("x");
202             sizes.add(new org.opencv.core.Size(Double.parseDouble(wh[0]), Double.parseDouble(wh[1])));
203         }
204 
205         return sizes;
206     }
207 
208 
209     @Override
finalize()210     protected void finalize() throws Throwable {
211         delete(nativeObj);
212     }
213 
214 
215 
216     // C++:   VideoCapture()
VideoCapture_0()217     private static native long VideoCapture_0();
218 
219     // C++:   VideoCapture(String filename)
VideoCapture_1(String filename)220     private static native long VideoCapture_1(String filename);
221 
222     // C++:   VideoCapture(int device)
VideoCapture_2(int device)223     private static native long VideoCapture_2(int device);
224 
225     // C++:  bool open(String filename)
open_0(long nativeObj, String filename)226     private static native boolean open_0(long nativeObj, String filename);
227 
228     // C++:  bool open(int device)
open_1(long nativeObj, int device)229     private static native boolean open_1(long nativeObj, int device);
230 
231     // C++:  bool isOpened()
isOpened_0(long nativeObj)232     private static native boolean isOpened_0(long nativeObj);
233 
234     // C++:  void release()
release_0(long nativeObj)235     private static native void release_0(long nativeObj);
236 
237     // C++:  bool grab()
grab_0(long nativeObj)238     private static native boolean grab_0(long nativeObj);
239 
240     // C++:  bool retrieve(Mat& image, int flag = 0)
retrieve_0(long nativeObj, long image_nativeObj, int flag)241     private static native boolean retrieve_0(long nativeObj, long image_nativeObj, int flag);
retrieve_1(long nativeObj, long image_nativeObj)242     private static native boolean retrieve_1(long nativeObj, long image_nativeObj);
243 
244     // C++:  bool read(Mat& image)
read_0(long nativeObj, long image_nativeObj)245     private static native boolean read_0(long nativeObj, long image_nativeObj);
246 
247     // C++:  bool set(int propId, double value)
set_0(long nativeObj, int propId, double value)248     private static native boolean set_0(long nativeObj, int propId, double value);
249 
250     // C++:  double get(int propId)
get_0(long nativeObj, int propId)251     private static native double get_0(long nativeObj, int propId);
252 
getSupportedPreviewSizes_0(long nativeObj)253     private static native String getSupportedPreviewSizes_0(long nativeObj);
254 
255     // native support for java finalize()
delete(long nativeObj)256     private static native void delete(long nativeObj);
257 
258 }
259