File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
crates/ironrdp-server/src Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 1
1
use core:: num:: NonZeroU16 ;
2
2
3
3
use anyhow:: Result ;
4
- use bytes:: Bytes ;
4
+ use bytes:: { Bytes , BytesMut } ;
5
5
use ironrdp_displaycontrol:: pdu:: DisplayControlMonitorLayout ;
6
6
use ironrdp_pdu:: pointer:: PointerPositionAttribute ;
7
7
@@ -56,6 +56,30 @@ pub struct ColorPointer {
56
56
pub xor_mask : Vec < u8 > ,
57
57
}
58
58
59
+ pub struct Framebuffer {
60
+ pub width : NonZeroU16 ,
61
+ pub height : NonZeroU16 ,
62
+ pub format : PixelFormat ,
63
+ pub data : BytesMut ,
64
+ pub stride : usize ,
65
+ }
66
+
67
+ impl TryInto < Framebuffer > for BitmapUpdate {
68
+ type Error = & ' static str ;
69
+
70
+ fn try_into ( self ) -> Result < Framebuffer , Self :: Error > {
71
+ assert_eq ! ( self . top, 0 ) ;
72
+ assert_eq ! ( self . left, 0 ) ;
73
+ Ok ( Framebuffer {
74
+ width : self . width ,
75
+ height : self . height ,
76
+ format : self . format ,
77
+ data : self . data . try_into_mut ( ) . map_err ( |_| "BitmapUpdate is shared" ) ?,
78
+ stride : self . stride ,
79
+ } )
80
+ }
81
+ }
82
+
59
83
/// Bitmap Display Update
60
84
///
61
85
/// Bitmap updates are encoded using RDP 6.0 compression, fragmented and sent using
You can’t perform that action at this time.
0 commit comments