blob: 29b82f520ff0d312be49c7e683f473b9c790f093 [file] [log] [blame]
Constantin Kaplinsky614c7b52007-12-26 18:17:09 +00001/* 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>
27
28using namespace rfb;
29
30//
31// XPixelBuffer is a modification of FullFramePixelBuffer that does
32// not always return buffer width in getStride().
33//
34
35class XPixelBuffer : public FullFramePixelBuffer
36{
37public:
38 XPixelBuffer(const PixelFormat& pf, int width, int height,
39 rdr::U8* data_, ColourMap* cm, int stride_) :
40 FullFramePixelBuffer(pf, width, height, data_, cm), stride(stride_)
41 {
42 }
43
44 virtual int getStride() const { return stride; }
45
Constantin Kaplinskyb3530d42007-12-26 19:17:02 +000046 // Override PixelBuffer's function.
47 virtual void grabRegion(const rfb::Region& region);
48
Constantin Kaplinsky614c7b52007-12-26 18:17:09 +000049protected:
50 int stride;
51};
52
53#endif // __XPIXELBUFFER_H__
54