parse

Function parse 

Source
pub fn parse(data: &[u8]) -> Result<ScreenCapture, SdCardError>
Expand description

Parse a BMP screen capture file from raw bytes.

Validates the BMP file header, DIB header, dimensions, and bit depth. Extracts the raw BGR pixel data with row padding removed.

ยงErrors

Returns SdCardError::FileTooSmall if the data is shorter than the minimum BMP header size (54 bytes).

Returns SdCardError::InvalidBmpHeader if the BM magic bytes, DIB header size, or compression type is invalid.

Returns SdCardError::UnexpectedImageFormat if the width, height, or bit depth does not match the expected TH-D75 screen dimensions (240x180, 24-bit).