#pragma once
class ZImage
{
private:
	int width;
	int height;
	int size;
	int zoom;
	int zoomedWidth;
	int zoomedHeight;
	int zoomedSize;
	unsigned char* imageBuffer;
	unsigned char* effectBuffer;
	double* opacityBuffer;
	unsigned char* resultBuffer;
	unsigned char randomPallet[3000] = {};
public:
	ZImage(int w, int h, int z);
	void close();
	int save(const char* name);
	int save(const char* name, int ox, int oy, int w, int h);
	void clearEffect();
	void drawGrayscaleImage(unsigned char* image, int offset);
	void setPixel(int position, unsigned char r, unsigned char g, unsigned char b);
	void setPixel(int position, int index);
	void setPixel(int x, int y, unsigned char r, unsigned char g, unsigned char b);
	void setPixel(int x, int y, int index);

	void setNumber(int i, int text, unsigned char r, unsigned char g, unsigned char b);
	void setNumber(int x, int y, int text, unsigned char r, unsigned char g, unsigned char b);
	void setNumber(int x, int y, int text, unsigned char r, unsigned char g, unsigned char b, int offsetX, int offsetY);

	void effectGrid(int i, bool left, bool top, bool right, bool bottom, unsigned char r, unsigned char g, unsigned char b);
	void effectGrid(int x, int y, bool left, bool top, bool right, bool bottom, unsigned char r, unsigned char g, unsigned char b);
	void effectEllipse(double cx, double cy, double radius, unsigned char r, unsigned char g, unsigned char b);
	void effectPixel(int x, int y, unsigned char r, unsigned char g, unsigned char b);
	void effectLine(int i, int j, unsigned char r, unsigned char g, unsigned char b);
	void effectLine(int x1, int y1, int x2, int y2, unsigned char r, unsigned char g, unsigned char b);
};

