void receive(Stream & stream, const RDPPrimaryOrderHeader & header) {
        // LOG(LOG_INFO, "RDPMultiDstBlt::receive: header fields=0x%02X", header.fields);

        header.receive_coord(stream, 0x0001, this->nLeftRect);
        header.receive_coord(stream, 0x0002, this->nTopRect);
        header.receive_coord(stream, 0x0004, this->nWidth);
        header.receive_coord(stream, 0x0008, this->nHeight);

        if (header.fields & 0x0010) {
            this->bRop = stream.in_uint8();
        }

        if (header.fields & 0x0020) {
            this->nDeltaEntries = stream.in_uint8();
        }

        if (header.fields & 0x0040) {
            uint16_t cbData = stream.in_uint16_le();
            // LOG(LOG_INFO, "cbData=%d", cbData);

            SubStream rgbData(stream, stream.get_offset(), cbData);
            stream.in_skip_bytes(cbData);
            // hexdump_d(rgbData.p, rgbData.size());

            uint8_t zeroBitsSize = ((this->nDeltaEntries + 1) / 2);
            // LOG(LOG_INFO, "zeroBitsSize=%d", zeroBitsSize);

            SubStream zeroBits(rgbData, rgbData.get_offset(), zeroBitsSize);
            rgbData.in_skip_bytes(zeroBitsSize);

            uint8_t zeroBit = 0;

            for (uint8_t i = 0, m2 = 0; i < this->nDeltaEntries; i++, m2++) {
                if (m2 == 2) {
                    m2 = 0;
                }

                if (!m2) {
                    zeroBit = zeroBits.in_uint8();
                    // LOG(LOG_INFO, "0x%02X", zeroBit);
                }

                this->deltaEncodedRectangles[i].leftDelta = (!(zeroBit & 0x80) ? rgbData.in_DEP() : 0);
                this->deltaEncodedRectangles[i].topDelta  = (!(zeroBit & 0x40) ? rgbData.in_DEP() : 0);
                this->deltaEncodedRectangles[i].width     = (!(zeroBit & 0x20) ? rgbData.in_DEP() : 0);
                this->deltaEncodedRectangles[i].height    = (!(zeroBit & 0x10) ? rgbData.in_DEP() : 0);

/*
                LOG(LOG_INFO, "RDPMultiDstBlt::receive: delta rectangle=(%d, %d, %d, %d)",
                    this->deltaEncodedRectangles[i].leftDelta, this->deltaEncodedRectangles[i].topDelta,
                    this->deltaEncodedRectangles[i].width, this->deltaEncodedRectangles[i].height);
*/

                zeroBit <<= 4;
            }
        }
    }   // void receive(Stream & stream, const RDPPrimaryOrderHeader & header)
    void receive(InStream & stream, const RDPPrimaryOrderHeader & header) {
        // LOG(LOG_INFO, "RDPEllipseSC::receive: header fields=0x%02X", header.fields);
        int16_t leftRect   = this->el.left();
        int16_t topRect    = this->el.top();
        int16_t rightRect  = this->el.right();
        int16_t bottomRect = this->el.bottom();
        header.receive_coord(stream, 0x0001, leftRect);
        header.receive_coord(stream, 0x0002, topRect);
        header.receive_coord(stream, 0x0004, rightRect);
        header.receive_coord(stream, 0x0008, bottomRect);

        this->el = Ellipse(leftRect, topRect, rightRect, bottomRect);

        if (header.fields & 0x0010) {
            this->bRop2  = stream.in_uint8();
        }
        if (header.fields & 0x0020) {
            this->fillMode  = stream.in_uint8();
        }
        if (header.fields & 0x0040) {
            receive_rdp_color(stream, this->color);
        }
    }
    void receive(InStream & stream, const RDPPrimaryOrderHeader & header)
    {
        using namespace RDP;

        if (header.fields & 0x001) {
            this->back_mode = stream.in_uint16_le();
        }

        header.receive_coord(stream, 0x002, this->startx);
        header.receive_coord(stream, 0x004, this->starty);
        header.receive_coord(stream, 0x008, this->endx);
        header.receive_coord(stream, 0x010, this->endy);

        if (header.fields & 0x020) {
            receive_rdp_color(stream, this->back_color);
        }

        if (header.fields & 0x040) {
            this->rop2 = stream.in_uint8();
        }

        header.receive_pen(stream, 0x080, this->pen);
    }
    void receive(InStream & stream, const RDPPrimaryOrderHeader & header) {
        // LOG(LOG_INFO, "RDPPolygonSC::receive: header fields=0x%02X", header.fields);

        header.receive_coord(stream, 0x0001, this->xStart);
        header.receive_coord(stream, 0x0002, this->yStart);
        if (header.fields & 0x0004) {
            this->bRop2  = stream.in_uint8();
        }
        if (header.fields & 0x0008) {
            this->fillMode = stream.in_uint8();
        }

        if (header.fields & 0x0010) {
            receive_rdp_color(stream, this->backColor);
        }

        if (header.fields & 0x0020) {
            receive_rdp_color(stream, this->foreColor);
        }

        header.receive_brush(stream, 0x0040, this->brush);

        if (header.fields & 0x0800) {
            this->NumDeltaEntries = stream.in_uint8();
        }

        if (header.fields & 0x1000) {
            uint8_t cbData = stream.in_uint8();
            // LOG(LOG_INFO, "cbData=%d", cbData);

            InStream rgbData(stream.get_current(), cbData);
            stream.in_skip_bytes(cbData);
            // hexdump_d(rgbData.get_current(), rgbData.get_capacity());

            uint8_t zeroBitsSize = ((this->NumDeltaEntries + 3) / 4);
            // LOG(LOG_INFO, "zeroBitsSize=%d", zeroBitsSize);

            InStream zeroBits(rgbData.get_current(), zeroBitsSize);
            rgbData.in_skip_bytes(zeroBitsSize);

            uint8_t zeroBit = 0;

            for (uint8_t i = 0, m4 = 0; i < this->NumDeltaEntries; i++, m4++) {
                if (m4 == 4) {
                    m4 = 0;
                }

                if (!m4) {
                    zeroBit = zeroBits.in_uint8();
                    // LOG(LOG_INFO, "0x%02X", zeroBit);
                }

                this->deltaPoints[i].xDelta = (!(zeroBit & 0x80) ? rgbData.in_DEP() : 0);
                this->deltaPoints[i].yDelta = (!(zeroBit & 0x40) ? rgbData.in_DEP() : 0);

/*
                LOG(LOG_INFO, "RDPPolygonCB::receive: delta point=%d, %d",
                    this->deltaPoints[i].xDelta, this->deltaPoints[i].yDelta);
*/

                zeroBit <<= 2;
            }
        }
    }   // receive