Processing, 類Capture用法介紹。
構造函數
Capture(parent)Capture(parent, device)Capture(parent, width, height)Capture(parent, width, height, fps)Capture(parent, width, height, device)Capture(parent, width, height, device, fps)
參數
parentPApplet,通常是"this"device設備名稱width像素寬度height像素高度fps每秒幀數
說明
用於存儲和操作來自附加捕獲設備(如相機)的視頻幀的數據類型。使用Capture.list() 顯示任何連接設備的名稱。使用沒有name 的構造函數版本將嘗試使用QuickTime 程序使用的最後一個設備。
例子
import processing.video.*;
Capture cam;
void setup() {
size(640, 480);
String[] cameras = Capture.list();
if (cameras.length == 0) {
println("There are no cameras available for capture.");
exit();
} else {
println("Available cameras:");
for (int i = 0; i < cameras.length; i++) {
println(cameras[i]);
}
// The camera can be initialized directly using an
// element from the array returned by list():
cam = new Capture(this, cameras[0]);
cam.start();
}
}
void draw() {
if (cam.available() == true) {
cam.read();
}
image(cam, 0, 0);
// The following does the same, and is faster when just drawing the image
// without any additional resizing, transformations, or tint.
//set(0, 0, cam);
}
方法
frameRate()設置從捕獲設備讀取幀的頻率。- Capture.available()當來自設備的新幀可供讀取時,返回 "true"。
- Capture.start()開始從連接的設備捕獲幀。
- Capture.stop()停止從連接的設備捕獲幀。
- Capture.read()讀取設備的當前幀。
相關用法
- Processing Capture.stop()用法及代碼示例
- Processing Capture.start()用法及代碼示例
- Processing Capture.available()用法及代碼示例
- Processing Capture.read()用法及代碼示例
- Processing Client.readStringUntil()用法及代碼示例
- Processing Client.active()用法及代碼示例
- Processing Client.ip()用法及代碼示例
- Processing Client用法及代碼示例
- Processing Client.readString()用法及代碼示例
- Processing Client.readBytesUntil()用法及代碼示例
- Processing Client.write()用法及代碼示例
- Processing Client.read()用法及代碼示例
- Processing Client.clear()用法及代碼示例
- Processing Client.readBytes()用法及代碼示例
- Processing Client.stop()用法及代碼示例
- Processing Client.readChar()用法及代碼示例
- Processing Client.available()用法及代碼示例
- Processing FFT用法及代碼示例
- Processing SawOsc.pan()用法及代碼示例
- Processing FloatDict用法及代碼示例
- Processing FFT.stop()用法及代碼示例
- Processing join()用法及代碼示例
- Processing () (parentheses)用法及代碼示例
- Processing Pulse用法及代碼示例
- Processing PShader用法及代碼示例
注:本文由純淨天空篩選整理自processing.org大神的英文原創作品 Capture。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
