pub enum ScreenshotContent {
UiDominated {
entropy: f32,
},
GameWorld {
entropy: f32,
},
HighEntropy {
entropy: f32,
},
Uniform {
fill_value: u8,
},
}Expand description
Screenshot content classification for optimal compression
Based on entropy analysis to determine best compression strategy.
§Example
use jugar_probar::validators::ScreenshotContent;
// Simulate UI-heavy screenshot (low entropy)
let pixels: Vec<u8> = vec![255; 1000]; // Uniform white
let content = ScreenshotContent::classify(&pixels);
assert!(matches!(content, ScreenshotContent::Uniform { .. }));Variants§
UiDominated
UI-heavy (text, buttons) - high compressibility
GameWorld
Physics/game world - medium compressibility
HighEntropy
Random/noise - low compressibility
Uniform
Mostly uniform - very high compressibility (same-fill)
Implementations§
Source§impl ScreenshotContent
impl ScreenshotContent
Sourcepub fn classify(pixels: &[u8]) -> Self
pub fn classify(pixels: &[u8]) -> Self
Classify screenshot by entropy analysis
Uses Shannon entropy to determine content type.
Sourcepub fn recommended_algorithm(&self) -> CompressionAlgorithm
pub fn recommended_algorithm(&self) -> CompressionAlgorithm
Recommended compression algorithm based on content type
Sourcepub fn expected_ratio_hint(&self) -> &'static str
pub fn expected_ratio_hint(&self) -> &'static str
Expected compression ratio hint
Trait Implementations§
Source§impl Clone for ScreenshotContent
impl Clone for ScreenshotContent
Source§fn clone(&self) -> ScreenshotContent
fn clone(&self) -> ScreenshotContent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ScreenshotContent
impl RefUnwindSafe for ScreenshotContent
impl Send for ScreenshotContent
impl Sync for ScreenshotContent
impl Unpin for ScreenshotContent
impl UnsafeUnpin for ScreenshotContent
impl UnwindSafe for ScreenshotContent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more