ironrdp_graphics/
lib.rs

1#![cfg_attr(doc, doc = include_str!("../README.md"))]
2#![doc(html_logo_url = "https://cdnweb.devolutions.net/images/projects/devolutions/logos/devolutions-icon-shadow.svg")]
3#![allow(clippy::arithmetic_side_effects)] // FIXME: remove
4#![allow(clippy::cast_lossless)] // FIXME: remove
5#![allow(clippy::cast_possible_truncation)] // FIXME: remove
6#![allow(clippy::cast_possible_wrap)] // FIXME: remove
7#![allow(clippy::cast_sign_loss)] // FIXME: remove
8
9pub mod color_conversion;
10pub mod diff;
11pub mod dwt;
12pub mod image_processing;
13pub mod pointer;
14pub mod quantization;
15pub mod rdp6;
16pub mod rectangle_processing;
17pub mod rle;
18pub mod rlgr;
19pub mod subband_reconstruction;
20pub mod zgfx;
21
22mod utils;
23
24pub fn rfx_encode_component(
25    input: &mut [i16],
26    output: &mut [u8],
27    quant: &ironrdp_pdu::codecs::rfx::Quant,
28    mode: ironrdp_pdu::codecs::rfx::EntropyAlgorithm,
29) -> Result<usize, rlgr::RlgrError> {
30    assert_eq!(input.len(), 64 * 64);
31
32    let mut temp = [0; 64 * 64]; // size = 8k, too big?
33
34    dwt::encode(input, temp.as_mut_slice());
35    quantization::encode(input, quant);
36    subband_reconstruction::encode(&mut input[4032..]);
37    rlgr::encode(mode, input, output)
38}