()
| 1014 | |
| 1015 | #[test] |
| 1016 | fn test_mask_image() { |
| 1017 | |
| 1018 | let mask = GrayImage::from_file("datasets/testing/10x10colors_mask.png").unwrap(); |
| 1019 | let gray = GrayImage::from_file("datasets/testing/10x10gray.png").unwrap(); |
| 1020 | |
| 1021 | let v = gray.pixels_from_mask_as_u8(&mask); |
| 1022 | assert_eq!(v.unwrap(), |
| 1023 | vec![0x36, 0x36, 0xed, 0x12, 0x12, 0x36, 0x36, 0xff, 0x36, 0x49, 0x00, 0xff] |
| 1024 | ); |
| 1025 | |
| 1026 | let x: Vec<u8> = gray.mask_iter(&mask).collect(); |
| 1027 | assert_eq!(x, |
| 1028 | vec![0x36, 0x36, 0xed, 0x12, 0x12, 0x36, 0x36, 0xff, 0x36, 0x49, 0x00, 0xff] |
| 1029 | ); |
| 1030 | } |
| 1031 | |
| 1032 | #[test] |
| 1033 | fn test_mask_video() { |
nothing calls this directly
no test coverage detected