|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object processing.core.PImage processing.video.Capture
public class Capture
Watchin' shit on the telly.
Field Summary | |
---|---|
quicktime.std.sg.SequenceGrabber |
capture
|
quicktime.std.sg.SGVideoChannel |
channel
the guy who's doing all the work |
static int |
COMPONENT
|
static int |
COMPOSITE
|
boolean |
crop
True if this image is currently being cropped |
int |
cropH
|
int |
cropW
|
int |
cropX
|
int |
cropY
|
int[] |
data
Temporary storage for the raw image data read directly from the capture device |
int |
dataHeight
|
int |
dataRowBytes
|
int |
dataWidth
|
int |
frameRate
|
static int |
NTSC
|
static int |
PAL
|
quicktime.util.RawEncodedImage |
raw
|
static int |
SECAM
|
static int |
SVIDEO
|
static int |
TUNER
|
Fields inherited from class processing.core.PImage |
---|
format, height, parent, pixels, width |
Constructor Summary | |
---|---|
Capture(PApplet parent,
int requestWidth,
int requestHeight)
|
|
Capture(PApplet parent,
int reqWidth,
int reqHeight,
int frameRate)
|
|
Capture(PApplet parent,
int reqWidth,
int reqHeight,
java.lang.String name)
|
|
Capture(PApplet parent,
int requestWidth,
int requestHeight,
java.lang.String name,
int frameRate)
If 'name' is null or the empty string, it won't set a specific device, which means that QuickTime will use that last device used by a QuickTime application. |
Method Summary | |
---|---|
boolean |
available()
True if a frame is ready to be read. |
void |
crop(int x,
int y,
int w,
int h)
Set the video to crop from its original. |
void |
dispose()
Called by PApplet to shut down video so that QuickTime can be used later by another applet. |
void |
format(int which)
Set the video format standard to use on the video digitizer: NTSC, PAL, or SECAM. |
void |
frameRate(int iframeRate)
Set the frameRate for how quickly new frames are read from the capture device. |
void |
init(PApplet parent,
int requestWidth,
int requestHeight,
java.lang.String name,
int frameRate)
|
static java.lang.String[] |
list()
Get a list of all available captures as a String array. |
void |
noCrop()
Remove the cropping (if any) of the image. |
void |
read()
|
void |
run()
|
void |
settings()
Show the settings dialog for this input device. |
void |
source(int which)
Set the format to ask for from the video digitizer: TUNER, COMPOSITE, SVIDEO, or COMPONENT. |
void |
stop()
Called by applets to stop capturing video. |
Methods inherited from class processing.core.PImage |
---|
blend, blend, blendColor, clone, copy, copy, filter, filter, get, get, get, getCache, getImage, init, isModified, loadPixels, mask, mask, removeCache, resize, save, set, set, setCache, setModified, setModified, updatePixels, updatePixels |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int COMPOSITE
public static final int SVIDEO
public static final int COMPONENT
public static final int TUNER
public static final int NTSC
public static final int PAL
public static final int SECAM
public int[] data
public int dataWidth
public int dataHeight
public int dataRowBytes
public boolean crop
public int cropX
public int cropY
public int cropW
public int cropH
public int frameRate
public quicktime.util.RawEncodedImage raw
public quicktime.std.sg.SequenceGrabber capture
public quicktime.std.sg.SGVideoChannel channel
Constructor Detail |
---|
public Capture(PApplet parent, int requestWidth, int requestHeight)
public Capture(PApplet parent, int reqWidth, int reqHeight, int frameRate)
public Capture(PApplet parent, int reqWidth, int reqHeight, java.lang.String name)
public Capture(PApplet parent, int requestWidth, int requestHeight, java.lang.String name, int frameRate)
public void captureEvent(Capture c)is defined in the host PApplet, then it will be called every time a new frame is available from the capture device.
Method Detail |
---|
public void init(PApplet parent, int requestWidth, int requestHeight, java.lang.String name, int frameRate)
public boolean available()
// put this somewhere inside draw if (capture.available()) capture.read();Alternatively, you can use captureEvent(Capture c) to notify you whenever available() is set to true. In which case, things might look like this:
public void captureEvent(Capture c) { c.read(); // do something exciting now that c has been updated }
public void crop(int x, int y, int w, int h)
It seems common that captures add lines to the top or bottom of an image, so this can be useful for removing them. Internally, the pixel buffer size returned from QuickTime is often a different size than requested, so crop will be set more often than not.
public void noCrop()
By default, cropping is often enabled to trim out black pixels. But if you'd rather deal with them yourself (so as to avoid an extra lag while the data is moved around) you can shut it off.
public void read()
public void run()
run
in interface java.lang.Runnable
public void frameRate(int iframeRate)
public void stop()
public void dispose()
public void source(int which)
The constants are just aliases to the constants returned from QuickTime's getInputFormat() function, so any valid constant from that will work just fine.
public void format(int which)
The constants are just aliases to the constants used for QuickTime's setInputStandard() function, so any valid constant from that will work just fine.
public void settings()
public static java.lang.String[] list()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |