Seregon/StratoSDK

StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.

Rust/27.3 KB/No license
crates/strato-ui-renderer/src/platform/mac/rendering/metal/frame_capture_tests.rs
StratoSDK / crates / strato-ui-renderer / src / platform / mac / rendering / metal / frame_capture_tests.rs
1use super::convert_bgra_to_rgba;
2 
3#[test]
4fn test_convert_bgra_to_rgba() {
5 let mut data = vec![
6 0xBB, 0xCC, 0xFF, 0xAA, // BGRA pixel (Blue, Green, Red, Alpha)
7 0x11, 0x22, 0x33, 0x44, // Another BGRA pixel
8 ];
9 
10 convert_bgra_to_rgba(&mut data);
11 
12 // After conversion, should be RGBA (Red, Green, Blue, Alpha)
13 assert_eq!(
14 data,
15 vec![
16 0xFF, 0xCC, 0xBB, 0xAA, // RGBA pixel
17 0x33, 0x22, 0x11, 0x44, // Another RGBA pixel
18 ]
19 );
20}
21