mirror of
https://github.com/Devolutions/IronRDP.git
synced 2025-08-04 15:18:17 +00:00
feat(server): add Framebuffer helper struct
This will hold the updated bitmap data for the whole framebuffer. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
3c43fdda76
commit
1e87961d16
1 changed files with 25 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
use core::num::NonZeroU16;
|
||||
|
||||
use anyhow::Result;
|
||||
use bytes::Bytes;
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use ironrdp_displaycontrol::pdu::DisplayControlMonitorLayout;
|
||||
use ironrdp_pdu::pointer::PointerPositionAttribute;
|
||||
|
||||
|
@ -56,6 +56,30 @@ pub struct ColorPointer {
|
|||
pub xor_mask: Vec<u8>,
|
||||
}
|
||||
|
||||
pub struct Framebuffer {
|
||||
pub width: NonZeroU16,
|
||||
pub height: NonZeroU16,
|
||||
pub format: PixelFormat,
|
||||
pub data: BytesMut,
|
||||
pub stride: usize,
|
||||
}
|
||||
|
||||
impl TryInto<Framebuffer> for BitmapUpdate {
|
||||
type Error = &'static str;
|
||||
|
||||
fn try_into(self) -> Result<Framebuffer, Self::Error> {
|
||||
assert_eq!(self.top, 0);
|
||||
assert_eq!(self.left, 0);
|
||||
Ok(Framebuffer {
|
||||
width: self.width,
|
||||
height: self.height,
|
||||
format: self.format,
|
||||
data: self.data.try_into_mut().map_err(|_| "BitmapUpdate is shared")?,
|
||||
stride: self.stride,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// Bitmap Display Update
|
||||
///
|
||||
/// Bitmap updates are encoded using RDP 6.0 compression, fragmented and sent using
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue