Primitive media dimension helpers.
These helpers keep width and height calculations explicit and validated.
Examples
use ;
let size = new.unwrap;
assert_eq!;
assert!;
assert_eq!;
assert!;
Primitive media dimension helpers.
These helpers keep width and height calculations explicit and validated.
use use_dimensions::{Dimensions, is_landscape, pixel_area};
let size = Dimensions::new(1920, 1080).unwrap();
assert_eq!(size.area(), 2_073_600);
assert!(size.is_landscape());
assert_eq!(pixel_area(1920, 1080).unwrap(), 2_073_600);
assert!(is_landscape(1920, 1080).unwrap());