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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
