include/rays/bitmap.h in rays-0.1.12 vs include/rays/bitmap.h in rays-0.1.13

- old
+ new

@@ -12,13 +12,10 @@ namespace Rays { - class Texture; - - class Bitmap { typedef Bitmap This; @@ -28,15 +25,13 @@ Bitmap ( int width, int height, const ColorSpace& cs = RGBA, const void* pixels = NULL); - Bitmap (const Texture& texture); - ~Bitmap (); - Bitmap copy () const; + Bitmap dup () const; int width () const; int height () const; @@ -48,42 +43,35 @@ void* pixels (); const void* pixels () const; - template <typename T> T* at (int x, int y) - { - return (T*) (((char*) pixels()) + pitch() * y + x * color_space().Bpp()); - } + template <typename T> T* at (int x, int y); - template <typename T> const T* at (int x, int y) const - { - return const_cast<This*>(this)->at<T>(x, y); - } + template <typename T> const T* at (int x, int y) const; - bool dirty () const; - - void set_dirty (bool b = true); - operator bool () const; bool operator ! () const; struct Data; - Xot::PImpl<Data, true> self; + Xot::PSharedImpl<Data> self; };// Bitmap - Bitmap load_bitmap (const char* path); + template <typename T> T* + Bitmap::at (int x, int y) + { + return (T*) (((char*) pixels()) + pitch() * y + x * color_space().Bpp()); + } - void save_bitmap (const Bitmap& bitmap, const char* path); - - - void draw_string ( - Bitmap* bitmap, const char* str, - coord x = 0, coord y = 0, const Font& font = default_font()); + template <typename T> const T* + Bitmap::at (int x, int y) const + { + return const_cast<This*>(this)->at<T>(x, y); + } }// Rays