Nebula
Loading...
Searching...
No Matches
runlengthcodec.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
13#include "core/types.h"
14
15//------------------------------------------------------------------------------
16namespace Util
17{
19{
20public:
22 static SizeT GetSafeRLEBufferSize(SizeT srcBufferSize);
24 static SizeT ComputeDecodedSize(const uchar* srcPtr, SizeT srcNumBytes);
26 static SizeT Encode(const uchar* srcPtr, SizeT srcNumBytes, uchar* dstPtr, SizeT dstNumBytes);
28 static SizeT Decode(const uchar* srcPtr, SizeT srcNumBytes, uchar* dstPtr, SizeT dstNumBytes);
29};
30
31} // namespace Util
32//------------------------------------------------------------------------------
A simple byte-based runlength encoder/decoder.
Definition runlengthcodec.h:19
static SizeT Encode(const uchar *srcPtr, SizeT srcNumBytes, uchar *dstPtr, SizeT dstNumBytes)
encode byte buffer to RLE stream, returns size of RLE stream
Definition runlengthcodec.cc:28
static SizeT Decode(const uchar *srcPtr, SizeT srcNumBytes, uchar *dstPtr, SizeT dstNumBytes)
decode RLE stream to byte buffer
Definition runlengthcodec.cc:74
static SizeT ComputeDecodedSize(const uchar *srcPtr, SizeT srcNumBytes)
compute the decoded byte size from an RLE encoded stream
Definition runlengthcodec.cc:57
static SizeT GetSafeRLEBufferSize(SizeT srcBufferSize)
get a safe size for the destination buffer
Definition runlengthcodec.cc:19
A pinned array is an array which manages its own virtual memory.
Definition String.cs:6
unsigned char uchar
Definition types.h:33
int SizeT
Definition types.h:49