1 // This file is part of libigl, a simple c++ geometry processing library.
2 //
3 // Copyright (C) 2016 Daniele Panozzo <daniele.panozzo@gmail.com>
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public License
6 // v. 2.0. If a copy of the MPL was not distributed with this file, You can
7 // obtain one at http://mozilla.org/MPL/2.0/.
8 #ifndef IGL_PNG_READ_PNG_H
9 #define IGL_PNG_READ_PNG_H
10 #include "../igl_inline.h"
11 #include <Eigen/Core>
12 #include <string>
13 
14 namespace igl
15 {
16   namespace png
17   {
18     // Read an image from a .png file into 4 memory buffers
19     //
20     // Input:
21     //  png_file  path to .png file
22     // Output:
23     //  R,G,B,A texture channels
24     // Returns true on success, false on failure
25     //
26     IGL_INLINE bool readPNG(const std::string png_file,
27     Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& R,
28     Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& G,
29     Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& B,
30     Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& A
31     );
32   }
33 }
34 
35 #ifndef IGL_STATIC_LIBRARY
36 #  include "readPNG.cpp"
37 #endif
38 
39 #endif
40