Diffstat (limited to 'noncore/multimedia/camera/lib/zcameraio.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/camera/lib/zcameraio.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/noncore/multimedia/camera/lib/zcameraio.cpp b/noncore/multimedia/camera/lib/zcameraio.cpp index c940b45..d59cbbb 100644 --- a/noncore/multimedia/camera/lib/zcameraio.cpp +++ b/noncore/multimedia/camera/lib/zcameraio.cpp | |||
@@ -136,12 +136,13 @@ bool ZCameraIO::setCaptureFrame( int width, int height, int zoom, bool rot ) | |||
136 | _height = height; | 136 | _height = height; |
137 | _zoom = zoom; | 137 | _zoom = zoom; |
138 | _rot = rot; | 138 | _rot = rot; |
139 | _readlen = 2 * _width * _height; // camera is fixed @ 16 bits per pixel | 139 | _readlen = 2 * _width * _height; // camera is fixed @ 16 bits per pixel |
140 | return true; | 140 | return true; |
141 | } | 141 | } |
142 | owarn << "couldn't write to driver" << oendl; | ||
142 | return false; | 143 | return false; |
143 | } | 144 | } |
144 | 145 | ||
145 | 146 | ||
146 | bool ZCameraIO::setZoom( int zoom ) | 147 | bool ZCameraIO::setZoom( int zoom ) |
147 | { | 148 | { |
@@ -212,12 +213,14 @@ bool ZCameraIO::snapshot( QImage* image ) | |||
212 | { | 213 | { |
213 | setReadMode( STATUS ); | 214 | setReadMode( STATUS ); |
214 | 215 | ||
215 | odebug << "finder reversed = " << isFinderReversed() << oendl; | 216 | odebug << "finder reversed = " << isFinderReversed() << oendl; |
216 | odebug << "rotation = " << _rot << oendl; | 217 | odebug << "rotation = " << _rot << oendl; |
217 | 218 | ||
219 | odebug << "w=" << _width << " h= " << _height << " readlen= " << _readlen << oendl; | ||
220 | |||
218 | int readmode; | 221 | int readmode; |
219 | if ( _flip == -1 ) // AUTO | 222 | if ( _flip == -1 ) // AUTO |
220 | { | 223 | { |
221 | if ( _rot ) // Portrait | 224 | if ( _rot ) // Portrait |
222 | { | 225 | { |
223 | readmode = IMAGE | isFinderReversed() ? XFLIP | YFLIP : 0; | 226 | readmode = IMAGE | isFinderReversed() ? XFLIP | YFLIP : 0; |
@@ -288,17 +291,18 @@ bool ZCameraIO::snapshot( unsigned char* buf ) | |||
288 | 291 | ||
289 | } | 292 | } |
290 | 293 | ||
291 | 294 | ||
292 | void ZCameraIO::captureFrame( int w, int h, int zoom, QImage* image ) | 295 | void ZCameraIO::captureFrame( int w, int h, int zoom, QImage* image ) |
293 | { | 296 | { |
297 | int prot = _rot; | ||
294 | int pw = _width; | 298 | int pw = _width; |
295 | int ph = _height; | 299 | int ph = _height; |
296 | setCaptureFrame( w, h, zoom*256, _rot ); | 300 | setCaptureFrame( w, h, zoom*256, w<h ); |
297 | snapshot( image ); | 301 | snapshot( image ); |
298 | setCaptureFrame( pw, ph, _zoom, _rot ); | 302 | setCaptureFrame( pw, ph, _zoom, prot ); |
299 | } | 303 | } |
300 | 304 | ||
301 | 305 | ||
302 | void ZCameraIO::captureFrame( int w, int h, int zoom, unsigned char* buf ) | 306 | void ZCameraIO::captureFrame( int w, int h, int zoom, unsigned char* buf ) |
303 | { | 307 | { |
304 | //FIXME: this is too slow | 308 | //FIXME: this is too slow |