X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fcanvas%2Fcanvas%2Fimage.h;h=292de567230b8faea47ec1d5a4cc77a0050a5e89;hb=9a0a2a29b53a7d8b74d64039a3a594e54262ef29;hp=3ea2aaae48a6c3c4cd619cde7358fb68ad48d732;hpb=dfdb91b429e4f40e1883669bec58b9674ab8d2c2;p=ardour.git diff --git a/libs/canvas/canvas/image.h b/libs/canvas/canvas/image.h index 3ea2aaae48..292de56723 100644 --- a/libs/canvas/canvas/image.h +++ b/libs/canvas/canvas/image.h @@ -23,6 +23,7 @@ #include #include +#include "canvas/visibility.h" #include "canvas/item.h" typedef void (*ImageReleaseCallback)(uint8_t *d, void *arg); @@ -30,11 +31,12 @@ typedef void (*ImageReleaseCallback)(uint8_t *d, void *arg); namespace ArdourCanvas { -class Image : public Item +class LIBCANVAS_API Image : public Item { public: - Image (Group *, Cairo::Format, int width, int height); - + Image (Canvas *, Cairo::Format, int width, int height); + Image (Item*, Cairo::Format, int width, int height); + struct Data { Data (uint8_t *d, int w, int h, int s, Cairo::Format fmt) : data (d) @@ -47,7 +49,6 @@ public: {} virtual ~Data () { - std::cerr << "Data @ " << this << " being deleted, data ptr = " << data << " cb = " << destroy_callback << std::endl; if (destroy_callback) { destroy_callback(data, destroy_arg); } else { @@ -64,12 +65,12 @@ public: void* destroy_arg; }; - /** - * Returns a shared_ptr to a Data object that can be used to + /** + * Returns a shared_ptr to a Data object that can be used to * write image data to. The Data object will contain a pointer * to the buffer, along with image properties that may be * useful during the data writing. - * + * * Can be called from any thread BUT .. * * ... to avoid collisions with Image deletion, some synchronization method @@ -91,12 +92,11 @@ public: void render (Rect const &, Cairo::RefPtr) const; void compute_bounding_box () const; - + private: Cairo::Format _format; int _width; int _height; - int _data; mutable boost::shared_ptr _current; boost::shared_ptr _pending; mutable bool _need_render;