refactor bao-video to use ux-api

This commit is contained in:
bunnie 2025-02-02 07:02:53 +08:00
parent 25dfc4723d
commit c0822a6109
5 changed files with 8 additions and 5 deletions

View file

@ -14,6 +14,7 @@ num-derive = { version = "0.4.2", default-features = false }
num-traits = { version = "0.2.14", default-features = false }
cramium-hal = { path = "../../libs/cramium-hal", features = ["std"] }
cram-hal-service = { path = "../cram-hal-service" }
ux-api = { path = "../../libs/ux-api" }
# QR decoding
libm = { version = "0.2.8" }

View file

@ -1,4 +1,5 @@
use cramium_hal::{minigfx::*, sh1107::Mono};
use cramium_hal::sh1107::Mono;
use ux_api::minigfx::*;
// The discipline for all the APIs in this module are that they act on a FrameBuffer which is
// passed to the function. This allows us to bind the drawing computation on the caller-side of

View file

@ -1,9 +1,9 @@
use cramium_hal::iox::{IoxPort, IoxValue};
use cramium_hal::minigfx::*;
use cramium_hal::sh1107::{Mono, Oled128x128};
use cramium_hal::udma::PeriphId;
use num_traits::ToPrimitive;
use utralib::utra;
use ux_api::minigfx::*;
mod gfx;
mod homography;

View file

@ -1,4 +1,5 @@
use crate::Point;
use ux_api::minigfx::Point;
use crate::qr::*;
/// This function takes a fraction described as `m.n`, where n is a fraction out of 1024, as well

View file

@ -2,7 +2,7 @@ use core::cell::RefCell;
use core::convert::TryFrom;
use core::ops::{BitXor, Not};
use cramium_hal::minigfx::{ColorNative, FrameBuffer, Point};
use ux_api::minigfx::{ColorNative, FrameBuffer, Point};
use crate::gfx;
@ -26,7 +26,7 @@ pub const HOMOGRAPHY_MARGIN: isize = -4;
pub const CROSSHAIR_LEN: isize = 3;
pub fn draw_crosshair(image: &mut dyn FrameBuffer, p: Point) {
use cramium_hal::minigfx::Line;
use ux_api::minigfx::Line;
gfx::line(
image,
Line::new(p + Point::new(0, CROSSHAIR_LEN), p - Point::new(0, CROSSHAIR_LEN)),