use-resolution 0.0.1

Primitive resolution helpers
Documentation
  • Coverage
  • 4.76%
    1 out of 21 items documented1 out of 8 items with examples
  • Size
  • Source code size: 7.32 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 402.69 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-media
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

Primitive resolution helpers.

These helpers classify common resolutions and perform small scaling calculations without decoding media.

Examples

use use_resolution::{ResolutionClass, classify_resolution, fit_within, megapixels};

assert_eq!(classify_resolution(1920, 1080).unwrap(), ResolutionClass::FullHd);
assert!((megapixels(1920, 1080).unwrap() - 2.0736).abs() < 1.0e-12);
assert_eq!(fit_within(3840, 2160, 1920, 1080).unwrap(), (1920, 1080));