本文整理汇总了C++中OutStream::set_out_uint16_le方法的典型用法代码示例。如果您正苦于以下问题:C++ OutStream::set_out_uint16_le方法的具体用法?C++ OutStream::set_out_uint16_le怎么用?C++ OutStream::set_out_uint16_le使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutStream
的用法示例。
在下文中一共展示了OutStream::set_out_uint16_le方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: emit
//.........这里部分代码省略.........
int16_t nLeftRect = 0;
int16_t nTopRect = 0;
int16_t nWidth = 0;
int16_t nHeight = 0;
if (!common.clip.contains(Rect(nLeftRect, nTopRect, nWidth, nHeight))) {
header.control |= RDP::BOUNDS;
}
else {
for (uint8_t i = 0; i < this->nDeltaEntries; i++) {
nLeftRect += this->deltaEncodedRectangles[i].leftDelta;
nTopRect += this->deltaEncodedRectangles[i].topDelta;
nWidth = this->deltaEncodedRectangles[i].width;
nHeight = this->deltaEncodedRectangles[i].height;
if (!common.clip.contains(Rect(nLeftRect, nTopRect, nWidth, nHeight))) {
header.control |= RDP::BOUNDS;
break;
}
}
}
header.control |= (is_1_byte(this->nLeftRect - oldcmd.nLeftRect) && is_1_byte(this->nTopRect - oldcmd.nTopRect) &&
is_1_byte(this->nWidth - oldcmd.nWidth) && is_1_byte(this->nHeight - oldcmd.nHeight)) * RDP::DELTA;
header.fields =
(this->nLeftRect != oldcmd.nLeftRect ) * 0x0001
| (this->nTopRect != oldcmd.nTopRect ) * 0x0002
| (this->nWidth != oldcmd.nWidth ) * 0x0004
| (this->nHeight != oldcmd.nHeight ) * 0x0008
| (this->bRop != oldcmd.bRop ) * 0x0010
| (this->nDeltaEntries != oldcmd.nDeltaEntries) * 0x0020
| (
(this->nDeltaEntries != oldcmd.nDeltaEntries) ||
memcmp(this->deltaEncodedRectangles, oldcmd.deltaEncodedRectangles,
this->nDeltaEntries * sizeof(RDP::DeltaEncodedRectangle))
) * 0x0040
;
common.emit(stream, header, oldcommon);
header.emit_coord(stream, 0x0001, this->nLeftRect, oldcmd.nLeftRect);
header.emit_coord(stream, 0x0002, this->nTopRect, oldcmd.nTopRect);
header.emit_coord(stream, 0x0004, this->nWidth, oldcmd.nWidth);
header.emit_coord(stream, 0x0008, this->nHeight, oldcmd.nHeight);
if (header.fields & 0x0010) { stream.out_uint8(this->bRop); }
if (header.fields & 0x0020) { stream.out_uint8(this->nDeltaEntries); }
if (header.fields & 0x0040) {
uint32_t offset_cbData = stream.get_offset();
stream.out_clear_bytes(2);
uint8_t * zeroBit = stream.get_current();
stream.out_clear_bytes((this->nDeltaEntries + 1) / 2);
*zeroBit = 0;
for (uint8_t i = 0, m2 = 0; i < this->nDeltaEntries; i++, m2++) {
if (m2 == 2) {
m2 = 0;
}
if (i && !m2) {
*(++zeroBit) = 0;
}
if (!this->deltaEncodedRectangles[i].leftDelta) {
*zeroBit |= (1 << (7 - m2 * 4));
}
else {
stream.out_DEP(this->deltaEncodedRectangles[i].leftDelta);
}
if (!this->deltaEncodedRectangles[i].topDelta) {
*zeroBit |= (1 << (6 - m2 * 4));
}
else {
stream.out_DEP(this->deltaEncodedRectangles[i].topDelta);
}
if (!this->deltaEncodedRectangles[i].width) {
*zeroBit |= (1 << (5 - m2 * 4));
}
else {
stream.out_DEP(this->deltaEncodedRectangles[i].width);
}
if (!this->deltaEncodedRectangles[i].height) {
*zeroBit |= (1 << (4 - m2 * 4));
}
else {
stream.out_DEP(this->deltaEncodedRectangles[i].height);
}
}
stream.set_out_uint16_le(stream.get_offset() - offset_cbData - 2, offset_cbData);
}
} // void emit(OutStream & stream, RDPOrderCommon & common, const RDPOrderCommon & oldcommon, const RDPMultiDstBlt & oldcmd) const