background_renderer.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Google Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef C_ARCORE_AUGMENTED_IMAGE_BACKGROUND_RENDERER_H_
18 #define C_ARCORE_AUGMENTED_IMAGE_BACKGROUND_RENDERER_H_
19 
20 #include <GLES2/gl2.h>
21 #include <GLES2/gl2ext.h>
22 #include <cstdlib>
23 
24 #include "util.h"
25 
26 static const GLfloat BackgroundRenderer_kVertices[] = {
27  -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f,
28 };
29 
30 // This class renders the passthrough camera image into the OpenGL frame.
32 public:
33  // Positions of the quad vertices in clip space (X, Y).
34 
35  static constexpr int kNumVertices = 4;
36 
37  public:
38  BackgroundRenderer() = default;
39  ~BackgroundRenderer() = default;
40 
41  // Sets up OpenGL state. Must be called on the OpenGL thread and before any
42  // other methods below.
43  void InitializeGlContent(GLuint textureId);
44 
45  // Draws the background image. This methods must be called for every ArFrame
46  // returned by ArSession_update() to catch display geometry change events.
47  void Draw(const float * transformed_uvs);
48 
49  private:
50 
53 
56 };
57 
58 #endif // C_ARCORE_AUGMENTED_IMAGE_BACKGROUND_RENDERER_H_
~BackgroundRenderer()=default
BackgroundRenderer()=default
static constexpr int kNumVertices
unsigned int GLuint
Definition: dummy.cpp:78
static const GLfloat BackgroundRenderer_kVertices[]
void InitializeGlContent(GLuint textureId)
void Draw(const float *transformed_uvs)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:34:58