use sc2_proto::common;
use super::super::{ Result, FromProto };
#[derive(Debug, Clone)]
pub struct ImageData {
pub bits_per_pixel: i32,
pub data: Vec<u8>,
pub width: i32,
pub height: i32,
}
impl FromProto<common::ImageData> for ImageData {
fn from_proto(mut data: common::ImageData) -> Result<Self> {
Ok(
Self {
bits_per_pixel: data.get_bits_per_pixel(),
data: data.take_data(),
width: data.get_size().get_x(),
height: data.get_size().get_y()
}
)
}
}