Skip to main content

encode_pixel_value_u32

Function encode_pixel_value_u32 

Source
pub fn encode_pixel_value_u32(pv: &PixelValue) -> u32
Expand description

u32 encoding for dimension properties (width, height, min-, max-, flex-basis, font-size).

Layout: [3:0] SizeMetric (4 bits) | [31:4] signed fixed-point ×1000 (28 bits)

This matches FloatValue’s internal representation (isize × 1000). Range: ±134,217.727 at 0.001 precision (28-bit signed = ±2^27 = ±134,217,728 / 1000).

Sentinel values use the top of the u32 range (0xFFFFFFF9..0xFFFFFFFF). Encode a PixelValue into u32 with SizeMetric. Returns U32_SENTINEL if out of range.