author | mickeyl <mickeyl> | 2003-04-12 15:02:32 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-12 15:02:32 (UTC) |
commit | 2cc909c36a779d1041a3382939f8ad41d84b0fc5 (patch) (unidiff) | |
tree | 42c95673d72f7ecb7a8f4acbb0f517dd75ecc167 /noncore/multimedia/camera/zcameraio.cpp | |
parent | 11861d35730cee70920aa6797ba12263bbcce081 (diff) | |
download | opie-2cc909c36a779d1041a3382939f8ad41d84b0fc5.zip opie-2cc909c36a779d1041a3382939f8ad41d84b0fc5.tar.gz opie-2cc909c36a779d1041a3382939f8ad41d84b0fc5.tar.bz2 |
- make main layout a full preview window and think about configuring capturing parameters later...adding an on-demand-applet to the taskbar would be spiffy
- portrait or landscape mode is now self-configuring thanks to life-rotation :-D
Diffstat (limited to 'noncore/multimedia/camera/zcameraio.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/camera/zcameraio.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/noncore/multimedia/camera/zcameraio.cpp b/noncore/multimedia/camera/zcameraio.cpp index 56b2e13..51771a5 100644 --- a/noncore/multimedia/camera/zcameraio.cpp +++ b/noncore/multimedia/camera/zcameraio.cpp | |||
@@ -108,6 +108,7 @@ inline bool ZCameraIO::isAvailable() const | |||
108 | 108 | ||
109 | bool ZCameraIO::setCaptureFrame( int width, int height, int zoom, bool rot ) | 109 | bool ZCameraIO::setCaptureFrame( int width, int height, int zoom, bool rot ) |
110 | { | 110 | { |
111 | odebug << "setCaptureFrame( " << width << ", " << height << ", " << zoom << ", " << rot << " )" << oendl; | ||
111 | char b[100]; | 112 | char b[100]; |
112 | sprintf( b, "%c=%d,%d,%d,%d", rot ? 'R':'S', width, height, zoom, width*2 ); | 113 | sprintf( b, "%c=%d,%d,%d,%d", rot ? 'R':'S', width, height, zoom, width*2 ); |
113 | if ( write( b ) ) | 114 | if ( write( b ) ) |
@@ -173,18 +174,31 @@ bool ZCameraIO::write( char* buf, int len ) | |||
173 | 174 | ||
174 | bool ZCameraIO::snapshot( QImage* image ) | 175 | bool ZCameraIO::snapshot( QImage* image ) |
175 | { | 176 | { |
176 | setReadMode( IMAGE | XFLIP | YFLIP ); | 177 | setReadMode( STATUS ); |
177 | char buf[76800]; | 178 | |
179 | odebug << "finder reversed = " << isFinderReversed() << oendl; | ||
180 | odebug << "rotation = " << _rot << oendl; | ||
181 | |||
182 | if ( _rot ) // Portrait | ||
183 | { | ||
184 | setReadMode( IMAGE | isFinderReversed() ? XFLIP | YFLIP : 0 ); | ||
185 | } | ||
186 | else // Landscape | ||
187 | { | ||
188 | setReadMode( IMAGE | XFLIP | YFLIP ); //isFinderReversed() ? 0 : XFLIP ); | ||
189 | } | ||
190 | |||
191 | char buf[_readlen]; | ||
178 | char* bp = buf; | 192 | char* bp = buf; |
179 | unsigned char* p; | 193 | unsigned char* p; |
180 | 194 | ||
181 | read( bp, _readlen ); | 195 | read( bp, _readlen ); |
182 | 196 | ||
183 | image->create( 240, 160, 16 ); | 197 | image->create( _width, _height, 16 ); |
184 | for ( int i = 0; i < 160; ++i ) | 198 | for ( int i = 0; i < _height; ++i ) |
185 | { | 199 | { |
186 | p = image->scanLine( i ); | 200 | p = image->scanLine( i ); |
187 | for ( int j = 0; j < 240; j++ ) | 201 | for ( int j = 0; j < _width; j++ ) |
188 | { | 202 | { |
189 | *p = *bp; | 203 | *p = *bp; |
190 | p++; | 204 | p++; |