libigl v2.5.0
Loading...
Searching...
No Matches
igl::opengl::glfw Namespace Reference

Namespaces

namespace  imgui
 
namespace  serialization
 

Classes

class  Viewer
 
class  ViewerPlugin
 Abstract class for plugins All plugins MUST have this class as their parent and may implement any/all the callbacks marked virtual here. More...
 

Functions

bool background_window (GLFWwindow *&window)
 Create a background window with a valid core profile opengl context set to current.
 
template<typename DerivedV , typename DerivedF , typename DerivedU >
bool map_texture (const Eigen::MatrixBase< DerivedV > &_V, const Eigen::MatrixBase< DerivedF > &_F, const Eigen::MatrixBase< DerivedU > &_U, const unsigned char *in_data, const int w, const int h, const int nc, std::vector< unsigned char > &out_data, int &out_w, int &out_h, int &out_nc)
 Given a mesh (V,F) in [0,1]² and new positions (U) and a texture image (in_data), render a new image (out_data) of the same size.
 
template<typename DerivedV , typename DerivedF , typename DerivedU >
bool map_texture (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedU > &U, const unsigned char *in_data, const int w, const int h, const int nc, std::vector< unsigned char > &out_data)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Function Documentation

◆ background_window()

bool igl::opengl::glfw::background_window ( GLFWwindow *&  window)

Create a background window with a valid core profile opengl context set to current.

After you're finished with this window you may call glfwDestroyWindow(window)

After you're finished with glfw you should call glfwTerminate()

Parameters
[out]windowpointer to glfw window
Returns
true iff success

◆ map_texture() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedU >
bool igl::opengl::glfw::map_texture ( const Eigen::MatrixBase< DerivedV > &  _V,
const Eigen::MatrixBase< DerivedF > &  _F,
const Eigen::MatrixBase< DerivedU > &  _U,
const unsigned char *  in_data,
const int  w,
const int  h,
const int  nc,
std::vector< unsigned char > &  out_data,
int &  out_w,
int &  out_h,
int &  out_nc 
)

Given a mesh (V,F) in [0,1]² and new positions (U) and a texture image (in_data), render a new image (out_data) of the same size.

Parameters
[in]V#V by 2 list of undeformed mesh vertex positions ∈ [0,1]²
[in]F#F by 3 list of mesh triangle indices into V
[in]U#U by 2 list of deformed vertex positions ∈ [0,1]²
[in]in_dataw*h*nc array of color values, channels, then columns, then rows (e.g., what stbi_image returns and expects)
[in]wwidth
[in]hheight
[in]ncnumber of channels
[out]out_datah*w*nc list of output colors in same order as input
[out]out_wwidth of output image
[out]out_hheight of output image
[out]out_ncnumber of channels of output image
Precondition
Seems like w,h should be equal.

◆ map_texture() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedU >
bool igl::opengl::glfw::map_texture ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedU > &  U,
const unsigned char *  in_data,
const int  w,
const int  h,
const int  nc,
std::vector< unsigned char > &  out_data 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.