00001 #ifndef __DW_FLTKIMGBUF_HH__
00002 #define __DW_FLTKIMGBUF_HH__
00003
00004 #ifndef __INCLUDED_FROM_DW_FLTK_CORE_HH__
00005 # error Do not include this file directly, use "fltkcore.hh" instead.
00006 #endif
00007
00008 namespace dw {
00009 namespace fltk {
00010
00011 class FltkImgbuf: public core::Imgbuf
00012 {
00013 private:
00014 FltkImgbuf *root;
00015 int refCount;
00016 bool deleteOnUnref;
00017 lout::container::typed::List <FltkImgbuf> *scaledBuffers;
00018
00019 int width, height;
00020 Type type;
00021
00022
00023 int bpp;
00024 uchar *rawdata;
00025
00026
00027
00028
00029 lout::misc::BitSet *copiedRows;
00030
00031 FltkImgbuf (Type type, int width, int height, FltkImgbuf *root);
00032 void init (Type type, int width, int height, FltkImgbuf *root);
00033 int scaledY(int ySrc);
00034 int isRoot() { return (root == NULL); }
00035 void detachScaledBuf (FltkImgbuf *scaledBuf);
00036
00037 protected:
00038 ~FltkImgbuf ();
00039
00040 public:
00041 FltkImgbuf (Type type, int width, int height);
00042
00043 void setCMap (int *colors, int num_colors);
00044 inline void scaleRow (int row, const core::byte *data);
00045 void newScan ();
00046 void copyRow (int row, const core::byte *data);
00047 core::Imgbuf* getScaledBuf (int width, int height);
00048 void getRowArea (int row, dw::core::Rectangle *area);
00049 int getRootWidth ();
00050 int getRootHeight ();
00051 void ref ();
00052 void unref ();
00053
00054 bool lastReference ();
00055 void setDeleteOnUnref (bool deleteOnUnref);
00056 bool isReferred ();
00057
00058 void draw (Fl_Widget *target, int xRoot, int yRoot,
00059 int x, int y, int width, int height);
00060 };
00061
00062 }
00063 }
00064
00065 #endif // __DW_FLTK_IMGBUF_HH__