summaryrefslogtreecommitdiff
path: root/noncore/multimedia/camera/zcameraio.h
Unidiff
Diffstat (limited to 'noncore/multimedia/camera/zcameraio.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/camera/zcameraio.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/noncore/multimedia/camera/zcameraio.h b/noncore/multimedia/camera/zcameraio.h
index edce143..3352a5e 100644
--- a/noncore/multimedia/camera/zcameraio.h
+++ b/noncore/multimedia/camera/zcameraio.h
@@ -30,33 +30,36 @@ class ZCameraIO : public QObject
30 30
31 enum ReadMode 31 enum ReadMode
32 { 32 {
33 IMAGE = 0, STATUS = 1, 33 IMAGE = 0, STATUS = 1,
34 FASTER = 0, BETTER = 2, 34 FASTER = 0, BETTER = 2,
35 XNOFLIP = 0, XFLIP = 4, 35 XNOFLIP = 0, XFLIP = 4,
36 YNOFLIP = 0, YFLIP = 8 36 YNOFLIP = 0, YFLIP = 8,
37 AUTOMATICFLIP = -1
37 }; 38 };
38 39
39 // low level interface 40 // low level interface
40 41
41 bool setCaptureFrame( int w, int h, int zoom = 256, bool rot = true ); 42 bool setCaptureFrame( int w, int h, int zoom = 256, bool rot = true );
42 bool setZoom( int zoom = 0 ); 43 bool setZoom( int zoom = 0 );
43 void setReadMode( int = IMAGE | XFLIP | YFLIP ); 44 void setReadMode( int = IMAGE | XFLIP | YFLIP );
45 void setFlip( int flip );
44 46
45 bool isShutterPressed(); // not const, because it calls clearShutterLatch 47 bool isShutterPressed(); // not const, because it calls clearShutterLatch
46 bool isAvailable() const; 48 bool isAvailable() const;
47 bool isCapturing() const; 49 bool isCapturing() const;
48 bool isFinderReversed() const; 50 bool isFinderReversed() const;
49 51
50 bool snapshot( unsigned char* ); 52 bool snapshot( QImage* image );
51 bool snapshot( QImage* ); 53 bool snapshot( unsigned char* buf );
52 54
53 // high level interface 55 // high level interface
54 bool isOpen() const; 56 bool isOpen() const;
55 static ZCameraIO* instance(); 57 static ZCameraIO* instance();
56 void captureFrame( int w, int h, int zoom, QImage* image ); 58 void captureFrame( int w, int h, int zoom, QImage* image );
59 void captureFrame( int w, int h, int zoom, unsigned char* buf );
57 60
58 protected: 61 protected:
59 ZCameraIO(); 62 ZCameraIO();
60 void clearShutterLatch(); 63 void clearShutterLatch();
61 void init(); 64 void init();
62 bool read( char*, int ); 65 bool read( char*, int );
@@ -65,16 +68,18 @@ class ZCameraIO : public QObject
65 signals: 68 signals:
66 void shutterClicked(); 69 void shutterClicked();
67 70
68 private: 71 private:
69 int _driver; 72 int _driver;
70 char _status[4]; 73 char _status[4];
74 bool _pressed;
71 static ZCameraIO* _instance; 75 static ZCameraIO* _instance;
72 int _height; 76 int _height;
73 int _width; 77 int _width;
74 int _zoom; 78 int _zoom;
79 int _flip;
75 bool _rot; 80 bool _rot;
76 int _readlen; 81 int _readlen;
77 82
78 QTime* _timer; 83 QTime* _timer;
79}; 84};
80 85