DuoFoldParameters class

Physical parameters of the frosted-glass fold.

Every value here is a real-world quantity: the model is an eye at a fixed distance looking at a plane through a tilting pane of glass.

Constructors

DuoFoldParameters({double eyeDistanceMillimeters = 450, double pixelsPerMillimeter = 0, double blurSpread = 0.12, double darkening = 0.0084, Color surroundColor = const ui.Color(0xFF000000), Color hazeColor = const ui.Color(0xFF000000), double baseBlurMillimeters = 0.10, bool stretchEdges = true, double tiltResponse = 1})
Creates a parameter set.
const

Properties

baseBlurMillimeters → double
Blur carried everywhere the moment the fold leaves rest, in millimetres of physical screen.
final
blurSpread → double
Blur radius gained per pixel of separation between the glass and the UI plane, the tangent of the scattering half-angle.
final
darkening → double
Fraction of light lost per pixel of blur radius. Frostier glass reads further from the content and closer to hazeColor.
final
eyeDistanceMillimeters → double
Distance from the viewer's eyes to the untilted screen, looking head-on.
final
hashCode → int
The hash code for this object.
no setteroverride
hazeColor → Color
What the scattered light fades toward, at a rate set by darkening.
final
pixelsPerMillimeter → double
Physical pixel density of the filter input. Zero means resolve it from the platform's display metrics, which is what you almost always want.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stretchEdges → bool
Whether content is sampled clamped to its own edge.
final
surroundColor → Color
What lies beyond the edge of the content plane.
final
tiltResponse → double
How tilt maps onto the fold, as an exponent.
final

Methods

copyWith({double? eyeDistanceMillimeters, double? pixelsPerMillimeter, double? blurSpread, double? darkening, Color? surroundColor, Color? hazeColor, double? baseBlurMillimeters, bool? stretchEdges, double? tiltResponse}) → DuoFoldParameters
Returns a copy with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
packUniforms({required double tiltDegrees, required double liftDirX, required double liftDirY, required double pixelsPerMillimeter}) → List<double>
Packs the custom float uniforms in shader declaration order.
resolvePixelsPerMillimeter(double? fromDisplay) → double
Picks the density to use: explicit value first, then the platform's, then fallbackPixelsPerMillimeter.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Constants

fallbackPixelsPerMillimeter → const double
Used when the platform reports no usable pixel density.
maxTiltDegrees → const double
Widest tilt the optical model stays stable over, in degrees.
referencePixelsPerMillimeter → const double
Density darkening is authored against, roughly a phone panel.