#ifndef PNG_HPP
#define PNG_HPP

#include <string>
#include <png.h>
#include "types.hpp"

/**
 * Read a grayscale png file into grayImage struct.
 *
 * @note grayimage.data must be deleted manually.
 *
 * @param filename Name of the png file to read
 * @return grayImage containing the grayscale pixels from filename
 */
grayImage readPNG(std::string filename);

/**
 * Write content of a grayImage to a png file.
 *
 * @param in grayImage to write to png file
 * @param filename filename of output png file
 */
void writePNG(grayImage in, std::string filename);

#endif
