FastCV Sample Application
1.7.1
|
CameraRendererRGB565GL2 class provide functionality of rendering the camera image to the screen. More...
#include <CameraRendererRGB565GL2.h>
Public Member Functions | |
CameraRendererRGB565GL2 (bool npotTextures=false) | |
Basic Constructor. | |
bool | Render (const uint8_t *img, uint16_t w, uint16_t h) |
Renders provided camera image in NV21 format in current viewport. | |
float | GetRenderingFPS () |
Returns GPU Rendering FPS for Camera frames. | |
bool | Init () |
Initializes the object. | |
void | UnInit () |
UnInitializes the object. | |
virtual | ~CameraRendererRGB565GL2 () |
Default desctructor. | |
CameraRendererRGB565GL2 (bool npotTextures=false) | |
Basic Constructor. | |
bool | Render (const uint8_t *img, uint16_t w, uint16_t h) |
Renders provided camera image in NV21 format in current viewport. | |
float | GetRenderingFPS () |
Returns GPU Rendering FPS for Camera frames. | |
bool | Init () |
Initializes the object. | |
void | UnInit () |
UnInitializes the object. | |
virtual | ~CameraRendererRGB565GL2 () |
Default desctructor. | |
Protected Member Functions | |
bool | CreateTextures () |
Creating 2D texture for an RGB565 image. | |
bool | UpdateTextures (const uint8_t *rgbImg, uint16_t w, uint16_t h) |
Updates texture with new input image. | |
bool | CreateShaderProgram () |
Creates shader program required to render yuv texture. | |
bool | InitGPU () |
Initializes the object. | |
bool | RenderGPURGB (const uint8_t *rgbImg, uint16_t w, uint16_t h) |
Renders texture in current viewport by provide RGB image to GPU. | |
bool | CreateTextures () |
Creating 2D texture for an RGB565 image. | |
bool | UpdateTextures (const uint8_t *rgbImg, uint16_t w, uint16_t h) |
Updates texture with new input image. | |
bool | CreateShaderProgram () |
Creates shader program required to render yuv texture. | |
bool | InitGPU () |
Initializes the object. | |
bool | RenderGPURGB (const uint8_t *rgbImg, uint16_t w, uint16_t h) |
Renders texture in current viewport by provide RGB image to GPU. | |
Protected Attributes | |
bool | mInitialized |
bool | mNPOTTextures |
GLuint | mProgramObject |
GLint | mGL_av4_PositionLoc |
GLint | mGL_av2_TexCoordLoc |
GLuint | mTextureId [1] |
GLint | mGL_u_ImgRGBLoc |
FPSCounter | mFPSCounter |
GLuint | mWidth |
GLuint | mHeight |
Static Protected Attributes | |
static GLfloat | mVertices [] |
static const GLfloat | mLandscapeVertices [] |
static const GLfloat | mLandscapeReverseVertices [] |
static const GLfloat | mPortraitVertices [] |
static const GLfloat | mPortraitReverseVertices [] |
CameraRendererRGB565GL2 class provide functionality of rendering the camera image to the screen.
CameraRendererRGB565GL2 support multiple modes for rendering. If the user is using any of the GPU based rendering mode, CameraRendererRGB565GL2 requires the caller to setup the OpenGL ES 2.0 context and set up the OpenGL view port in which to draw the camera image.
Usage: Usage of CameraRender is very simple as shown below.
//CameraRendererRGB565GL2 object needs to be created during //initialization time of your application.
CameraRendererRGB565GL2 camRenderer();
//In your OpenGL Rendering loop please call following //function.
camRenderer.Render(img, w,h);
CameraRendererRGB565GL2::CameraRendererRGB565GL2 | ( | bool | npotTextures = false | ) |
Basic Constructor.
npotTextures | Indicate if this renderer is to use non-power-of-two-textures or not. Default value is false. |
CameraRendererRGB565GL2::CameraRendererRGB565GL2 | ( | bool | npotTextures = false | ) |
Basic Constructor.
npotTextures | Indicate if this renderer is to use non-power-of-two-textures or not. Default value is false. |
bool CameraRendererRGB565GL2::CreateShaderProgram | ( | ) | [protected] |
Creates shader program required to render yuv texture.
bool CameraRendererRGB565GL2::CreateShaderProgram | ( | ) | [protected] |
Creates shader program required to render yuv texture.
bool CameraRendererRGB565GL2::CreateTextures | ( | ) | [protected] |
Creating 2D texture for an RGB565 image.
bool CameraRendererRGB565GL2::CreateTextures | ( | ) | [protected] |
Creating 2D texture for an RGB565 image.
float CameraRendererRGB565GL2::GetRenderingFPS | ( | ) |
Returns GPU Rendering FPS for Camera frames.
float CameraRendererRGB565GL2::GetRenderingFPS | ( | ) |
Returns GPU Rendering FPS for Camera frames.
bool CameraRendererRGB565GL2::Init | ( | ) |
Initializes the object.
bool CameraRendererRGB565GL2::Init | ( | ) |
Initializes the object.
bool CameraRendererRGB565GL2::InitGPU | ( | ) | [protected] |
Initializes the object.
bool CameraRendererRGB565GL2::InitGPU | ( | ) | [protected] |
Initializes the object.
bool CameraRendererRGB565GL2::Render | ( | const uint8_t * | img, |
uint16_t | w, | ||
uint16_t | h | ||
) |
Renders provided camera image in NV21 format in current viewport.
img | Input image in NV21 format. |
w | Width of input image. |
h | Height of input image. |
bool CameraRendererRGB565GL2::Render | ( | const uint8_t * | img, |
uint16_t | w, | ||
uint16_t | h | ||
) |
Renders provided camera image in NV21 format in current viewport.
img | Input image in NV21 format. |
w | Width of input image. |
h | Height of input image. |
bool CameraRendererRGB565GL2::RenderGPURGB | ( | const uint8_t * | rgbImg, |
uint16_t | w, | ||
uint16_t | h | ||
) | [protected] |
Renders texture in current viewport by provide RGB image to GPU.
rgbImg | Input image in YUV420SP format. |
w | Width of input image. |
h | Height of input image. |
bool CameraRendererRGB565GL2::RenderGPURGB | ( | const uint8_t * | rgbImg, |
uint16_t | w, | ||
uint16_t | h | ||
) | [protected] |
Renders texture in current viewport by provide RGB image to GPU.
rgbImg | Input image in YUV420SP format. |
w | Width of input image. |
h | Height of input image. |
void CameraRendererRGB565GL2::UnInit | ( | ) |
UnInitializes the object.
Releases any graphics resources held such as shader programs and textures.
void CameraRendererRGB565GL2::UnInit | ( | ) |
UnInitializes the object.
Releases any graphics resources held such as shader programs and textures.
bool CameraRendererRGB565GL2::UpdateTextures | ( | const uint8_t * | rgbImg, |
uint16_t | w, | ||
uint16_t | h | ||
) | [protected] |
Updates texture with new input image.
rgbImg | input image in RGB565 format |
w | Width of input image. |
h | Height of input image. |
bool CameraRendererRGB565GL2::UpdateTextures | ( | const uint8_t * | rgbImg, |
uint16_t | w, | ||
uint16_t | h | ||
) | [protected] |
Updates texture with new input image.
rgbImg | input image in RGB565 format |
w | Width of input image. |
h | Height of input image. |
FPSCounter CameraRendererRGB565GL2::mFPSCounter [protected] |
FPS counter for Camera frame rendering.
GLint CameraRendererRGB565GL2::mGL_av2_TexCoordLoc [protected] |
Location for OpenGL shader attribute for quad texture mapping.
GLint CameraRendererRGB565GL2::mGL_av4_PositionLoc [protected] |
Location for OpenGL shader attribute for quad vertices.
GLint CameraRendererRGB565GL2::mGL_u_ImgRGBLoc [protected] |
Location for OpenGL shader uniform for RGB Image sampler.
GLuint CameraRendererRGB565GL2::mHeight [protected] |
Height
bool CameraRendererRGB565GL2::mInitialized [protected] |
Flag indicating initialization status
static const GLfloat CameraRendererRGB565GL2::mLandscapeReverseVertices [static, protected] |
{ 1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, -1.0f, 0.0f, 1.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f }
Reference vertex array for reverse landscape rendering
static const GLfloat CameraRendererRGB565GL2::mLandscapeVertices [static, protected] |
{ -1.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 1.0f, 1.0f }
Reference vertex array for landscape rendering
bool CameraRendererRGB565GL2::mNPOTTextures [protected] |
Flag indicating non-power-of-two texture support
static const GLfloat CameraRendererRGB565GL2::mPortraitReverseVertices [static, protected] |
{ -1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f }
Reference vertex array for reverse portrait rendering
static const GLfloat CameraRendererRGB565GL2::mPortraitVertices [static, protected] |
{ 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, -1.0f, 0.0f, 1.0f, 0.0f, -1.0f, -1.0f, 0.0f, 1.0f, 1.0f }
Reference vertex array for portrait rendering
GLuint CameraRendererRGB565GL2::mProgramObject [protected] |
Compiled and Linked Shader Program object.
GLuint CameraRendererRGB565GL2::mTextureId [protected] |
Array for texture ids. Either one or two of these array will be used depending rendering mode.
static GLfloat CameraRendererRGB565GL2::mVertices [static, protected] |
Vertex Array used to define Quad for drawing and its texture mapping.
GLuint CameraRendererRGB565GL2::mWidth [protected] |
Width