Dillo v3.1.1-119-g140d9ebd
Loading...
Searching...
No Matches
fltkimgbuf.hh
Go to the documentation of this file.
1#ifndef __DW_FLTKIMGBUF_HH__
2#define __DW_FLTKIMGBUF_HH__
3
4#ifndef __INCLUDED_FROM_DW_FLTK_CORE_HH__
5# error Do not include this file directly, use "fltkcore.hh" instead.
6#endif
7
8namespace dw {
9namespace fltk {
10
12{
13private:
15 {
16 public:
17 double gamma;
18 uchar map[256];
19 };
20
24 lout::container::typed::List <FltkImgbuf> *scaledBuffers;
25
28 double gamma;
29
30//{
31 int bpp;
32 uchar *rawdata;
33//}
34
35 // This is just for testing drawing, it has to be replaced by
36 // the image buffer.
38
39 static lout::container::typed::Vector <GammaCorrectionTable>
41
42 static uchar *findGammaCorrectionTable (double gamma);
43 static bool excessiveImageDimensions (int width, int height);
44
45 FltkImgbuf (Type type, int width, int height, double gamma,
47 void init (Type type, int width, int height, double gamma, FltkImgbuf *root);
48 int scaledY(int ySrc);
49 int backscaledY(int yScaled);
50 int isRoot() { return (root == NULL); }
51 void detachScaledBuf (FltkImgbuf *scaledBuf);
52
53protected:
54 ~FltkImgbuf ();
55
56public:
57 FltkImgbuf (Type type, int width, int height, double gamma);
58
59 static void freeall ();
60
61 void setCMap (int *colors, int num_colors);
62 inline void scaleRow (int row, const core::byte *data);
63 inline void scaleRowSimple (int row, const core::byte *data);
64 inline void scaleRowBeautiful (int row, const core::byte *data);
65 inline static void scaleBuffer (const core::byte *src, int srcWidth,
66 int srcHeight, core::byte *dest,
67 int destWidth, int destHeight, int bpp,
68 double gamma);
69
70 void newScan ();
71 void copyRow (int row, const core::byte *data);
73 void getRowArea (int row, dw::core::Rectangle *area);
74 int getRootWidth ();
75 int getRootHeight ();
77 void copyTo (Imgbuf *dest, int xDestRoot, int yDestRoot,
78 int xSrc, int ySrc, int widthSrc, int heightSrc);
79 void ref ();
80 void unref ();
81
82 bool lastReference ();
84 bool isReferred ();
85
86 void draw (Fl_Widget *target, int xRoot, int yRoot,
87 int x, int y, int width, int height);
88};
89
90} // namespace fltk
91} // namespace dw
92
93#endif // __DW_FLTK_IMGBUF_HH__
The platform independent interface for image buffers.
Definition imgbuf.hh:162
dw::core::Shape implemtation for simple rectangles.
Definition types.hh:70
void setCMap(int *colors, int num_colors)
void getRowArea(int row, dw::core::Rectangle *area)
FltkImgbuf * root
Definition fltkimgbuf.hh:21
void draw(Fl_Widget *target, int xRoot, int yRoot, int x, int y, int width, int height)
void copyTo(Imgbuf *dest, int xDestRoot, int yDestRoot, int xSrc, int ySrc, int widthSrc, int heightSrc)
static uchar * findGammaCorrectionTable(double gamma)
Definition fltkimgbuf.cc:43
static bool excessiveImageDimensions(int width, int height)
Definition fltkimgbuf.cc:66
void copyRow(int row, const core::byte *data)
void setDeleteOnUnref(bool deleteOnUnref)
static void scaleBuffer(const core::byte *src, int srcWidth, int srcHeight, core::byte *dest, int destWidth, int destHeight, int bpp, double gamma)
General method to scale an image buffer.
void scaleRow(int row, const core::byte *data)
core::Imgbuf * createSimilarBuf(int width, int height)
Creates an image buffer with same parameters (type, gamma etc.) except size.
core::Imgbuf * getScaledBuf(int width, int height)
static lout::container::typed::Vector< GammaCorrectionTable > * gammaCorrectionTables
Definition fltkimgbuf.hh:40
void detachScaledBuf(FltkImgbuf *scaledBuf)
This method is called for the root buffer, when a scaled buffer removed.
lout::container::typed::List< FltkImgbuf > * scaledBuffers
Definition fltkimgbuf.hh:24
void scaleRowBeautiful(int row, const core::byte *data)
static void freeall()
Definition fltkimgbuf.cc:72
int backscaledY(int yScaled)
void scaleRowSimple(int row, const core::byte *data)
lout::misc::BitSet * copiedRows
Definition fltkimgbuf.hh:37
int scaledY(int ySrc)
void init(Type type, int width, int height, double gamma, FltkImgbuf *root)
Definition fltkimgbuf.cc:96
A bit set, which automatically reallocates when needed.
Definition misc.hh:609
This is the base class for many other classes, which defines very common virtual methods.
Definition object.hh:25
unsigned char byte
Definition core.hh:25
Dw is in this namespace, or sub namespaces of this one.