include/pixmap.h
branchpyrit
changeset 90 f6a72eb99631
parent 88 f7edb3b90816
child 94 4c8abb8977dc
equal deleted inserted replaced
89:fcf1487b398b 90:f6a72eb99631
    51 	virtual ~Pixmap() { if (!refdata) delete[] data; };
    51 	virtual ~Pixmap() { if (!refdata) delete[] data; };
    52 
    52 
    53 	void setData(Float *afdata, int aw, int ah)
    53 	void setData(Float *afdata, int aw, int ah)
    54 		{ fdata = afdata; w = aw; h = ah; };
    54 		{ fdata = afdata; w = aw; h = ah; };
    55 	Colour get(int x, int y) { return data[y*w + x]; };
    55 	Colour get(int x, int y) { return data[y*w + x]; };
    56 	const int &getWidth() { return w; };
    56 	const int &getWidth() const { return w; };
    57 	const int &getHeight() { return h; };
    57 	const int &getHeight() const { return h; };
    58 	Float*& getFloatData() { return fdata; };
    58 	Float*& getFloatData() { return fdata; };
    59 	unsigned char *getCharData() const;
    59 	unsigned char *getCharData() const;
    60 	int writePNG(const char *fname) const;
    60 	int writePNG(const char *fname) const;
    61 };
    61 };
    62 
    62