include/pixmap.h
branchpyrit
changeset 98 64638385798a
parent 96 9eb71e76c7fd
equal deleted inserted replaced
97:2a853d284a6a 98:64638385798a
    65 #endif
    65 #endif
    66 	};
    66 	};
    67 
    67 
    68 	void setData(Float *afdata, int aw, int ah)
    68 	void setData(Float *afdata, int aw, int ah)
    69 		{ fdata = afdata; w = aw; h = ah; };
    69 		{ fdata = afdata; w = aw; h = ah; };
       
    70 
       
    71 	/** get colour of pixel x,y */
    70 	const Colour &get(int x, int y) const { return data[y*w + x]; };
    72 	const Colour &get(int x, int y) const { return data[y*w + x]; };
    71 	const int &getWidth() const { return w; };
    73 	const int &getWidth() const { return w; };
    72 	const int &getHeight() const { return h; };
    74 	const int &getHeight() const { return h; };
       
    75 
       
    76 	/** get pixmap data as array of floats */
    73 	Float*& getFloatData() { return fdata; };
    77 	Float*& getFloatData() { return fdata; };
       
    78 
       
    79 	/** get pixmap data as array of chars */
    74 	unsigned char *getCharData() const;
    80 	unsigned char *getCharData() const;
       
    81 
       
    82 	/** write pixmap data to PNG file */
    75 	int writePNG(const char *fname) const;
    83 	int writePNG(const char *fname) const;
    76 };
    84 };
    77 
    85 
    78 #endif
    86 #endif