pub struct NativeCalibrationMarkerSpec {
pub nonce: u64,
pub candidate_ordinal: u32,
}Expand description
Deterministic marker identity used to correlate a native output with a capture.
A nonce distinguishes calibration attempts and candidate_ordinal
distinguishes outputs within one attempt. Both values feed the asymmetric
perimeter signature; they are identifiers, not cryptographic secrets.
§Examples
let spec = ailloli_ui_winit::NativeCalibrationMarkerSpec::new(42, 3);
assert_eq!((spec.nonce, spec.candidate_ordinal), (42, 3));Fields§
§nonce: u64Attempt-specific signature seed.
candidate_ordinal: u32Zero-based candidate index mixed into the signature.
Implementations§
Source§impl NativeCalibrationMarkerSpec
Marker construction and expected-pixel classification.
impl NativeCalibrationMarkerSpec
Marker construction and expected-pixel classification.
Sourcepub const BORDER_RGBA: [u8; 4]
pub const BORDER_RGBA: [u8; 4]
Opaque red RGBA8 color for ordinary perimeter pixels.
§Examples
assert_eq!(ailloli_ui_winit::NativeCalibrationMarkerSpec::BORDER_RGBA, [239, 24, 24, 255]);Sourcepub const SIGNATURE_RGBA: [u8; 4]
pub const SIGNATURE_RGBA: [u8; 4]
Opaque cyan RGBA8 color for nonce/candidate signature pixels.
§Examples
assert_eq!(ailloli_ui_winit::NativeCalibrationMarkerSpec::SIGNATURE_RGBA, [0, 221, 255, 255]);Sourcepub const TRANSPARENT_RGBA: [u8; 4]
pub const TRANSPARENT_RGBA: [u8; 4]
Fully transparent black RGBA8 used outside the perimeter.
§Examples
assert_eq!(ailloli_ui_winit::NativeCalibrationMarkerSpec::TRANSPARENT_RGBA, [0, 0, 0, 0]);Sourcepub const fn new(nonce: u64, candidate_ordinal: u32) -> Self
pub const fn new(nonce: u64, candidate_ordinal: u32) -> Self
Creates a deterministic marker specification.
§Examples
let spec = ailloli_ui_winit::NativeCalibrationMarkerSpec::new(9, 2);
assert_eq!(spec.candidate_ordinal, 2);Sourcepub fn pixel_role(
self,
logical_width: u32,
logical_height: u32,
x: u32,
y: u32,
) -> NativeCalibrationMarkerPixel
pub fn pixel_role( self, logical_width: u32, logical_height: u32, x: u32, y: u32, ) -> NativeCalibrationMarkerPixel
Classifies one logical marker coordinate.
Coordinates outside the supplied extent and interior pixels are transparent. A five-logical-pixel perimeter is split deterministically between red border and cyan signature pixels. Saturating arithmetic keeps dimensions smaller than twice the border well-defined.
§Examples
use ailloli_ui_winit::{NativeCalibrationMarkerPixel, NativeCalibrationMarkerSpec};
let spec = NativeCalibrationMarkerSpec::new(1, 0);
assert_eq!(spec.pixel_role(100, 100, 50, 50), NativeCalibrationMarkerPixel::Transparent);
assert_eq!(spec.pixel_role(100, 100, 100, 0), NativeCalibrationMarkerPixel::Transparent);Sourcepub fn expected_rgba(
self,
logical_width: u32,
logical_height: u32,
x: u32,
y: u32,
) -> [u8; 4]
pub fn expected_rgba( self, logical_width: u32, logical_height: u32, x: u32, y: u32, ) -> [u8; 4]
Returns the exact RGBA8 value expected at one logical marker coordinate.
§Examples
use ailloli_ui_winit::NativeCalibrationMarkerSpec;
let spec = NativeCalibrationMarkerSpec::new(1, 0);
assert_eq!(spec.expected_rgba(100, 100, 50, 50), NativeCalibrationMarkerSpec::TRANSPARENT_RGBA);Trait Implementations§
Source§impl Clone for NativeCalibrationMarkerSpec
impl Clone for NativeCalibrationMarkerSpec
Source§fn clone(&self) -> NativeCalibrationMarkerSpec
fn clone(&self) -> NativeCalibrationMarkerSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NativeCalibrationMarkerSpec
impl Debug for NativeCalibrationMarkerSpec
impl Copy for NativeCalibrationMarkerSpec
impl Eq for NativeCalibrationMarkerSpec
impl StructuralPartialEq for NativeCalibrationMarkerSpec
Auto Trait Implementations§
impl Freeze for NativeCalibrationMarkerSpec
impl RefUnwindSafe for NativeCalibrationMarkerSpec
impl Send for NativeCalibrationMarkerSpec
impl Sync for NativeCalibrationMarkerSpec
impl Unpin for NativeCalibrationMarkerSpec
impl UnwindSafe for NativeCalibrationMarkerSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more