Ejemplo n.º 1
0
void VncClientThread::updatefb(rfbClient* cl, int x, int y, int w, int h)
{
//     kDebug(5011) << "updated client: x: " << x << ", y: " << y << ", w: " << w << ", h: " << h;
    VncClientThread *t = (VncClientThread*)rfbClientGetClientData(cl, 0);
    Q_ASSERT(t);

    const int width = cl->width, height = cl->height;
    QImage img;
    switch(t->colorDepth()) {
    case bpp8:
        img = QImage(cl->frameBuffer, width, height, QImage::Format_Indexed8);
        img.setColorTable(m_colorTable);
        break;
    case bpp16:
        img = QImage(cl->frameBuffer, width, height, QImage::Format_RGB16);
        break;
    case bpp32:
        img = QImage(cl->frameBuffer, width, height, QImage::Format_RGB32);
        break;
    }

    if (img.isNull()) {
        kDebug(5011) << "image not loaded";
    }
    
    if (t->m_stopped) {
        return; // sending data to a stopped thread is not a good idea
    }

    t->setImage(img);

    t->emitUpdated(x, y, w, h);
}
Ejemplo n.º 2
0
void VncClientThread::updatefb(rfbClient* cl, int x, int y, int w, int h)
{
//     kDebug(5011) << "updated client: x: " << x << ", y: " << y << ", w: " << w << ", h: " << h;

    const int width = cl->width, height = cl->height;

    const QImage img(cl->frameBuffer, width, height, QImage::Format_RGB32);

    if (img.isNull())
        kDebug(5011) << "image not loaded";

    VncClientThread *t = (VncClientThread*)rfbClientGetClientData(cl, 0);
    Q_ASSERT(t);

    t->setImage(img);

    t->emitUpdated(x, y, w, h);
}
Ejemplo n.º 3
0
void VncClientThread::updatefb(rfbClient* cl, int x, int y, int w, int h)
{
    //kDebug(5011) << "updated client: x: " << x << ", y: " << y << ", w: " << w << ", h: " << h;

    const QImage img(
            cl->frameBuffer,
            cl->width,
            cl->height,
            (cl->format.bitsPerPixel==16)?QImage::Format_RGB16:QImage::Format_RGB32
    );

    if (img.isNull()) {
        kDebug(5011) << "image not loaded";
    }

    VncClientThread *t = static_cast<VncClientThread*>(rfbClientGetClientData(cl, 0));
    Q_ASSERT(t);

    t->setImage(img);

    t->emitUpdated(x, y, w, h);
}