本文整理汇总了C++中OutStream类的典型用法代码示例。如果您正苦于以下问题:C++ OutStream类的具体用法?C++ OutStream怎么用?C++ OutStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OutStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: emit
void emit(OutStream & stream) const
{
stream.out_uint16_le(this->userDataType);
stream.out_uint16_le(this->length);
stream.out_uint32_le(this->encryptionMethods);
stream.out_uint32_le(this->extEncryptionMethods);
}
示例2: Save
//----------------------------------------------------------------------------
void RawTerrain::Save (OutStream& target) const
{
PX2_BEGIN_DEBUG_STREAM_SAVE(target);
Node::Save(target);
target.WriteEnum(mMode);
target.Write(mNumRows);
target.Write(mNumCols);
target.Write(mSize);
target.Write(mMinElevation);
target.Write(mMaxElevation);
target.Write(mSpacing);
target.Write(mCameraRow);
target.Write(mCameraCol);
target.WritePointer(mVFormat);
target.WritePointer(mCamera);
target.WritePointer(mShine);
for (int row = 0; row < mNumRows; ++row)
{
for (int col = 0; col < mNumCols; ++col)
{
target.WritePointer(mPages[row][col]);
}
}
PX2_END_DEBUG_STREAM_SAVE(RawTerrain, target);
}
示例3: emit
void emit(OutStream & stream) const
{
stream.out_uint16_le(this->capabilityType);
stream.out_uint16_le(this->len);
stream.out_uint32_le(this->cmdFlags);
stream.out_uint32_le(this->reserved);
}
示例4: compress
// TODO simplify and enhance compression using 1 pixel orders BLACK or WHITE.
void Bitmap::compress(BitsPerPixel session_color_depth, OutStream & outbuffer) const
{
if (this->data_bitmap->compressed_size()) {
outbuffer.out_copy_bytes(this->data_bitmap->compressed_data(), this->data_bitmap->compressed_size());
return;
}
uint8_t * tmp_data_compressed = outbuffer.get_current();
ConstImageDataView const image_view{
this->data(),
this->cx(),
this->cy(),
this->line_size(),
this->bpp(),
ConstImageDataView::Storage::BottomToTop
};
if ((session_color_depth == BitsPerPixel{32}) && ((this->bpp() == BitsPerPixel{24}) || (this->bpp() == BitsPerPixel{32}))) {
rle_compress60(image_view, outbuffer);
}
else {
rle_compress(image_view, outbuffer);
}
// Memoize result of compression
this->data_bitmap->copy_compressed_buffer(
tmp_data_compressed, outbuffer.get_current() - tmp_data_compressed);
}
示例5: emit
void emit(OutStream & stream) override {
stream.out_uint16_le(this->capabilityType);
stream.out_uint16_le(this->len);
stream.out_uint32_le(this->drawNineGridSupportLevel);
stream.out_uint16_le(this->drawNineGridCacheSize);
stream.out_uint16_le(this->drawNineGridCacheEntries);
}
示例6: Copy
//----------------------------------------------------------------------------
Object* Object::Copy(const std::string& uniqueNameAppend)
{
// Save the object to a memory buffer.
OutStream saveStream;
saveStream.Insert((Object*)this);
int bufferSize = 0;
char* buffer = 0;
saveStream.Save(bufferSize, buffer, BufferIO::BM_DEFAULT_WRITE);
// Load the object from the memory buffer.
InStream loadStream;
loadStream.Load(bufferSize, buffer, BufferIO::BM_DEFAULT_READ);
delete1(buffer);
if (uniqueNameAppend != "")
{
int numObjects = loadStream.GetNumObjects();
for (int i = 0; i < numObjects; i++)
{
PX2::Object *obj = loadStream.GetObjectAt(i);
std::string name = obj->GetName();
if (name.length() > 0)
{
name += uniqueNameAppend;
obj->SetName(name);
}
}
}
return loadStream.GetObjectAt(0);
}
示例7: Register
//----------------------------------------------------------------------------
bool RawTerrainPage::Register (OutStream& target) const
{
if (TerrainPage::Register(target))
{
if (mMtlInst)
target.Register(mMtlInst);
if (mTextureAlpha)
target.Register(mTextureAlpha);
if (mUV01Float)
{
target.Register(mUV01Float);
}
if (mUV23Float)
{
target.Register(mUV23Float);
}
if (mUV4Float)
{
target.Register(mUV4Float);
}
return true;
}
return false;
}
示例8: emit
void emit(OutStream & stream) const
{
stream.out_uint16_le(this->capabilityType);
stream.out_uint16_le(this->len);
stream.out_uint16_le(this->colorTableCacheSize);
stream.out_uint16_le(this->pad2octets);
}
示例9: emit
void emit(OutStream & stream) const
{
stream.out_uint16_le(this->capabilityType);
stream.out_uint16_le(this->len);
stream.out_uint16_le(this->flags);
stream.out_uint16_le(this->VCChunkSize);
}
示例10: TEST
TEST(OutStream, SetLessonInterface)
{
OutStream out;
out.claim();
EXPECT_EQ(&out.claim(), &out) << "Fluid interface error.";
EXPECT_TRUE(out.claimed()) << "OutStream incorrectly marked as unclaimed.";
}
示例11: Save
//----------------------------------------------------------------------------
void RawTerrainPage::Save (OutStream& target) const
{
PX2_BEGIN_DEBUG_STREAM_SAVE(target);
TerrainPage::Save(target);
PX2_VERSION_SAVE(target);
target.WritePointer(mMtlInst);
target.WriteString(mTextureDefaultFilename);
target.WriteString(mTexture0Filename);
target.WritePointer(mTextureAlpha);
target.WriteString(mTexture1Filename);
target.WriteString(mTexture2Filename);
target.WriteString(mTexture3Filename);
target.WriteString(mTexture4Filename);
target.WriteAggregate(mUV01);
target.WriteAggregate(mUV23);
target.WriteAggregate(mUV4);
target.WritePointer(mUV01Float);
target.WritePointer(mUV23Float);
target.WritePointer(mUV4Float);
PX2_END_DEBUG_STREAM_SAVE(RawTerrainPage, target);
}
示例12: send_timestamp_chunk
void send_timestamp_chunk(bool ignore_time_interval = false)
{
StaticOutStream<12 + GTF_SIZE_KEYBUF_REC * sizeof(uint32_t) + 1> payload;
payload.out_timeval_to_uint64le_usec(this->timer);
if (this->send_input) {
payload.out_uint16_le(this->mouse_x);
payload.out_uint16_le(this->mouse_y);
payload.out_uint8(ignore_time_interval ? 1 : 0);
/*
for (uint32_t i = 0, c = keyboard_buffer_32.size() / sizeof(uint32_t);
i < c; i++) {
LOG(LOG_INFO, "send_timestamp_chunk: '%c'(0x%X)",
(keyboard_buffer_32.data[i]<128)?(char)keyboard_buffer_32.data[i]:'?',
keyboard_buffer_32.data[i]);
}
*/
payload.out_copy_bytes(keyboard_buffer_32.get_data(), keyboard_buffer_32.get_offset());
keyboard_buffer_32 = OutStream(keyboard_buffer_32_buf);
}
send_wrm_chunk(this->trans, TIMESTAMP, payload.get_offset(), 1);
this->trans.send(payload.get_data(), payload.get_offset());
this->last_sent_timer = this->timer;
}
示例13: emit
void emit(OutStream & stream)override {
stream.out_uint16_le(this->capabilityType);
stream.out_uint16_le(this->len);
stream.out_uint16_le(this->fontSupportFlags);
stream.out_uint16_le(this->pad2octets);
}
示例14: emit
void emit(OutStream & stream) const
{
stream.out_uint16_le(this->capabilityType);
stream.out_uint16_le(this->len);
stream.out_uint32_le(this->WndSupportLevel);
stream.out_uint8(this->NumIconCaches);
stream.out_uint16_le(this->NumIconCacheEntries);
}
示例15: emit
void emit(OutStream & stream) const
{
stream.out_uint16_le(this->capabilityType);
stream.out_uint16_le(this->len);
stream.out_uint16_le(this->nodeId);
stream.out_uint16_le(this->pad2octets);
}