Skip to content

trackforge / types


Module types

Common types used across the Trackforge library.

This module defines fundamental structures like BoundingBox.

Quick Reference

Item Kind Description
BoundingBox struct Axis-aligned bounding box in TLWH (top-left, width, height) format.

Types

BoundingBox

struct BoundingBox {
    pub x: f32,
    pub y: f32,
    pub width: f32,
    pub height: f32,
}

Axis-aligned bounding box in TLWH (top-left, width, height) format.

All coordinates are in pixels with the origin at the top-left corner of the image.

Fields

Name Type Description
x f32 Horizontal position of the top-left corner.
y f32 Vertical position of the top-left corner.
width f32 Width of the box.
height f32 Height of the box.

Implementations

fn new(x: f32, y: f32, width: f32, height: f32) -> Self

Create a bounding box from top-left corner coordinates plus dimensions.

Trait Implementations

impl Clone for BoundingBox

fn clone(&self) -> BoundingBox

impl Copy for BoundingBox
impl Debug for BoundingBox

fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result

impl PartialEq for BoundingBox

fn eq(&self, other: &BoundingBox) -> bool

impl Read<Exclusive, BecauseExclusive> for BoundingBox

fn to_subset(&self) -> Option<SS>

fn is_in_subset(&self) -> bool

fn to_subset_unchecked(&self) -> SS

fn from_subset(element: &SS) -> SP