FrameSet.java
Go to the documentation of this file.
1 package com.intel.realsense.librealsense;
2 
3 public class FrameSet extends LrsClass {
4  private int mSize = 0;
5 
6  public FrameSet(long handle) {
7  mHandle = handle;
8  mSize = nFrameCount(mHandle);
9  }
10 
12  return first(type, StreamFormat.ANY);
13  }
14 
16  for(int i = 0; i < mSize; i++) {
17  Frame f = new Frame(nExtractFrame(mHandle, i));
18  try(StreamProfile p = f.getProfile()){
19  if(p.getType() == type && (p.getFormat() == format || format == StreamFormat.ANY))
20  return f;
21  }
22  f.close();
23  }
24  return null;
25  }
26 
27  public void foreach(FrameCallback callback) {
28  for(int i = 0; i < mSize; i++) {
29  try(Frame f = new Frame(nExtractFrame(mHandle, i))){
30  callback.onFrame(f);
31  }
32  }
33  }
34 
35  public int getSize(){ return mSize; }
36 
38  return filter.process(this);
39  }
40 
41  public FrameSet releaseWith(FrameReleaser frameReleaser){
42  frameReleaser.addFrame(this);
43  return this;
44  }
45 
46  @Override
47  public void close() {
48  nRelease(mHandle);
49  }
50 
51  @Override
52  public FrameSet clone() {
53  FrameSet rv = new FrameSet(mHandle);
54  nAddRef(mHandle);
55  return rv;
56  }
57 
58  private static native void nAddRef(long handle);
59  private static native void nRelease(long handle);
60  private static native long nExtractFrame(long handle, int index);
61  private static native int nFrameCount(long handle);
62 }
FrameSet releaseWith(FrameReleaser frameReleaser)
Definition: FrameSet.java:41
GLfloat GLfloat p
Definition: glext.h:12687
GLuint64 GLenum void * handle
Definition: glext.h:7785
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLuint index
GLdouble f
static native int nFrameCount(long handle)
GLint GLint GLsizei GLint GLenum format
static native void nRelease(long handle)
FrameSet applyFilter(FilterInterface filter)
Definition: FrameSet.java:37
static native void nAddRef(long handle)
def callback(frame)
Definition: t265_stereo.py:91
GLenum type
static native long nExtractFrame(long handle, int index)
int i
Frame first(StreamType type, StreamFormat format)
Definition: FrameSet.java:15


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:14