QFrameBuffer.hpp

00001 /*********************************************************************** 00002 * * 00003 * ViTooKi * 00004 * * 00005 * title: QFrameBuffer.hpp * 00006 * * 00007 * * 00008 * * 00009 * ITEC institute of the University of Klagenfurt (Austria) * 00010 * http://www.itec.uni-klu.ac.at * 00011 * * 00012 * * 00013 * For more information visit the ViTooKi homepage: * 00014 * http://ViTooKi.sourceforge.net * 00015 * vitooki-user@lists.sourceforge.net * 00016 * vitooki-devel@lists.sourceforge.net * 00017 * * 00018 * This file is part of ViTooKi, a free video toolkit. * 00019 * ViTooKi is free software; you can redistribute it and/or * 00020 * modify it under the terms of the GNU General Public License * 00021 * as published by the Free Software Foundation; either version 2 * 00022 * of the License, or (at your option) any later version. * 00023 * * 00024 * This program is distributed in the hope that it will be useful, * 00025 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00027 * GNU General Public License for more details. * 00028 * * 00029 * You should have received a copy of the GNU General Public License * 00030 * along with this program; if not, write to the Free Software * 00031 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 00032 * MA 02111-1307, USA. * 00033 * * 00034 ***********************************************************************/ 00035 00036 /*********************************************************************** 00037 * * 00038 * REVISION HISTORY: * 00039 * * 00040 * $Id: QFrameBuffer.hpp,v 1.5 2005/02/22 18:26:11 mkropfbe Exp $ 00041 * * 00042 ***********************************************************************/ 00043 00044 #ifndef _QFRAMEBUFFER_HPP 00045 #define _QFRAMEBUFFER_HPP 00046 00047 #include "IO.hpp" 00048 #include "VideoESInfo.hpp" 00049 #include "adaptors/MP4Decoder.hpp" 00050 #include <qevent.h> 00051 #include <qimage.h> 00052 #include <qwidget.h> 00053 #include "VideoFrameBuffer.hpp" 00054 00055 class QLabel; 00056 class QCustomEvent; 00057 00075 class QFrameBuffer : public QWidget, public VideoFrameBuffer { 00076 Q_OBJECT 00077 00078 public: 00096 QFrameBuffer(QLabel *qlabel, int depth, int numColors = 0, bool gray = true, 00097 QEvent::Type eventType = QEvent::User); 00098 00100 virtual ~QFrameBuffer(); 00101 00108 inline void setPixel(int x, int y, uint index_or_rgb) { 00109 image->setPixel(x, y, index_or_rgb); 00110 } 00111 00118 void postPaintEvent(); 00119 00120 protected: 00124 virtual void customEvent(QCustomEvent *event); 00125 00126 private: 00128 QLabel *qlabel; 00129 00131 QImage *image; 00132 00134 QEvent::Type eventType; 00135 00136 }; 00137 00138 #endif /* _QFRAMEBUFFER_HPP */