1 | // |
---|
2 | // "$Id: rgbImage.h 4443 2005-07-21 03:49:42Z spitzak $" |
---|
3 | // |
---|
4 | // Image subclass that draws uncompressed 8-bit rgb data from memory. |
---|
5 | // |
---|
6 | // Copyright 1998-2003 by Bill Spitzak and others. |
---|
7 | // |
---|
8 | // This library is free software; you can redistribute it and/or |
---|
9 | // modify it under the terms of the GNU Library General Public |
---|
10 | // License as published by the Free Software Foundation; either |
---|
11 | // version 2 of the License, or (at your option) any later version. |
---|
12 | // |
---|
13 | // This library is distributed in the hope that it will be useful, |
---|
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | // Library General Public License for more details. |
---|
17 | // |
---|
18 | // You should have received a copy of the GNU Library General Public |
---|
19 | // License along with this library; if not, write to the Free Software |
---|
20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
---|
21 | // USA. |
---|
22 | // |
---|
23 | // Please report all bugs and problems to "fltk-bugs@fltk.org". |
---|
24 | // |
---|
25 | |
---|
26 | #ifndef fltk_rgbImage_h |
---|
27 | #define fltk_rgbImage_h |
---|
28 | |
---|
29 | #include "Image.h" |
---|
30 | |
---|
31 | namespace fltk { |
---|
32 | |
---|
33 | class FL_API rgbImage : public Image { |
---|
34 | const uchar* pixels_; |
---|
35 | PixelType pixeltype_; |
---|
36 | int linedelta_; |
---|
37 | public: |
---|
38 | PixelType pixeltype() const {return pixeltype_;} |
---|
39 | int depth() const {return fltk::depth(pixeltype_);} |
---|
40 | int linedelta() const {return linedelta_;} |
---|
41 | const uchar* pixels() const {return pixels_;} |
---|
42 | |
---|
43 | void update(); |
---|
44 | //bool write_jpeg(const char *filename, int quality=75, int dpi=150); |
---|
45 | |
---|
46 | rgbImage(const uchar* d, PixelType p, int W, int H, const char* name=0) : |
---|
47 | Image(W,H,name), pixels_(d), pixeltype_(p) {linedelta_=W*depth();} |
---|
48 | |
---|
49 | rgbImage(const uchar* d, PixelType p, int W, int H, int linedelta) : |
---|
50 | Image(W,H), pixels_(d), pixeltype_(p), linedelta_(linedelta) {} |
---|
51 | |
---|
52 | }; |
---|
53 | |
---|
54 | } |
---|
55 | |
---|
56 | #endif |
---|
57 | |
---|
58 | // |
---|
59 | // End of "$Id: rgbImage.h 4443 2005-07-21 03:49:42Z spitzak $". |
---|
60 | // |
---|