author | mickeyl <mickeyl> | 2003-05-07 10:21:55 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-07 10:21:55 (UTC) |
commit | 8e20590a250d4e75153fbca93330b4add0c34161 (patch) (unidiff) | |
tree | cee8a56401dd8c42a8a1c8e7a3978cc0e79a54ac | |
parent | b632caef8d73edb7b5cab0c1b58df723ed654410 (diff) | |
download | opie-8e20590a250d4e75153fbca93330b4add0c34161.zip opie-8e20590a250d4e75153fbca93330b4add0c34161.tar.gz opie-8e20590a250d4e75153fbca93330b4add0c34161.tar.bz2 |
delete
-rw-r--r-- | noncore/multimedia/camera/avi.h | 142 | ||||
-rw-r--r-- | noncore/multimedia/camera/imageio.cpp | 55 | ||||
-rw-r--r-- | noncore/multimedia/camera/imageio.h | 26 |
3 files changed, 0 insertions, 223 deletions
diff --git a/noncore/multimedia/camera/avi.h b/noncore/multimedia/camera/avi.h deleted file mode 100644 index fbdc14a..0000000 --- a/noncore/multimedia/camera/avi.h +++ b/dev/null | |||
@@ -1,142 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2003 Michael 'Mickey' Lauer. All rights reserved. | ||
3 | ** Based on work from Andrew Tridgell and the jpegtoavi project | ||
4 | ** | ||
5 | ** This file is part of Opie Environment. | ||
6 | ** | ||
7 | ** This file may be distributed and/or modified under the terms of the | ||
8 | ** GNU General Public License version 2 as published by the Free Software | ||
9 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
10 | ** packaging of this file. | ||
11 | ** | ||
12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
14 | ** | ||
15 | **********************************************************************/ | ||
16 | |||
17 | #ifndef AVI_H | ||
18 | #define AVI_H | ||
19 | |||
20 | #include <unistd.h> | ||
21 | #include <stdio.h> | ||
22 | #include <sys/types.h> | ||
23 | |||
24 | #ifdef __cplusplus | ||
25 | extern "C" { | ||
26 | #endif | ||
27 | |||
28 | typedef unsigned char u8; | ||
29 | typedef unsigned short u16; | ||
30 | typedef unsigned u32; | ||
31 | |||
32 | // header flags | ||
33 | |||
34 | const u32 AVIF_HASINDEX=0x00000010; /* index at end of file */ | ||
35 | const u32 AVIF_MUSTUSEINDEX=0x00000020; | ||
36 | const u32 AVIF_ISINTERLEAVED=0x00000100; | ||
37 | const u32 AVIF_TRUSTCKTYPE=0x00000800; | ||
38 | const u32 AVIF_WASCAPTUREFILE=0x00010000; | ||
39 | const u32 AVIF_COPYRIGHTED=0x00020000; | ||
40 | |||
41 | // function prototypes | ||
42 | |||
43 | void avi_start(int fd, int frame); | ||
44 | void avi_add(int fd, u8 *buf, int size); | ||
45 | void avi_end(int fd, int width, int height, int fps); | ||
46 | void fprint_quartet(int fd, unsigned int i); | ||
47 | |||
48 | // the following structures are ordered as they appear in a typical AVI | ||
49 | |||
50 | struct riff_head { | ||
51 | char riff[4]; // chunk type = "RIFF" | ||
52 | u32 size; // chunk size | ||
53 | char avistr[4]; // avi magic = "AVI " | ||
54 | }; | ||
55 | |||
56 | // the avih chunk contains a number of list chunks | ||
57 | |||
58 | struct avi_head { | ||
59 | char avih[4]; // chunk type = "avih" | ||
60 | u32 size; // chunk size | ||
61 | u32 time; // microsec per frame == 1e6 / fps | ||
62 | u32 maxbytespersec; // = 1e6*(total size/frames)/per_usec) | ||
63 | u32 pad; // pad = 0 | ||
64 | u32 flags; // e.g. AVIF_HASINDEX | ||
65 | u32 nframes; // total number of frames | ||
66 | u32 initialframes; // = 0 | ||
67 | u32 numstreams; // = 1 for now (later = 2 because of audio) | ||
68 | u32 suggested_bufsize; // = 0 (no suggestion) | ||
69 | u32 width; // width | ||
70 | u32 height; // height | ||
71 | u32 reserved[4]; // reserved for future use = 0 | ||
72 | }; | ||
73 | |||
74 | |||
75 | // the LIST chunk contains a number (==#numstreams) of stream chunks | ||
76 | |||
77 | struct list_head { | ||
78 | char list[4]; // chunk type = "LIST" | ||
79 | u32 size; | ||
80 | char type[4]; | ||
81 | }; | ||
82 | |||
83 | |||
84 | struct dmlh_head { | ||
85 | char dmlh[4]; // chunk type dmlh | ||
86 | u32 size; // 4 | ||
87 | u32 nframes; // number of frames | ||
88 | }; | ||
89 | |||
90 | |||
91 | struct stream_head { | ||
92 | char strh[4]; // chunk type = "strh" | ||
93 | u32 size; // chunk size | ||
94 | char vids[4]; // stream type = "vids" | ||
95 | char codec[4]; // codec name (for us, = "MJPG") | ||
96 | u32 flags; // contains AVIT_F* flags | ||
97 | u16 priority; // = 0 | ||
98 | u16 language; // = 0 | ||
99 | u32 initialframes; // = 0 | ||
100 | u32 scale; // = usec per frame | ||
101 | u32 rate; // 1e6 | ||
102 | u32 start; // = 0 | ||
103 | u32 length; // number of frames | ||
104 | u32 suggested_bufsize; // = 0 | ||
105 | u32 quality; // = 0 ? | ||
106 | u32 samplesize; // = 0 ? | ||
107 | }; | ||
108 | |||
109 | |||
110 | struct db_head { | ||
111 | char db[4]; // "00db" | ||
112 | u32 size; | ||
113 | }; | ||
114 | |||
115 | // a frame chunk contains one JPEG image | ||
116 | |||
117 | struct frame_head { | ||
118 | char strf[4]; // chunk type = "strf" | ||
119 | u32 size; // sizeof chunk (big endian) ? | ||
120 | u32 size2; // sizeof chunk (little endian) ? | ||
121 | u32 width; | ||
122 | u32 height; | ||
123 | u16 planes; // 1 bitplane | ||
124 | u16 bitcount; // 24 bpl | ||
125 | char codec[4]; // MJPG (for us) | ||
126 | u32 unpackedsize; // = 3*w*h | ||
127 | u32 r1; // reserved | ||
128 | u32 r2; // reserved | ||
129 | u32 clr_used; // reserved | ||
130 | u32 clr_important; // reserved | ||
131 | }; | ||
132 | |||
133 | struct idx1_head { | ||
134 | char idx1[4]; // chunk type = "idx1" | ||
135 | u32 size; // chunk size | ||
136 | }; | ||
137 | |||
138 | #ifdef __cplusplus | ||
139 | } | ||
140 | #endif | ||
141 | |||
142 | #endif | ||
diff --git a/noncore/multimedia/camera/imageio.cpp b/noncore/multimedia/camera/imageio.cpp deleted file mode 100644 index ed0d39f..0000000 --- a/noncore/multimedia/camera/imageio.cpp +++ b/dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Opie Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | **********************************************************************/ | ||
15 | |||
16 | #include "imageio.h" | ||
17 | |||
18 | #include <opie2/odebug.h> | ||
19 | #include <qimage.h> | ||
20 | |||
21 | |||
22 | void bufferToImage( int _width, int _height, unsigned char* bp, QImage* image ) | ||
23 | { | ||
24 | unsigned char* p; | ||
25 | |||
26 | image->create( _width, _height, 16 ); | ||
27 | for ( int i = 0; i < _height; ++i ) | ||
28 | { | ||
29 | p = image->scanLine( i ); | ||
30 | for ( int j = 0; j < _width; j++ ) | ||
31 | { | ||
32 | *p = *bp; | ||
33 | p++; | ||
34 | bp++; | ||
35 | *p = *bp; | ||
36 | p++; | ||
37 | bp++; | ||
38 | } | ||
39 | } | ||
40 | } | ||
41 | |||
42 | |||
43 | void imageToFile( QImage* i, const QString& name, const QString& format, int quality ) | ||
44 | { | ||
45 | QImage im = i->convertDepth( 32 ); | ||
46 | bool result = im.save( name, format, quality ); | ||
47 | if ( !result ) | ||
48 | { | ||
49 | oerr << "imageio-Problem while writing to " << name << oendl; | ||
50 | } | ||
51 | else | ||
52 | { | ||
53 | odebug << format << "-image has been successfully captured" << oendl; | ||
54 | } | ||
55 | } | ||
diff --git a/noncore/multimedia/camera/imageio.h b/noncore/multimedia/camera/imageio.h deleted file mode 100644 index 8dba2ed..0000000 --- a/noncore/multimedia/camera/imageio.h +++ b/dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2003 Michael 'Mickey' Lauer. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Opie Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | **********************************************************************/ | ||
15 | |||
16 | #ifndef IMAGEIO_H | ||
17 | #define IMAGEIO_H | ||
18 | |||
19 | #include <qstring.h> | ||
20 | |||
21 | class QImage; | ||
22 | |||
23 | void bufferToImage( int _width, int height, unsigned char* bp, QImage* image ); | ||
24 | void imageToFile( QImage* i, const QString& name, const QString& format, int quality ); | ||
25 | |||
26 | #endif | ||