GLFrame.java
Go to the documentation of this file.
1 package com.intel.realsense.librealsense;
2 
3 import android.graphics.Rect;
4 import android.opengl.GLES10;
5 
6 import java.nio.ByteBuffer;
7 
8 public abstract class GLFrame implements AutoCloseable {
9  protected Frame mFrame;
10  protected ByteBuffer mBuffer;
11 
12  public abstract void draw(Rect rect);
13 
14  public synchronized void setFrame(Frame frame) {
15  if(mFrame != null)
16  mFrame.close();
17  mFrame = frame.clone();
18  }
19 
20  protected static void setViewport(Rect r) {
21  GLES10.glViewport(r.left, r.top, r.width(), r.height());
22  GLES10.glLoadIdentity();
23  GLES10.glMatrixMode(GLES10.GL_PROJECTION);
24  GLES10.glOrthof(0, r.width(), r.height(), 0, -1, +1);
25  }
26 
27  public String getLabel() {
28  if(mFrame == null)
29  return "";
30  try(StreamProfile sp = mFrame.getProfile()){
31  return sp.getType() + " - " + sp.getFormat();
32  }
33  }
34 
35  @Override
36  public void close() {
37  if(mFrame != null)
38  mFrame.close();
39  }
40 }
::std_msgs::String_< std::allocator< void > > String
Definition: String.h:47
GLdouble GLdouble r
synchronized void setFrame(Frame frame)
Definition: GLFrame.java:14
Definition: example.hpp:70


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