本文整理汇总了C++中CGolombBuffer::BitByteAlign方法的典型用法代码示例。如果您正苦于以下问题:C++ CGolombBuffer::BitByteAlign方法的具体用法?C++ CGolombBuffer::BitByteAlign怎么用?C++ CGolombBuffer::BitByteAlign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGolombBuffer
的用法示例。
在下文中一共展示了CGolombBuffer::BitByteAlign方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void CompositionObject::Dvb4PixelsCodeString(SubPicDesc& spd, CGolombBuffer& gb, short& nX, short& nY)
{
bool bQuit = false;
while (!bQuit && !gb.IsEOF()) {
short nCount = 0;
BYTE nPaletteIndex = 0;
BYTE bTemp = (BYTE)gb.BitRead(4);
if (bTemp != 0) {
nPaletteIndex = bTemp;
nCount = 1;
} else {
if (gb.BitRead(1) == 0) { // switch_1
nCount = (short)gb.BitRead(3); // run_length_3-9
if (nCount != 0) {
nCount += 2;
} else {
bQuit = true;
}
} else {
if (gb.BitRead(1) == 0) { // switch_2
nCount = 4 + (short)gb.BitRead(2); // run_length_4-7
nPaletteIndex = (BYTE)gb.BitRead(4); // 4-bit_pixel-code
} else {
switch (gb.BitRead(2)) { // switch_3
case 0:
nCount = 1;
break;
case 1:
nCount = 2;
break;
case 2: // if (switch_3 == '10')
nCount = 9 + (short)gb.BitRead(4); // run_length_9-24
nPaletteIndex = (BYTE)gb.BitRead(4); // 4-bit_pixel-code
break;
case 3:
nCount = 25 + gb.ReadByte(); // run_length_25-280
nPaletteIndex = (BYTE)gb.BitRead(4); // 4-bit_pixel-code
break;
}
}
}
}
#if 0
if (nX + nCount > m_width) {
ASSERT(FALSE);
break;
}
#endif
if (nCount > 0) {
FillSolidRect(spd, nX, nY, nCount, 1, m_Colors[nPaletteIndex]);
nX += nCount;
}
}
gb.BitByteAlign();
}
示例2: while
void CompositionObject::Dvb2PixelsCodeString(SubPicDesc& spd, CGolombBuffer& gb, short& nX, short& nY)
{
BYTE bTemp;
BYTE nPaletteIndex = 0;
short nCount;
bool bQuit = false;
while (!bQuit && !gb.IsEOF()) {
nCount = 0;
nPaletteIndex = 0;
bTemp = (BYTE)gb.BitRead(2);
if (bTemp != 0) {
nPaletteIndex = bTemp;
nCount = 1;
} else {
if (gb.BitRead(1) == 1) { // switch_1
nCount = 3 + (short)gb.BitRead(3); // run_length_3-9
nPaletteIndex = (BYTE)gb.BitRead(2);
} else {
if (gb.BitRead(1) == 0) { // switch_2
switch (gb.BitRead(2)) { // switch_3
case 0:
bQuit = true;
break;
case 1:
nCount = 2;
break;
case 2: // if (switch_3 == '10')
nCount = 12 + (short)gb.BitRead(4); // run_length_12-27
nPaletteIndex = (BYTE)gb.BitRead(2); // 4-bit_pixel-code
break;
case 3:
nCount = 29 + gb.ReadByte(); // run_length_29-284
nPaletteIndex = (BYTE)gb.BitRead(2); // 4-bit_pixel-code
break;
}
} else {
nCount = 1;
}
}
}
if (nX + nCount > m_width) {
ASSERT(FALSE);
break;
}
if (nCount > 0) {
FillSolidRect(spd, nX, nY, nCount, 1, m_Colors[nPaletteIndex]);
nX += nCount;
}
}
gb.BitByteAlign();
}
示例3: while
void CompositionObject::Dvb8PixelsCodeString(SubPicDesc& spd, CGolombBuffer& gb, SHORT& nX, SHORT& nY)
{
BYTE bTemp;
BYTE nPaletteIndex = 0;
SHORT nCount;
bool bQuit = false;
while(!bQuit && !gb.IsEOF())
{
nCount = 0;
nPaletteIndex = 0;
bTemp = gb.ReadByte();
if(bTemp != 0)
{
nPaletteIndex = bTemp;
nCount = 1;
}
else
{
if(gb.BitRead(1) == 0) // switch_1
{
nCount = (SHORT)gb.BitRead(7); // run_length_1-127
if(nCount == 0)
bQuit = true;
}
else
{
nCount = (SHORT)gb.BitRead(7); // run_length_3-127
nPaletteIndex = gb.ReadByte();
}
}
if(nX + nCount > m_width)
{
ASSERT(FALSE);
break;
}
if(nCount > 0)
{
FillSolidRect(spd, nX, nY, nCount, 1, m_Colors[nPaletteIndex]);
nX += nCount;
}
}
gb.BitByteAlign();
}