Diffstat (limited to 'core/multimedia/opieplayer/libflash/bitmap.h') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libflash/bitmap.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/libflash/bitmap.h b/core/multimedia/opieplayer/libflash/bitmap.h new file mode 100644 index 0000000..7925309 --- a/dev/null +++ b/core/multimedia/opieplayer/libflash/bitmap.h | |||
@@ -0,0 +1,72 @@ | |||
1 | ///////////////////////////////////////////////////////////// | ||
2 | // Flash Plugin and Player | ||
3 | // Copyright (C) 1998 Olivier Debon | ||
4 | // | ||
5 | // This program is free software; you can redistribute it and/or | ||
6 | // modify it under the terms of the GNU General Public License | ||
7 | // as published by the Free Software Foundation; either version 2 | ||
8 | // of the License, or (at your option) any later version. | ||
9 | // | ||
10 | // This program is distributed in the hope that it will be useful, | ||
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | // GNU General Public License for more details. | ||
14 | // | ||
15 | // You should have received a copy of the GNU General Public License | ||
16 | // along with this program; if not, write to the Free Software | ||
17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
18 | // | ||
19 | /////////////////////////////////////////////////////////////// | ||
20 | #ifndef _BITMAP_H_ | ||
21 | #define _BITMAP_H_ | ||
22 | |||
23 | struct MyErrorHandler { | ||
24 | struct jpeg_error_mgr pub; | ||
25 | jmp_buf setjmp_buffer; | ||
26 | }; | ||
27 | |||
28 | class Bitmap : public Character { | ||
29 | public: | ||
30 | long width; | ||
31 | long height; | ||
32 | long bpl; | ||
33 | long depth; | ||
34 | |||
35 | unsigned char *pixels; // Array of Pixels | ||
36 | Color *colormap; // Array of color definitions | ||
37 | long nbColors; | ||
38 | |||
39 | unsigned char *alpha_buf;// Array of alpha values (no alpha if NULL) | ||
40 | |||
41 | int defLevel; | ||
42 | |||
43 | // Class Variables | ||
44 | |||
45 | static int haveTables; | ||
46 | static struct jpeg_decompress_struct jpegObject; | ||
47 | static struct jpeg_source_mgr jpegSourceManager; | ||
48 | static MyErrorHandler jpegErrorMgr; | ||
49 | |||
50 | public: | ||
51 | Bitmap(long id, int level = 1); | ||
52 | ~Bitmap(); | ||
53 | |||
54 | // JPEG handling methods | ||
55 | int buildFromJpegInterchangeData(unsigned char *stream, int alpha, long offset);// Complete | ||
56 | int buildFromJpegAbbreviatedData(unsigned char *stream);// Abbreviated | ||
57 | |||
58 | // Class Method | ||
59 | static int readJpegTables(unsigned char *stream);// Tables Only | ||
60 | |||
61 | // ZLIB handling methods | ||
62 | int buildFromZlibData(unsigned char *buffer, | ||
63 | int width, int height, | ||
64 | int format, int tableSize, int tableHasAlpha); | ||
65 | |||
66 | long getWidth(); | ||
67 | long getHeight(); | ||
68 | Color *getColormap(long *n); | ||
69 | unsigned char *getPixels(); | ||
70 | }; | ||
71 | |||
72 | #endif /* _BITMAP_H_ */ | ||