GL Studio SCECpp Runtime Library
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
GlsRLEDecoder Class Reference

#include <gls_rle_decoder.h>

Public Member Functions

 GlsRLEDecoder (const GlsUChar *const inlineData[], const GlsUInt32 inlineDataLength, const GlsUInt32 lineLength)
 
 ~GlsRLEDecoder ()
 
GlsUChar DecodeByte (void)
 
GlsBool IsDone (void) const
 

Protected Attributes

GlsUtil::InlineReader _inlineReader
 
GlsUChar _markerByte
 
GlsUInt32 _sequenceRemaining
 
GlsUChar _repeatedByte
 

Static Protected Attributes

static const GlsUChar TWO_BYTE_COUNT_FLAG = 0x80
 

Detailed Description

RLE ( Run Length Encoded compression ) decoder. This decoder allows for incremental decoding of RLE compressed data in inline format.

Invariant
_inlineReader invariant holds

Constructor & Destructor Documentation

GlsRLEDecoder::GlsRLEDecoder ( const GlsUChar *const  inlineData[],
const GlsUInt32  inlineDataLength,
const GlsUInt32  lineLength 
)

Constructor - create an instance

Parameters
inlineDatainline RLE data to decode
inlineDataLengthlength in bytes of inline RLE data to decode ( not including terminators at end of lines )
lineLengthlength (in bytes) of one line of data in the inline data (not including NULL terminator)
Precondition
inlineData != GLS_NULL, inlineDataLength > 1, lineLength > 0
Postcondition
instance created
GlsRLEDecoder::~GlsRLEDecoder ( )

Destructor - destroy instance

Precondition
none
Postcondition
instance destroyed

Member Function Documentation

GlsUChar GlsRLEDecoder::DecodeByte ( void  )

Decode one byte of input

Returns
decoded byte
Precondition
there must be at least one more byte of input remaining
Postcondition
one byte is read from input
GlsBool GlsRLEDecoder::IsDone ( void  ) const

Determine if decoder is finished decoding input data

Returns
GLS_TRUE if done else GLS_FALSE
Precondition
none
Postcondition
none

Member Data Documentation

GlsUtil::InlineReader GlsRLEDecoder::_inlineReader
protected

inline data reader

GlsUChar GlsRLEDecoder::_markerByte
protected

marker byte to signal run length

GlsUChar GlsRLEDecoder::_repeatedByte
protected

current repeated byte if _sequenceRemaining > 0

GlsUInt32 GlsRLEDecoder::_sequenceRemaining
protected

number of repeated bytes remaining in sequence else 0

const GlsUChar GlsRLEDecoder::TWO_BYTE_COUNT_FLAG = 0x80
staticprotected

flag in input data that indicates a two byte repeat count