static rfb::LogWriter vlog("Image");
Image::Image(Display *d)
- : xim(NULL), dpy(d), trueColor(true)
+ : xim(NULL), dpy(d)
{
imageCleanup.images.push_back(this);
}
Image::Image(Display *d, int width, int height)
- : xim(NULL), dpy(d), trueColor(true)
+ : xim(NULL), dpy(d)
{
imageCleanup.images.push_back(this);
Init(width, height);
void Image::Init(int width, int height)
{
Visual* vis = DefaultVisual(dpy, DefaultScreen(dpy));
- trueColor = (vis->c_class == TrueColor);
+
+ if (vis->c_class != TrueColor) {
+ vlog.error("pseudocolour not supported");
+ exit(1);
+ }
xim = XCreateImage(dpy, vis, DefaultDepth(dpy, DefaultScreen(dpy)),
ZPixmap, 0, 0, width, height, BitmapPad(dpy), 0);
depth = vinfo->depth;
}
- trueColor = (visual->c_class == TrueColor);
+ if (visual->c_class != TrueColor) {
+ vlog.error("pseudocolour not supported");
+ exit(1);
+ }
shminfo = new XShmSegmentInfo;
format = PixelFormat(m_image->xim->bits_per_pixel,
m_image->xim->depth,
(m_image->xim->byte_order == MSBFirst),
- m_image->isTrueColor(),
+ true,
m_image->xim->red_mask >> (ffs(m_image->xim->red_mask) - 1),
m_image->xim->green_mask >> (ffs(m_image->xim->green_mask) - 1),
m_image->xim->blue_mask >> (ffs(m_image->xim->blue_mask) - 1),