1 #ifndef FACE_SWAP_FACE_RENDERER_H 2 #define FACE_SWAP_FACE_RENDERER_H 4 #include "face_swap/basel_3dmm.h" 5 #include <opencv2/core.hpp> 28 void init(
int width,
int height,
bool force =
false);
53 void setProjection(
float f,
float z_near = 10,
float z_far= 10000);
63 void render(
const cv::Mat& vecR,
const cv::Mat& vecT);
78 void setLight(
const cv::Mat& pos_dir,
const cv::Mat& ambient,
const cv::Mat& diffuse);
88 int m_width = 0, m_height = 0;
89 int m_tex_width = 0, m_tex_height = 0;
90 unsigned int m_dynamic_tex_id = 0;
91 unsigned int m_fbo = 0;
92 unsigned int m_depth_rb = 0;
95 unsigned int m_mesh_vert_id = 0;
96 unsigned int m_mesh_uv_id = 0;
97 unsigned int m_mesh_faces_id = 0;
98 unsigned int m_mesh_total_faces = 0;
99 unsigned int m_mesh_total_vertices = 0;
100 unsigned int m_mesh_tex_id = 0;
101 unsigned int m_mesh_tex_width = 0;
102 unsigned int m_mesh_tex_height = 0;
103 unsigned int m_mesh_normals_id = 0;
108 #endif //FACE_SWAP_FACE_RENDERER_H void setMesh(const Mesh &mesh)
Set mesh to render.
void setProjection(float f, float z_near=10, float z_far=10000)
Set projection.
void clearLight()
Clear previously set light.
void init(int width, int height, bool force=false)
Initialize buffers and viewport.
void getFrameBuffer(cv::Mat &img)
Get frame buffer (should be called after render).
void clearFrameBuffer()
Clear the frame buffer.
Simple renderer for rendering textured face meshes.
Definition: face_renderer.h:11
void setLight(const cv::Mat &pos_dir, const cv::Mat &ambient, const cv::Mat &diffuse)
Set light position and color.
Represents a 3D renderable shape.
Definition: basel_3dmm.h:13
Definition: basel_3dmm.h:9
void clear()
Clear all allocated data.
void clearMesh()
Clear the mesh.
void getDepthBuffer(cv::Mat &depth)
Get depth buffer (should be called after render).
~FaceRenderer()
Destrcutor.
void render(const cv::Mat &vecR, const cv::Mat &vecT)
Render with the specified pose.
FaceRenderer()
Create an instance of FaceRenderer.
void setViewport(int width, int height)
Set viewport resolution.