#include "read_pixels.h" template void igl::opengl::read_pixels( const GLuint width, const GLuint height, Eigen::Matrix & R, Eigen::Matrix & G, Eigen::Matrix & B, Eigen::Matrix & A, Eigen::Matrix & D) { R.resize(width,height); G.resize(width,height); B.resize(width,height); A.resize(width,height); D.resize(width,height); typedef typename std::conditional< std::is_floating_point::value,GLfloat,GLubyte>::type GLType; GLenum type = std::is_floating_point::value ? GL_FLOAT : GL_UNSIGNED_BYTE; GLType* pixels = (GLType*)calloc(width*height*4,sizeof(GLType)); GLType * depth = (GLType*)calloc(width*height*1,sizeof(GLType)); glReadPixels(0, 0,width, height,GL_RGBA, type, pixels); glReadPixels(0, 0,width, height,GL_DEPTH_COMPONENT, type, depth); int count = 0; for (unsigned j=0; j(unsigned int, unsigned int, Eigen::Matrix&, Eigen::Matrix&, Eigen::Matrix&, Eigen::Matrix&, Eigen::Matrix&); template void igl::opengl::read_pixels(unsigned int, unsigned int, Eigen::Matrix&, Eigen::Matrix&, Eigen::Matrix&, Eigen::Matrix&, Eigen::Matrix&); template void igl::opengl::read_pixels(unsigned int, unsigned int, Eigen::Matrix&, Eigen::Matrix&, Eigen::Matrix&, Eigen::Matrix&, Eigen::Matrix&); #endif