|
7 | 7 | mod glyph_cache; |
8 | 8 | mod vbar_cache; |
9 | 9 |
|
10 | | -pub use self::glyph_cache::{GlyphCache, GlyphEntry, GLYPH_CACHE_SIZE}; |
| 10 | +pub use self::glyph_cache::{GLYPH_CACHE_SIZE, GlyphCache, GlyphEntry}; |
11 | 11 | pub use self::vbar_cache::{FullVBar, ShortVBar, VBarCache}; |
12 | 12 |
|
13 | 13 | /// Glyph cache size as u16 for index arithmetic. GLYPH_CACHE_SIZE=4000 fits in u16. |
14 | 14 | const GLYPH_CACHE_WRAP: u16 = 4_000; |
15 | 15 |
|
16 | | -use ironrdp_core::{invalid_field_err, DecodeResult, ReadCursor}; |
| 16 | +use ironrdp_core::{DecodeResult, ReadCursor, invalid_field_err}; |
17 | 17 | use ironrdp_pdu::codecs::clearcodec::{ |
18 | | - decode_bands_layer, decode_residual_layer, decode_subcodec_layer, encode_residual_layer, ClearCodecBitmapStream, |
19 | | - CompositePayload, RgbRunSegment, SubcodecId, VBar, FLAG_GLYPH_INDEX, |
| 18 | + ClearCodecBitmapStream, CompositePayload, FLAG_GLYPH_INDEX, RgbRunSegment, SubcodecId, VBar, decode_bands_layer, |
| 19 | + decode_residual_layer, decode_subcodec_layer, encode_residual_layer, |
20 | 20 | }; |
21 | 21 |
|
22 | 22 | /// ClearCodec decoder maintaining persistent cache state across frames. |
@@ -510,10 +510,10 @@ fn bgra_to_run_segments(bgra: &[u8], pixel_count: usize) -> Vec<RgbRunSegment> { |
510 | 510 |
|
511 | 511 | #[cfg(test)] |
512 | 512 | mod tests { |
513 | | - use super::*; |
514 | | - |
515 | 513 | use ironrdp_pdu::codecs::clearcodec::{FLAG_CACHE_RESET, FLAG_GLYPH_HIT}; |
516 | 514 |
|
| 515 | + use super::*; |
| 516 | + |
517 | 517 | fn make_residual_only_stream(width: u16, height: u16, blue: u8, green: u8, red: u8) -> Vec<u8> { |
518 | 518 | let pixel_count = u32::from(width) * u32::from(height); |
519 | 519 | let mut data = Vec::new(); |
@@ -568,7 +568,7 @@ mod tests { |
568 | 568 | stream.push(FLAG_GLYPH_INDEX); // flags |
569 | 569 | stream.push(0x00); // seq |
570 | 570 | stream.extend_from_slice(&42u16.to_le_bytes()); // glyph_index = 42 |
571 | | - // Composite with 1-pixel residual (white) |
| 571 | + // Composite with 1-pixel residual (white) |
572 | 572 | let residual = [0xFF, 0xFF, 0xFF, 0x01]; // BGR white, run=1 |
573 | 573 | stream.extend_from_slice(&4u32.to_le_bytes()); // residual bytes |
574 | 574 | stream.extend_from_slice(&0u32.to_le_bytes()); // bands bytes |
@@ -614,7 +614,7 @@ mod tests { |
614 | 614 |
|
615 | 615 | let pixels = decoder.decode(&stream, 2, 1).unwrap(); |
616 | 616 | assert_eq!(pixels.len(), 2 * 4); // 2 pixels * BGRA |
617 | | - // Pixel 0: red (BGR: 0x00, 0x00, 0xFF) |
| 617 | + // Pixel 0: red (BGR: 0x00, 0x00, 0xFF) |
618 | 618 | assert_eq!(&pixels[0..4], &[0x00, 0x00, 0xFF, 0xFF]); |
619 | 619 | // Pixel 1: blue (BGR: 0xFF, 0x00, 0x00) |
620 | 620 | assert_eq!(&pixels[4..8], &[0xFF, 0x00, 0x00, 0xFF]); |
|
0 commit comments