Frame.java
Go to the documentation of this file.
1 package com.intel.realsense.librealsense;
2 
3 public class Frame extends LrsClass implements Cloneable{
4 
5  Frame(long handle){
6  mHandle = handle;
7  }
8 
9  public boolean is(Extension extension) {
10  return nIsFrameExtendableTo(mHandle, extension.value());
11  }
12 
13  public <T extends Frame> T as(Extension extension) {
14  switch (extension){
15  case VIDEO_FRAME: return (T) new VideoFrame(mHandle);
16  case DEPTH_FRAME: return (T) new DepthFrame(mHandle);
17  case MOTION_FRAME: return (T) new MotionFrame(mHandle);
18  case POINTS: return (T) new Points(mHandle);
19  }
20  throw new RuntimeException("this profile is not extendable to " + extension.name());
21  }
22 
24  return new StreamProfile(nGetStreamProfile(mHandle));
25  }
26 
27  public int getDataSize() {
28  return nGetDataSize(mHandle);
29  }
30 
31  public void getData(byte[] data) {
32  nGetData(mHandle, data);
33  }
34 
35  public int getNumber(){
36  return nGetNumber(mHandle);
37  }
38 
39  public double getTimestamp(){
40  return nGetTimestamp(mHandle);
41  }
42 
44  int rv = nGetTimestampDomain(mHandle);
45  return TimestampDomain.values()[rv];
46  }
47 
48  public boolean supportsMetadata(FrameMetadata type) { return nSupportsMetadata(mHandle, type.value());}
49 
50  public long getMetadata(FrameMetadata type) { return nGetMetadata(mHandle, type.value());}
51 
53  return filter.process(this);
54  }
55 
56  public Frame releaseWith(FrameReleaser frameReleaser){
57  frameReleaser.addFrame(this);
58  return this;
59  }
60 
61  @Override
62  public void close() {
63  if(mOwner)
64  nRelease(mHandle);
65  }
66 
67  @Override
68  public Frame clone() {
69  Frame rv = new Frame(mHandle);
70  nAddRef(mHandle);
71  return rv;
72  }
73 
74  private static native boolean nIsFrameExtendableTo(long handle, int extension);
75  private static native void nAddRef(long handle);
76  private static native void nRelease(long handle);
77  protected static native long nGetStreamProfile(long handle);
78  private static native int nGetDataSize(long handle);
79  private static native void nGetData(long handle, byte[] data);
80  private static native int nGetNumber(long handle);
81  private static native double nGetTimestamp(long handle);
82  private static native int nGetTimestampDomain(long handle);
83  private static native long nGetMetadata(long handle, int metadata_type);
84  private static native boolean nSupportsMetadata(long handle, int metadata_type);
85 }
static native double nGetTimestamp(long handle)
GLuint64 GLenum void * handle
Definition: glext.h:7785
static native void nRelease(long handle)
long getMetadata(FrameMetadata type)
Definition: Frame.java:50
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
static native long nGetMetadata(long handle, int metadata_type)
static native int nGetDataSize(long handle)
static native boolean nSupportsMetadata(long handle, int metadata_type)
static native int nGetNumber(long handle)
TimestampDomain getTimestampDomain()
Definition: Frame.java:43
static native boolean nIsFrameExtendableTo(long handle, int extension)
static native long nGetStreamProfile(long handle)
static native void nGetData(long handle, byte[] data)
unsigned char byte
Definition: src/types.h:52
GLenum type
boolean is(Extension extension)
Definition: Frame.java:9
boolean supportsMetadata(FrameMetadata type)
Definition: Frame.java:48
Frame applyFilter(FilterInterface filter)
Definition: Frame.java:52
static native int nGetTimestampDomain(long handle)
Definition: parser.hpp:150
Frame releaseWith(FrameReleaser frameReleaser)
Definition: Frame.java:56
static native void nAddRef(long handle)


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