Main Page   Class Hierarchy   Compound List   File List   Compound Members  

qvideostream.h

00001 
00002 // -*- c++ -*-
00003 
00004 /*
00005  *
00006  * Copyright (C) 2002 George Staikos <staikos@kde.org>
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Library General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2 of the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Library General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Library General Public License
00019  * along with this library; see the file COPYING.LIB.  If not, write to
00020  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021  * Boston, MA 02111-1307, USA.
00022  */
00023 
00024 
00025 
00026 #ifndef _QVIDEOSTREAM_H
00027 #define _QVIDEOSTREAM_H
00028 
00029 
00030 #include <qwidget.h>
00031 
00032 class QVideoStreamPrivate;
00033 
00034 #define QVIDEO_METHOD_NONE      0
00035 #define QVIDEO_METHOD_XSHM      1
00036 #define QVIDEO_METHOD_XV        2
00037 #define QVIDEO_METHOD_XVSHM     4
00038 #define QVIDEO_METHOD_X11       8
00039 #define QVIDEO_METHOD_DGA       16 /* unimplemented */
00040 #define QVIDEO_METHOD_GL        32 /* unimplemented */
00041 #define QVIDEO_METHOD_SDL       64 /* unimplemented */
00042 
00043 
00044 #define QVIDEO_FORMAT_NONE      0
00045 #define QVIDEO_FORMAT_YUV2      1
00046 #define QVIDEO_FORMAT_YV12      2
00047 #define QVIDEO_FORMAT_I420      3
00048 #define QVIDEO_FORMAT_UYVY      4
00049 #define QVIDEO_FORMAT_GREY      5
00050 #define QVIDEO_FORMAT_HI240     6
00051 #define QVIDEO_FORMAT_RGB565    7
00052 #define QVIDEO_FORMAT_RGB24     8
00053 #define QVIDEO_FORMAT_RGB32     9
00054 #define QVIDEO_FORMAT_RGB555    10
00055 #define QVIDEO_FORMAT_YUYV      11
00056 
00057 
00063 class QVideoStream : public QObject
00064 {
00065         Q_OBJECT
00066 
00067 public:
00068         QVideoStream(QWidget *widget, const char* name = 0);
00069         ~QVideoStream();
00070 
00071         bool scaling() const;
00072         void setScaling(bool scale);
00073 
00074         /* output method */
00075         bool haveMethod(int method) const;
00076         int  method() const;
00077         int  setMethod(int method);
00078 
00079         /* max output sizes */
00080         QSize maxSize() const;
00081         int   maxWidth() const;
00082         int   maxHeight() const;
00083 
00084         /* output sizes */
00085         QSize size() const;
00086         int   width() const;
00087         int   height() const;
00088 
00089         QSize setSize(const QSize& sz);
00090         int   setWidth(int width);
00091         int   setHeight(int height);
00092 
00093         /* input sizes */
00094         QSize inputSize() const;
00095         int   inputWidth() const;
00096         int   inputHeight() const;
00097 
00098         QSize setInputSize(const QSize& sz);
00099         int setInputWidth(int width);
00100         int setInputHeight(int height);
00101         
00102         /* input formats */
00103         int format() const;
00104         int setFormat(int format);
00105 
00106         QVideoStream& operator<<(const unsigned char *const img);
00107 
00108 public slots:
00109         int displayFrame(const unsigned char *const img);
00110 
00111 private:
00112         QVideoStreamPrivate *d;
00113         QWidget *_w;
00114         bool _scale;
00115         int _methods; // list of methods
00116         int _method;  // the current method
00117         QSize _size;
00118         QSize _inputSize;
00119         bool _init;
00120 
00121         void deInit();
00122         void init();
00123 };
00124 
00125 #endif
00126 

Generated at Thu Jan 30 02:56:02 2003 for QtVision by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001