// C++ code Copyright (C) David R. Evans G4AMJ/NQ0I // grey scale for surface #ifndef GFH #define GFH #include const int GREY_FONT_BUFFER_SIZE = 5000; // grey_font is an ABC class grey_font { protected: enum { MAX_SIZE = 200 }; static int fonts_created; uint16 w, h; // I suppose one of these might be > 255 int font_number, index, bias; int buffer[GREY_FONT_BUFFER_SIZE]; virtual void* _generate_square(const uint16 n_black) = 0; virtual void _generate_squares(void) = 0; virtual uint16 _rebuild(const uint16 width, const uint16 height) = 0; void _set_bit(char*, const int, const int, const int); int _get_bit(char*, const int, const int); public: grey_font(const uint16 width = 0, const uint16 height = 0); virtual ~grey_font(void) { } reveal(int, length, index); reveal(int, offset, bias); reveal(int, number, font_number); inline void length(const int n) { index = n; } inline int element(const int n) { return buffer[n]; } void operator+=(const uint32); inline virtual uint32 max_character_number(const uint16 width, const uint16 height) { return ((uint32)width * height); } // Nick requires resize to be virtual virtual int resize(const uint16 width = 0, const uint16 height = 0); inline uint16 height(void) const { return h; } inline uint16 width(void) const { return w; } boolean null(void) const; inline boolean null(int n) const { return (buffer[n] == bias); } virtual void* memory_pattern(const int) { return NULL; } }; #endif