Constantin Kaplinsky | 614c7b5 | 2007-12-26 18:17:09 +0000 | [diff] [blame] | 1 | /* Copyright (C) 2007 Constantin Kaplinsky. All Rights Reserved. |
| 2 | * |
| 3 | * This is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation; either version 2 of the License, or |
| 6 | * (at your option) any later version. |
| 7 | * |
| 8 | * This software is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this software; if not, write to the Free Software |
| 15 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
| 16 | * USA. |
| 17 | */ |
| 18 | |
| 19 | // |
| 20 | // XPixelBuffer.h |
| 21 | // |
| 22 | |
| 23 | #ifndef __XPIXELBUFFER_H__ |
| 24 | #define __XPIXELBUFFER_H__ |
| 25 | |
| 26 | #include <rfb/PixelBuffer.h> |
Constantin Kaplinsky | 936c369 | 2007-12-27 08:42:53 +0000 | [diff] [blame^] | 27 | #include <x0vncserver/Image.h> |
Constantin Kaplinsky | 614c7b5 | 2007-12-26 18:17:09 +0000 | [diff] [blame] | 28 | |
| 29 | using namespace rfb; |
| 30 | |
| 31 | // |
Constantin Kaplinsky | 936c369 | 2007-12-27 08:42:53 +0000 | [diff] [blame^] | 32 | // XPixelBuffer is an Image-based implementation of FullFramePixelBuffer. |
Constantin Kaplinsky | 614c7b5 | 2007-12-26 18:17:09 +0000 | [diff] [blame] | 33 | // |
| 34 | |
| 35 | class XPixelBuffer : public FullFramePixelBuffer |
| 36 | { |
| 37 | public: |
Constantin Kaplinsky | 936c369 | 2007-12-27 08:42:53 +0000 | [diff] [blame^] | 38 | XPixelBuffer(Display *dpy, Image* image, |
| 39 | int offsetLeft, int offsetTop, |
| 40 | const PixelFormat& pf, ColourMap* cm); |
| 41 | virtual ~XPixelBuffer(); |
Constantin Kaplinsky | 614c7b5 | 2007-12-26 18:17:09 +0000 | [diff] [blame] | 42 | |
Constantin Kaplinsky | 936c369 | 2007-12-27 08:42:53 +0000 | [diff] [blame^] | 43 | virtual int getStride() const { return m_stride; } |
Constantin Kaplinsky | 614c7b5 | 2007-12-26 18:17:09 +0000 | [diff] [blame] | 44 | |
Constantin Kaplinsky | b3530d4 | 2007-12-26 19:17:02 +0000 | [diff] [blame] | 45 | // Override PixelBuffer's function. |
| 46 | virtual void grabRegion(const rfb::Region& region); |
| 47 | |
Constantin Kaplinsky | 614c7b5 | 2007-12-26 18:17:09 +0000 | [diff] [blame] | 48 | protected: |
Constantin Kaplinsky | 936c369 | 2007-12-27 08:42:53 +0000 | [diff] [blame^] | 49 | Display *m_dpy; |
| 50 | Image* m_image; |
| 51 | int m_offsetLeft; |
| 52 | int m_offsetTop; |
| 53 | |
| 54 | // The number of pixels in a row, with padding included. |
| 55 | int m_stride; |
Constantin Kaplinsky | 614c7b5 | 2007-12-26 18:17:09 +0000 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | #endif // __XPIXELBUFFER_H__ |
| 59 | |