#ifndef __GENPIXEL_HPP #define __GENPIXEL_HPP class PixelMap { public: typedef unsigned char pixel; PixelMap(unsigned w, unsigned h) : width(w), height(h), p(new pixel[w*h]) {} ~PixelMap() { delete[] p; } pixel queryPixel(unsigned x, unsigned y) const {return p[y*width+x]; } void setPixel(unsigned x, unsigned y, pixel pv) { p[y*width+x] = pv; } void setBlock(unsigned leftx, unsigned topy, unsigned width, unsigned height, PixelMap::pixel pv); unsigned queryWidth() const { return width; } unsigned queryHeight() const { return height; } private: pixel *p; unsigned width,height; }; class Labyrinth; extern void GeneratePixelMap(const Labyrinth &lab, PixelMap& pm, unsigned cellWidth, unsigned cellHeight); #endif