Skip to main content
Version: 0.7.0
Docs.rs: ironrdp-graphics

Overview

The ironrdp-graphics crate provides image processing primitives and compression algorithms used in RDP graphics rendering:
  • Color space conversions (RGB ↔ YUV)
  • Image compression (RLE, RLGR)
  • Bulk compression (ZGFX)
  • RemoteFX encoding components (DWT, quantization)
  • Bitmap difference calculations

Key Modules

Color Conversion

Convert between RGB and YUV color spaces for video compression.

Compression Algorithms

RLE (Run-Length Encoding)

RLE compression for bitmap data.

RLGR (Run-Length Golomb-Rice)

Entropy encoding used in RemoteFX.

ZGFX (Bulk Compression)

Bulk compression for large data transfers.

RemoteFX Components

DWT (Discrete Wavelet Transform)

Wavelet transform used in RemoteFX image encoding.

Quantization

Quantization for lossy compression in RemoteFX.

Subband Reconstruction

Reconstruct image subbands after wavelet transform.

RDP 6 Compression

RDP 6.0/6.1 specific compression algorithms.

Image Processing Utilities

General image manipulation functions.

Rectangle Processing

Rectangle and region calculations.

Bitmap Difference

Compute differences between bitmap frames.

Pointer (Cursor) Handling

Cursor image processing.

RemoteFX Encoding

The crate provides a high-level function for encoding RemoteFX components:
Parameters:
&mut [i16]
Component data (must be 4096 elements = 64×64 pixels). Modified in-place during encoding.
&mut [u8]
Buffer to receive encoded data
&Quant
Quantization parameters from ironrdp_pdu::codecs::rfx::Quant
EntropyAlgorithm
Entropy algorithm (RLGR1 or RLGR3)
Panics: Panics if input.len() != 4096. Example:
The encoding pipeline:
  1. DWT (Discrete Wavelet Transform)
  2. Quantization
  3. Subband reconstruction
  4. RLGR entropy encoding

Dependencies

This crate depends on:
  • ironrdp-core - Core traits (public)
  • ironrdp-pdu - PDU structures for codec parameters (public)
  • yuv - YUV color conversion with RDP-specific features
  • bit_field, bitflags, bitvec - Bit manipulation

Usage Notes

Performance:
Many functions in this crate operate on large buffers in-place. Pre-allocate buffers and reuse them to avoid repeated allocations:
Image Formats:
RemoteFX operates on 64×64 tiles in YUV color space. Convert from RGB before encoding:

See Also