// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2016 Daniele Panozzo // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #include "readPNG.h" #include IGL_INLINE bool igl::png::readPNG( const std::string png_file, Eigen::Matrix& R, Eigen::Matrix& G, Eigen::Matrix& B, Eigen::Matrix& A ) { int cols,rows,n; unsigned char *data = stbi_load(png_file.c_str(), &cols, &rows, &n, 4); if(data == NULL) { return false; } R.resize(cols,rows); G.resize(cols,rows); B.resize(cols,rows); A.resize(cols,rows); for (unsigned i=0; i