#include <fsRle8Enc.h>
Collaboration diagram for fs::ras::Rle8Enc_t:
Rle8Enc_t represents a RLE8 encoder. Source RGBA-8888 image data is encoded into sequences of opaque pixels referring to a RGBA-8888 color palette through an 8bit index. Transparent segments are left out. Each chunk in the RLE8 data stream starts with a [COUNT] byte holding number of pixels (max. 127) in the subsequent sequence. [COUNT] has also encoded a transparency flag implying whether or not an opaque pixel sequence follows. See the following example for a basic idea: 0,0,0,1,2,3,0,0,5,0,0,0 is encoded into: 3/0,3/1,1,2,3,2/0,1/1,5,3/0. Note that the full width is always encoded even if there are only transparent pixels on a scan line.
Definition at line 36 of file fsRle8Enc.h.
Public Types | |
typedef unsigned int | uint32 |
Public Member Functions | |
Rle8Enc_t (const PxFmt8888_t *pSrc, int nW, int nH) | |
Initialize from the given RGBA-8888 source image data. | |
~Rle8Enc_t () | |
Destroys internal data. | |
bool | IsValid () const |
Checks the internal state / correct construction. | |
bool | GetSize (int &nW, int &nH) const |
Returns the size of the image. | |
bool | GetRle (const unsigned char *&pRle, int &nNum) const |
Returns RLE8 data stream. | |
bool | GetPal (const PxFmt8888_t *&pPal, int &nNum) const |
Returns palette items. | |
bool | GetOff (const uint32 *&pOff, int &nNum) const |
Returns line offsets. | |
Private Member Functions | |
Rle8Enc_t () | |
No def ctor. | |
Rle8Enc_t (const Rle8Enc_t &) | |
No copy. | |
Rle8Enc_t & | operator= (const Rle8Enc_t &) |
No assignment. | |
Private Attributes | |
void * | m_pImpl |
The PIPML idiom is used. | |
Classes | |
struct | PxFmt8888_t |
Input & palette pixel format. More... |
typedef unsigned int fs::ras::Rle8Enc_t::uint32 |
Definition at line 40 of file fsRle8Enc.h.
Rle8Enc_t::Rle8Enc_t | ( | const PxFmt8888_t * | pSrc, | |
int | nW, | |||
int | nH | |||
) |
Initialize from the given RGBA-8888 source image data.
Definition at line 231 of file fsRle8Enc.cpp.
References FS_ASSERT_MSG, and m_pImpl.
Rle8Enc_t::~Rle8Enc_t | ( | ) |
Destroys internal data.
Definition at line 237 of file fsRle8Enc.cpp.
References FS_ASSERT_MSG, and m_pImpl.
fs::ras::Rle8Enc_t::Rle8Enc_t | ( | ) | [private] |
No def ctor.
fs::ras::Rle8Enc_t::Rle8Enc_t | ( | const Rle8Enc_t & | ) | [private] |
No copy.
bool Rle8Enc_t::GetOff | ( | const uint32 *& | pOff, | |
int & | nNum | |||
) | const |
Returns line offsets.
Definition at line 268 of file fsRle8Enc.cpp.
References FS_ASSERT_MSG, and m_pImpl.
bool Rle8Enc_t::GetPal | ( | const PxFmt8888_t *& | pPal, | |
int & | nNum | |||
) | const |
Returns palette items.
Definition at line 261 of file fsRle8Enc.cpp.
References FS_ASSERT_MSG, and m_pImpl.
bool Rle8Enc_t::GetRle | ( | const unsigned char *& | pRle, | |
int & | nNum | |||
) | const |
Returns RLE8 data stream.
Definition at line 255 of file fsRle8Enc.cpp.
References FS_ASSERT_MSG, and m_pImpl.
bool Rle8Enc_t::GetSize | ( | int & | nW, | |
int & | nH | |||
) | const |
Returns the size of the image.
Definition at line 249 of file fsRle8Enc.cpp.
References FS_ASSERT_MSG, and m_pImpl.
bool Rle8Enc_t::IsValid | ( | ) | const |
Checks the internal state / correct construction.
Definition at line 243 of file fsRle8Enc.cpp.
References FS_ASSERT_MSG, and m_pImpl.
void* fs::ras::Rle8Enc_t::m_pImpl [private] |