public class Capture
extends processing.core.PImage
implements processing.core.PConstants
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
available |
protected Object |
bufferSink |
protected int |
bufHeight |
protected int |
bufWidth |
protected Method |
captureEventMethod |
protected boolean |
capturing |
protected String |
copyMask |
protected int[] |
copyPixels |
protected static String |
devicePropertyName |
protected Object |
eventHandler |
protected boolean |
firstFrame |
float |
frameRate |
protected String |
frameRateString |
protected static String |
indexPropertyName |
protected org.gstreamer.Buffer |
natBuffer |
protected org.gstreamer.elements.BufferDataAppSink |
natSink |
protected boolean |
newFrame |
protected boolean |
outdatedPixels |
org.gstreamer.Pipeline |
pipeline |
protected boolean |
pipelineReady |
protected int |
reqHeight |
protected int |
reqWidth |
protected org.gstreamer.elements.RGBDataAppSink |
rgbSink |
protected Method |
sinkCopyMethod |
protected Method |
sinkDisposeMethod |
protected Method |
sinkGetMethod |
protected Method |
sinkSetMethod |
protected org.gstreamer.Element |
sourceElement |
protected static String |
sourceElementName |
protected String |
sourceName |
protected boolean |
useBufferSink |
protected static boolean |
useResMacHack |
ALPHA_MASK, BLUE_MASK, format, GREEN_MASK, height, loaded, modified, mx1, mx2, my1, my2, parent, pixelDensity, pixelHeight, pixels, pixelWidth, RED_MASK, saveImageFormats, widthADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ASYNC_SAVEFRAME, DISABLE_BUFFER_READING, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_KEY_REPEAT, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_ASYNC_SAVEFRAME, ENABLE_BUFFER_READING, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_KEY_REPEAT, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ESC, EXCLUSION, FX2D, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NORMAL, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADRATIC_VERTEX, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPAN, SPHERE, SPOT, SQUARE, SUBTRACT, SVG, TAB, TARGA, TAU, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z| Constructor and Description |
|---|
Capture(processing.core.PApplet parent) |
Capture(processing.core.PApplet parent,
int requestWidth,
int requestHeight) |
Capture(processing.core.PApplet parent,
int requestWidth,
int requestHeight,
int frameRate)
Advanced
|
Capture(processing.core.PApplet parent,
int requestWidth,
int requestHeight,
String cameraName)
Advanced
|
Capture(processing.core.PApplet parent,
int requestWidth,
int requestHeight,
String cameraName,
int frameRate)
Advanced
|
Capture(processing.core.PApplet parent,
String requestConfig) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
addResFromSource(ArrayList<String> res,
org.gstreamer.Element src) |
protected static void |
addResFromSourceImpl(ArrayList<String> res,
org.gstreamer.Element src) |
protected static void |
addResFromSourceMacHack(ArrayList<String> res,
org.gstreamer.Element src) |
protected static void |
addResFromString(ArrayList<String> res,
String str,
int w,
int h) |
protected static void |
addResFromStructure(ArrayList<String> res,
org.gstreamer.Structure str,
int w,
int h) |
boolean |
available()
( begin auto-generated from Capture_available.xml )
Returns "true" when a new video frame is available to read.
|
protected void |
checkResIsValid() |
protected void |
checkValidDevices(String src) |
void |
dispose()
Disposes all the native resources associated to this capture device.
|
void |
disposeBuffer(Object buf)
NOTE: This is not official API and may/will be removed at any time.
|
protected void |
finalize()
Finalizer of the class.
|
int |
get(int x,
int y) |
protected String |
getFrameRate(String config) |
protected void |
getImpl(int sourceX,
int sourceY,
int sourceWidth,
int sourceHeight,
processing.core.PImage target,
int targetX,
int targetY) |
protected String |
getName(String config) |
protected void |
getSinkMethods() |
protected int[] |
getSize(String config) |
protected float |
getSourceFrameRate() |
boolean |
hasBufferSink()
NOTE: This is not official API and may/will be removed at any time.
|
protected void |
initCopyMask() |
protected void |
initGStreamer(processing.core.PApplet parent,
int rw,
int rh,
String src,
String idName,
Object idValue,
String fps) |
protected void |
initPipeline() |
protected void |
invokeEvent(int w,
int h,
org.gstreamer.Buffer buffer) |
protected void |
invokeEvent(int w,
int h,
IntBuffer buffer)
invokeEvent() and read() are synchronized so that they can not be
called simultaneously.
|
static String[] |
list()
( begin auto-generated from Capture_list.xml )
Gets a list of all available capture devices such as a camera.
|
protected static String[] |
list(String sourceName,
String propertyName) |
protected static ArrayList<String> |
listDevices(String sourceName,
String propertyName) |
protected static ArrayList<String> |
listResolutions(String sourceName,
String propertyName,
Object propertyValue) |
void |
loadPixels() |
protected static String |
makeResolutionString(int width,
int height,
int fpsNumerator,
int fpsDenominator) |
protected static String |
makeResolutionString(int width,
int height,
String fpsStr) |
void |
post() |
void |
read()
( begin auto-generated from Capture_read.xml )
Reads the current video frame.
|
void |
setBufferSink(Object sink)
Sets the object to use as destination for the frames read from the stream.
|
void |
setBufferSink(Object sink,
String mask)
Sets the object to use as destination for the frames read from the stream.
|
protected void |
setEventHandlerObject(Object obj)
Uses a generic object as handler of the capture.
|
void |
start()
( begin auto-generated from Capture_start.xml )
Starts capturing frames from the selected device.
|
void |
stop()
( begin auto-generated from Capture_stop.xml )
Stops capturing frames from an attached device.
|
protected boolean |
validRes(String res) |
blend, blend, blendColor, blurAlpha, blurARGB, blurRGB, buildBlurKernel, checkAlpha, clone, copy, copy, copy, dilate, erode, filter, filter, get, get, getImage, getModifiedX1, getModifiedX2, getModifiedY1, getModifiedY2, getNative, init, init, isLoaded, isModified, loadTIFF, mask, mask, opaque, resize, save, saveImageIO, saveTGA, saveTIFF, set, set, setImpl, setLoaded, setLoaded, setModified, setModified, updatePixels, updatePixelsprotected static String sourceElementName
protected static String devicePropertyName
protected static String indexPropertyName
protected static boolean useResMacHack
public float frameRate
public org.gstreamer.Pipeline pipeline
protected boolean capturing
protected String frameRateString
protected int bufWidth
protected int bufHeight
protected String sourceName
protected org.gstreamer.Element sourceElement
protected Method captureEventMethod
protected Object eventHandler
protected boolean available
protected boolean pipelineReady
protected boolean newFrame
protected org.gstreamer.elements.RGBDataAppSink rgbSink
protected int[] copyPixels
protected boolean firstFrame
protected int reqWidth
protected int reqHeight
protected boolean useBufferSink
protected boolean outdatedPixels
protected Object bufferSink
protected Method sinkCopyMethod
protected Method sinkSetMethod
protected Method sinkDisposeMethod
protected Method sinkGetMethod
protected String copyMask
protected org.gstreamer.Buffer natBuffer
protected org.gstreamer.elements.BufferDataAppSink natSink
public Capture(processing.core.PApplet parent)
public Capture(processing.core.PApplet parent,
String requestConfig)
public Capture(processing.core.PApplet parent,
int requestWidth,
int requestHeight)
parent - typically use "this"requestWidth - width of the framerequestHeight - height of the framepublic Capture(processing.core.PApplet parent,
int requestWidth,
int requestHeight,
int frameRate)
frameRate - number of frames to read per secondpublic Capture(processing.core.PApplet parent,
int requestWidth,
int requestHeight,
String cameraName)
cameraName - name of the camerapublic Capture(processing.core.PApplet parent,
int requestWidth,
int requestHeight,
String cameraName,
int frameRate)
public void dispose()
protected void finalize()
throws Throwable
public boolean available()
public void start()
public void stop()
public void read()
public void loadPixels()
loadPixels in class processing.core.PImagepublic int get(int x,
int y)
get in class processing.core.PImageprotected void getImpl(int sourceX,
int sourceY,
int sourceWidth,
int sourceHeight,
processing.core.PImage target,
int targetX,
int targetY)
getImpl in class processing.core.PImagepublic static String[] list()
protected static ArrayList<String> listResolutions(String sourceName, String propertyName, Object propertyValue)
protected static void addResFromSource(ArrayList<String> res, org.gstreamer.Element src)
protected static void addResFromSourceImpl(ArrayList<String> res, org.gstreamer.Element src)
protected static void addResFromSourceMacHack(ArrayList<String> res, org.gstreamer.Element src)
protected static void addResFromString(ArrayList<String> res, String str, int w, int h)
protected static void addResFromStructure(ArrayList<String> res, org.gstreamer.Structure str, int w, int h)
protected static String makeResolutionString(int width, int height, int fpsNumerator, int fpsDenominator)
protected static String makeResolutionString(int width, int height, String fpsStr)
protected void checkResIsValid()
protected void checkValidDevices(String src)
protected boolean validRes(String res)
protected void initGStreamer(processing.core.PApplet parent,
int rw,
int rh,
String src,
String idName,
Object idValue,
String fps)
protected void initPipeline()
protected void setEventHandlerObject(Object obj)
protected void invokeEvent(int w,
int h,
IntBuffer buffer)
protected void invokeEvent(int w,
int h,
org.gstreamer.Buffer buffer)
protected float getSourceFrameRate()
protected int[] getSize(String config)
public void setBufferSink(Object sink)
Object - destpublic void setBufferSink(Object sink, String mask)
Object - destString - maskpublic boolean hasBufferSink()
public void disposeBuffer(Object buf)
protected void getSinkMethods()
protected void initCopyMask()
public void post()
Copyright © 2001–2015 Processing Foundation. All rights reserved.