1 /* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved.
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.
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.
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,
24 #include <sys/types.h>
30 #include <X11/Xutil.h>
31 #include <X11/extensions/XShm.h>
34 #include <sys/ioctl.h>
40 std::list<Image*> images;
44 fprintf(stderr,"~ImageCleanup called\n");
46 while (!images.empty()) {
47 delete images.front();
52 ImageCleanup imageCleanup;
54 Image::Image(int width, int height)
57 data = new char[width*height*4];
59 //default image will be three lines across the screen.
61 this->height = height;
63 for (int i = 0; i < width*(height/3)*4; i++) {
68 for (int i = width*(height/3)*4 + 1; i < width*(2*height/3)*4; i++) {
69 if (((i + 3) % 4) == 0){
73 for (int i = width*(2*height/3)*4 + 1; i < width*(height)*4; i++) {
74 if (((i + 2) % 4) == 0){