// -*- c++ -*- #pragma once #ifndef __RAYS_BITMAP_H__ #define __RAYS_BITMAP_H__ #include #include #include #include namespace Rays { class Bitmap { public: Bitmap (); Bitmap (int width, int height, const ColorSpace& cs = RGBA); ~Bitmap (); int width () const; int height () const; const ColorSpace& color_space () const; int pitch () const; size_t size () const; bool dirty () const; void set_dirty (bool b = true); void* data (); const void* data () const; template T* at (int x, int y) { return (T*) (((char*) data()) + pitch() * y + x * color_space().Bpp()); } template const T* at (int x, int y) const { return const_cast(this)->at(x, y); } operator bool () const; bool operator ! () const; struct Data; Impl self; };// Bitmap bool load_bitmap (Bitmap* bitmap, const char* path); bool save_bitmap (const Bitmap& bitmap, const char* path); bool draw_string ( Bitmap* bitmap, const char* str, coord x = 0, coord y = 0, const Font& font = default_font()); }// Rays #endif//EOH