28 lines
476 B
C++

#ifndef IMAGE
#define IMAGE
#include <string>
#include <vector>
struct Image
{
int width;
int height;
int depth;
std::vector<unsigned char> pixels;
Image() : width(0), height(0), depth(8) {}
Image(int myDepth, int myWidth, int myHeight, float frequency, float amplitude);
Image(const std::string &pngFile);
void allocate(int size)
{ pixels.resize(size); }
bool save(const std::string &filename);
};
#endif // IMAGE