NL3D::CTileLumel::CStreamBit Class Reference

#include <tile_lumel.h>


Detailed Description

Stream bit class used to compress the shadow map of the patch.

Definition at line 52 of file tile_lumel.h.

Public Member Functions

uint8 popBack4bits ()
 Pop 4 bits.

bool popBackBool ()
 Pop a bool.

void pushBack4bits (uint8 fourBits)
 Push 4 bits.

void pushBackBool (bool bBoolean)
 Push a bool.

void setPtr (std::vector< uint8 > *buffer)
 Init the pointer of the stream.


Private Attributes

uint _Offset
std::vector< uint8 > * _Vector


Member Function Documentation

uint8 NL3D::CTileLumel::CStreamBit::popBack4bits  )  [inline]
 

Pop 4 bits.

Definition at line 186 of file tile_lumel.h.

References popBackBool(), and uint8.

Referenced by NL3D::CTileLumel::skip(), and NL3D::CTileLumel::unpack().

00187 {
00188         uint8 ret;
00189         ret=(uint8)popBackBool ()<<3;
00190         ret|=(uint8)popBackBool ()<<2;
00191         ret|=(uint8)popBackBool ()<<1;
00192         ret|=(uint8)popBackBool ();
00193         return ret;
00194         /*nlassert (((_Offset+3)>>3)<_Vector->size());
00195 
00196         uint off0=_Offset>>3;
00197         uint off1=off0+1;
00198         _Offset+=4;
00199         return  (((*_Vector)[off0]&(0xf<<(  _Offset&0x7   )))>>(_Offset&0x7))|
00200                         (((*_Vector)[off1]&(0xf>>(8-(_Offset&0x7))))<<(8-(_Offset&0x7)));*/
00201 }

bool NL3D::CTileLumel::CStreamBit::popBackBool  )  [inline]
 

Pop a bool.

Definition at line 174 of file tile_lumel.h.

References _Offset, _Vector, nlassert, and uint.

Referenced by popBack4bits(), NL3D::CTileLumel::skip(), and NL3D::CTileLumel::unpack().

00175 {
00176         // Size
00177         nlassert ((_Offset>>3)<_Vector->size());
00178 
00179         uint off=_Offset>>3;
00180         bool ret=((*_Vector)[off]&(1<<(_Offset&0x7)))!=0;
00181         _Offset++;
00182         return ret;
00183 }

void NL3D::CTileLumel::CStreamBit::pushBack4bits uint8  fourBits  )  [inline]
 

Push 4 bits.

Definition at line 152 of file tile_lumel.h.

References nlassert, pushBackBool(), and uint8.

Referenced by NL3D::CTileLumel::pack().

00153 {
00154         nlassert (fourBits<0x10);
00155 
00156         pushBackBool ((fourBits&0x8)!=0);
00157         pushBackBool ((fourBits&0x4)!=0);
00158         pushBackBool ((fourBits&0x2)!=0);
00159         pushBackBool ((fourBits&0x1)!=0);
00160 
00161         /*if (((_Offset+3)>>3)+_Vector->begin()>=_Vector->end())
00162                 _Vector->resize (((_Offset+3)>>3)+1);
00163 
00164         uint off0=_Offset>>3;
00165         uint off1=off0+1;
00166         (*_Vector)[off0]&=~(0xf<<(_Offset&0x7));
00167         (*_Vector)[off0]|=(((uint)fourBits)<<(_Offset&0x7));
00168         (*_Vector)[off1]&=~(0xf>>(8-(_Offset&0x7)));
00169         (*_Vector)[off1]|=(((uint)fourBits)>>(8-(_Offset&0x7)));
00170         _Offset+=4;*/
00171 }

void NL3D::CTileLumel::CStreamBit::pushBackBool bool  bBoolean  )  [inline]
 

Push a bool.

Definition at line 139 of file tile_lumel.h.

References _Offset, _Vector, and uint.

Referenced by NL3D::CTileLumel::pack(), and pushBack4bits().

00140 {
00141         // Size
00142         if ((_Offset>>3)+_Vector->begin()>=_Vector->end())
00143                 _Vector->resize ((_Offset>>3)+1);
00144 
00145         uint off=_Offset>>3;
00146         (*_Vector)[off]&=~(1<<(_Offset&0x7));
00147         (*_Vector)[off]|=(((uint)bBoolean)<<(_Offset&0x7));
00148         _Offset++;
00149 }

void NL3D::CTileLumel::CStreamBit::setPtr std::vector< uint8 > *  buffer  )  [inline]
 

Init the pointer of the stream.

Definition at line 132 of file tile_lumel.h.

References _Offset, _Vector, and buffer.

00133 {
00134         _Vector=buffer;
00135         _Offset=0;
00136 }


Field Documentation

uint NL3D::CTileLumel::CStreamBit::_Offset [private]
 

Definition at line 71 of file tile_lumel.h.

Referenced by popBackBool(), pushBackBool(), and setPtr().

std::vector<uint8>* NL3D::CTileLumel::CStreamBit::_Vector [private]
 

Definition at line 70 of file tile_lumel.h.

Referenced by popBackBool(), pushBackBool(), and setPtr().


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 08:04:59 2004 for NeL by doxygen 1.3.6