Skip to main content

Crate hxy_view

Crate hxy_view 

Source
Expand description

Reusable egui hex-view widget.

Renders bytes from a HexSource in a virtualised scroll view with a configurable number of hex columns (16 by default), an address column, and an ASCII sidebar. Supports click, shift-click, and drag across arbitrary row boundaries to extend the selection. Highlights are painted as contiguous bars across each row for readability.

Structs§

BytePalette
Palette for byte-class tinting. Each variant of [ByteClass] maps to one colour. Rendered text remains readable via the view’s contrast-adjustment.
ByteStyle
Foreground + background colour choice for a single byte cell. Returned by a ByteStylerFn so the consumer can fully override the built-in palette’s decision per byte (e.g. to highlight a matched pattern, a diff, or bytes pointed to by a parsed template).
HexView
HexViewLayout
Immutable snapshot of the HexView’s per-frame geometry. Values are in screen coordinates (absolute, already accounting for scroll). Only valid within the current egui frame.
HexViewResponse
ValueGradient
Every byte value gets a unique colour from a fixed HSL hue wheel. Saturation and lightness are tuned per theme/mode so the resulting colours stay readable under the view’s fixed text contrast rules.

Enums§

HighlightPalette
Colour source for byte-value tinting. Plugins can hand a fully- specified 256-entry table via Self::Custom so a template run can override the user’s default palette for the duration.
ValueHighlight
Where the byte-value palette should be applied.

Type Aliases§

AddressFormatterFn
Formatter for address-column labels. Receives the offset of the row’s first byte and the width (in characters) the built-in address uses, returns the string to render. Default formats as uppercase zero-padded hex.
ByteStylerFn
Per-byte styler. Receives each byte’s value and absolute file offset and returns a ByteStyle. Consumers can use this to drive their own colour logic (search hits, struct-field overlays, diff colours, etc.) without subclassing the widget.
ColumnHeaderFormatterFn
Formatter for the column-header row above the hex/ascii panes. Receives the zero-based column index and returns its label. Default renders an uppercase hex digit.
ContextMenuFn
Callback type for context menu rendering – invoked on right-click anywhere in the hex or ASCII pane.