namespace BinaryObjectScanner.Models.Compression.LZX
{
///
/// Following the generic block header, an uncompressed block begins with 1 to 16 bits of zero padding
/// to align the bit buffer on a 16-bit boundary. At this point, the bitstream ends and a byte stream
/// begins. Following the zero padding, new 32-bit values for R0, R1, and R2 are output in little-endian
/// form, followed by the uncompressed data bytes themselves. Finally, if the uncompressed data length
/// is odd, one extra byte of zero padding is encoded to realign the following bitstream.
///
/// Then the bitstream of byte-swapped 16-bit integers resumes for the next Block Type field (if there
/// are subsequent blocks).
///
/// The decoded R0, R1, and R2 values are used as initial repeated offset values to decode the
/// subsequent compressed block if present.
///
///
public class UncompressedBlock
{
///
/// Generic block header
///
public BlockHeader Header;
///
/// Padding to align following field on 16-bit boundary
///
/// Bits have a value of zero
public ushort PaddingBits;
///
/// Least significant to most significant byte (little-endian DWORD ([MS-DTYP]))
///
/// Encoded directly in the byte stream, not in the bitstream of byte-swapped 16-bit words
public uint R0;
///
/// Least significant to most significant byte (little-endian DWORD)
///
/// Encoded directly in the byte stream, not in the bitstream of byte-swapped 16-bit words
public uint R1;
///
/// Least significant to most significant byte (little-endian DWORD)
///
/// Encoded directly in the byte stream, not in the bitstream of byte-swapped 16-bit words
public uint R2;
///
/// Can use the direct memcpy function, as specified in [IEEE1003.1]
///
/// Encoded directly in the byte stream, not in the bitstream of byte-swapped 16-bit words
public byte[] RawDataBytes;
///
/// Only if uncompressed size is odd
///
public byte AlignmentByte;
}
}