#[allow(clippy::suboptimal_flops)] // mul_add not guaranteed faster/available without target +fma; keep explicit a*b+c
#[allow(clippy::match_same_arms)] // enum/value mapping/dispatch table: one arm per input variant
#[allow(clippy::suboptimal_flops)] // mul_add not guaranteed faster/available without target +fma; keep explicit a*b+c
let (cx_frac, cy_frac) = resolve_background_position(&gradient.center, rect.width, rect.height);
#[allow(clippy::suboptimal_flops)] // mul_add not guaranteed faster/available without target +fma; keep explicit a*b+c
fn extract_mask_data(mask_image: &ImageRef, target_w: u32, target_h: u32) -> Option<Vec<u8>> {
fn acquire_pixmap(retained: Option<AzulPixmap>, w: u32, h: u32) -> Result<AzulPixmap, String> {
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] // software rasterizer: bounded pixel/coord/colour casts
render_with_font_manager_and_scroll(dl, res, font_manager, opts, glyph_cache, &empty_state)
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] // software rasterizer: bounded pixel/coord/colour casts
#[allow(clippy::cast_possible_truncation)] // software rasterizer: bounded pixel/coord/colour casts
#[allow(clippy::cast_possible_wrap, clippy::cast_precision_loss)] // bounded layout/render numeric cast
#[allow(clippy::too_many_lines)] // large but cohesive: single-purpose layout/render/parse routine (one branch per case)
#[allow(clippy::tuple_array_conversions)] // explicit [r,g,b,a]->(r,g,b,a) is correct; .into() was
#[allow(clippy::float_cmp)] // intentional exact compare: change-detection / identity fast-path / cache-key match
// enum/value mapping/dispatch table: one arm per input variant (or cross-type bindings that can't
#[allow(clippy::too_many_lines, clippy::cognitive_complexity)] // large but cohesive: single-purpose layout/render/parse routine (one branch per case)
/// * The device rotates. Subpixel rendering bakes in one physical RGB stripe order; turn the phone
/// * Phone panels are frequently not RGB stripe at all — `PenTile` and other OLED arrangements have
/// * The frame is composited and often scaled (the emulator does this too), and any resampling
/// - **Horizontal RGB** subpixel order. A BGR panel would need the R/B taps swapped; a vertical
/// - **Opaque background.** The pixfmt writes per-channel and forces the touched pixel's alpha to
/// 255, so subpixel text composited onto a transparent layer is wrong — as it is for every LCD
/// - Uses the glyph **path** cache (`get_or_build`), not the pre-rasterized cell cache, since the
let mut ra = unsafe { RowAccessor::new_with_buf(pixmap.data.as_mut_ptr(), w, h, stride) };
/// c^(1/2.2)): pure linear compositing renders dark-on-light lighter than Skia/ClearType, which
/// - `AZ_LCD_CHROMA_LIMIT=<0..255>` caps how far a stripe may deviate from the luminance-correct
#[allow(clippy::too_many_lines)] // large but cohesive: font lookup + grayscale/LCD dispatch + glyph loop
#[allow(clippy::suboptimal_flops)] // mul_add not guaranteed faster/available without target +fma; keep explicit a*b+c
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)] // software rasterizer: bounded pixel/coord/colour casts
#[allow(clippy::too_many_lines)] // large but cohesive: single-purpose layout/render/parse routine
#[allow(clippy::many_single_char_names, clippy::similar_names)] // domain-standard coordinate/geometry/short-lived names
#[allow(clippy::too_many_lines)] // large but cohesive: single-purpose layout/render/parse routine
/// * each source row is converted to straight RGBA once (`RgbaRow`) and reused by every destination
/// * the bilinear case is separable: the horizontal partial `p00·(1−tx) + p10·tx` is kept in f32
/// per source row, so the per-destination -pixel work is one lerp of two f32 rows. Keeping the
fn resolved_corner_radii(rect: &AzRect, border_radius: &BorderRadius, dpi_factor: f32) -> [f32; 4] {
#[allow(clippy::match_same_arms)] // enum/value mapping/dispatch table: one arm per input variant
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] // software rasterizer: bounded pixel/coord/colour casts
#[allow(clippy::too_many_lines)] // large but cohesive: single-purpose layout/render/parse routine (one branch per case)
/// rendered on opaque white it arrives as a white tile sitting in the titlebar instead of a glyph
/// * the RGBA buffer, so a caller building an `ImageRef` does not encode a PNG and immediately
// 2. Register the font in a throwaway FontManager. This helper builds its own one-item display
// 3. Shape the string (simple per-char advances; tooltips are short, single-line and unstyled,
#[allow(clippy::cast_precision_loss, clippy::cast_possible_truncation)] // bounded test-fixture
fn damaged(dl: &DisplayList, p: &mut AzulPixmap, rects: &[LogicalRect]) -> Result<(), String> {