Simple renderer for rendering textured face meshes.  
 More...
#include <face_renderer.h>
Simple renderer for rendering textured face meshes. 
 
      
        
          | void face_swap::FaceRenderer::init  | 
          ( | 
          int  | 
          width,  | 
        
        
           | 
           | 
          int  | 
          height,  | 
        
        
           | 
           | 
          bool  | 
          force = false  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Initialize buffers and viewport. 
- Parameters
 - 
  
    | width | The width of the viewport [pixels].  | 
    | height | The height of the viewport [pixels].  | 
    | force | Force initialization even if the resolution is the same as the last one.  | 
  
   
 
 
      
        
          | void face_swap::FaceRenderer::render  | 
          ( | 
          const cv::Mat &  | 
          vecR,  | 
        
        
           | 
           | 
          const cv::Mat &  | 
          vecT  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Render with the specified pose. 
- Parameters
 - 
  
    | vecR | Rotation vector [Euler angles].  | 
    | vecT | Translation vector.  | 
  
   
 
 
      
        
          | void face_swap::FaceRenderer::setLight  | 
          ( | 
          const cv::Mat &  | 
          pos_dir,  | 
        
        
           | 
           | 
          const cv::Mat &  | 
          ambient,  | 
        
        
           | 
           | 
          const cv::Mat &  | 
          diffuse  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Set light position and color. 
- Parameters
 - 
  
    | pos_dir | Light's position or direction in OpenGL's format.  | 
    | ambient | Light's ambient color in OpenGL's format.  | 
    | diffuse | Light's diffuse color in OpenGL's format.  | 
  
   
 
 
      
        
          | void face_swap::FaceRenderer::setProjection  | 
          ( | 
          float  | 
          f,  | 
        
        
           | 
           | 
          float  | 
          z_near = 10,  | 
        
        
           | 
           | 
          float  | 
          z_far = 10000  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Set projection. 
- Parameters
 - 
  
    | f | Focal length.  | 
    | z_near | The near plane distance on Z axis.  | 
    | z_far | The far plane distance on Z axis.  | 
  
   
 
 
      
        
          | void face_swap::FaceRenderer::setViewport  | 
          ( | 
          int  | 
          width,  | 
        
        
           | 
           | 
          int  | 
          height  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Set viewport resolution. 
- Parameters
 - 
  
    | width | The width of the viewport [pixels].  | 
    | height | The height of the viewport [pixels].  | 
  
   
 
 
The documentation for this class was generated from the following file: