diff --git a/core/embed/rust/src/ui/shape/drawlib-rust-objects.drawio.svg b/core/embed/rust/src/ui/shape/drawlib-rust-objects.drawio.svg index 972961e04..6adc2a52b 100644 --- a/core/embed/rust/src/ui/shape/drawlib-rust-objects.drawio.svg +++ b/core/embed/rust/src/ui/shape/drawlib-rust-objects.drawio.svg @@ -1,4 +1,4 @@ -

<<trait>>
Shape


+ bounds(&DrawingCache) -> Offset

+ draw(&mut dyn Canvas, &DrawingCache)
+ cleanup(&DrawingCache)


<<trait>>...

<<trait>>
ShapeClone


+ clone_at_pool(&LocalAllocExt) -> Option<&dyn Shape>

<<trait>>...

<<trait>>
Renderer


+ render_shape(Shape + ShapeClone)

+ viewport() -> Viewport


+ set_viewport(Viewport)
+ set_window(window: Rect) -> Viewport

+ set_clip(clip: Rect) -> Viewport


+ in_window(Rect, &dyn Fn(&mut Self))

+ in_clip(Rect, &dyn Fn(&mut Self))

+ with_origin(Rect, &dyn Fn(&mut Self))



<<trait>>...

<<struct>>
DirectRenderer


- canvas: &mut C: Canvas
- cache: DrawingCache


+ new(&mut C: Canvas, bg_color: Option<Color>, &DrawingCache)

<<struct>>...

<<struct>>
ProgressiveRenderer


- canvas: &mut C: BasicCanvas
- bump: &LocalAllocExt

- shapes: FixedVec<ShapeHolder>

- viewport: Viewport

- bg_color: Option<Color>

- cache: DrawingCache



+ new(&mug C: BasicCanvvas, bg_color: Option<Color>, &DrawingCavhas,  &LocalAllocExt, max_shapes: usize) -> Self
+ render(lines: usize)


<<struct>>...

<<struct>>
ShapeHolder


+ shape: &mut dyn Shape
+ viewport: Viewport


<<struct>>...
Relation
Relation
0..n
0..n
1
1

<<struct>>
DrawingCache



+ new() -> Self

+ zlib() -> RefMut<ZlibCache>

+ jpeg() -> RefMut<JpegCache>

+ blur() -> RefMut<BlurCache>

+ image_buff() -> Option<RefMut<ImageBuffRef>>

+ render_buff() -> Option<RefMut<RenderBuffRef>>


<<struct>>...
1
1
1
1

<<struct>>
Viewport


origin: Offset
clip: Rect


+ from_size(Offset) -> Self

+ contains(Rect) -> bool

+ translate(Offset) -> Viewport

+ with_origin(Offset) -> Viewport

+ absolute_clip(Rect) -> Viewport

+ relative_clip(Rect) -> Viewport

+ relative_window(Rect) -> Viewport


<<struct>>...
Extends
Extends
1
1
1
1

<<struct>>
ZlibCache


- slots: [ZlibCacheSlot]


+ new(&bump, slot_count: u32) -> Option<Self>

+ uncompress(zdata: &[u8], offset: usize, dest_buf: &mut [u8]) -> Result<bool, ())

<<struct>>...

<<struct>>
ZlibCacheSlot


- zdata_tag: *const u8

- offset: usize

- dc: Option<UzlibContext>


+ empty() -> Self

+ initialize(zdata: &[u8])

+ reset()

+ uncompress(dest_buf: &mut [u8]) 

+ skip(nbytes: usize)

+ is_for(zdata: & [u8]) -> bool


<<struct>>...

<<struct>>
JpegCache


- slots: [JpegCacheSlot]


+ new(&bump, slot_count: u32) -> Option<Self>

<<struct>>...

<<struct>>
JpegCacheSlot


- jpeg: & [u8]
- input: tjpgd::BufferInput

- decoder: tjpgd::JDEC


+ new(jpeg: &[u8]) -> Result<Self, Error>

+ jpeg_size() -> Offset

+ is_for(jpeg: &[u8]) -> bool


<<struct>>...
1
1
1
1
Relation
Relation
0..n
0..n
1
1
Relation
Relation
0..1
0..1
1
1

<<struct>>
BlurCache


- algo: Option<BlurAlgorithm>
buff: &UnsafeCell<BlurBuff>

- tag: u32


+ new(&bump)

+ get(size: Offset, radius: usize, tag: Option<u32>) -> Result<&mut BlurAlgorithm<'a>, u32), ()>

<<struct>>...

<<trait>>
BasicCanvas


size() -> Offset

bounds() -> Rect

width() -> i16

height() -> i16


+ viewport() -> Viewport

+ set_viewport(Viewport)

set_window(Rect) -> Viewport

set_clip(Rect) -> Viewport


fill_rect(Rect, Color)

fill_background(Color)

draw_bitmap(Rect, BitmapRef)







<<trait>>...

<<trait>>
Canvas


+ view() -> BitmapView


draw_pixel(Point, Color)

blend_pixel(Point, Color, u8)


blend_bitmap(Rect, BitmapView)

blur_rect(Rect, radius)


draw_round_rect(Rect, radius, Color)

fill_round_rect(Rect, radius, color)


draw_circle(Point, radius, Color)

fill_circle(Point, radius, Color)


+ fill_sector(Point, i16, i16, i16, Color)

<<trait>>...
Extends
Extends

<<struct>>
Rgb565Canvas


- bitmap: Bitmap

- viewport: Viewport


+ new(size: Offset, Option<i16>, &mut [u8]) -> Option<Self>

+ row_mut(row: i16) -> Option<&mut [u16])


<<struct>>...

<<struct>>
Rgba8888Canvas


bitmap: Bitmap

viewport: Viewport


new(size: Offset, Option<i16>, &mut [u8) -> Option<Self>

row_mut(row: i16) -> Option<&mut [u32])


<<struct>>...
Use
Use

<<struct>>
Bitmap


- ptr: *mut u8

- stride: usize

- size: Offset

- format: BitmapFormat

- mutable: bool

- dma_pending: bool


+ new(BitmapFormat, Option<usize>, Offset,  Option<i16>, & [u8]) -> Self

new_mut(BitmapFormat, Option<usize>, Offset,  Option<i16>, &mut  [u8]) -> Self


size() -> Offset

width() -> i16

height() -> i16

+ stride() -> usize

+ view() -> BitmapView


+ row<T>(i16) -> Option<&[T}>

+ row_mut<T>(i16) -> Option<&mut [T}>

+ rows_mut<T>(i16, i16) -> Option<&mut [T}>


+ rgb565_fill(Rect, Rect, Color)

+ rgb565_copy(Rect, Rect, &BitmapView)

+ rgb565_blend(Rect, Rect, &BitmapView)


rgba8888_fill(Rect, Rect, Color)

rgba8888_copy(Rect, Rect, &BitmapView)

rgba8888_blend(Rect, Rect, &BitmapView)


mono8_fill(Rect, Rect, Color)

mono8_copy(Rect, Rect, &BitmapView)

mono8_blend(Rect, Rect, &BitmapView)




<<struct>>...

<<struct>>
BitmapView


bitmap: &Bitmap

- fg_color: Color
- bg_color: Color

- offset: Offset



+ new(&Bitmap) -> Self

+ with_fg(Color) -> Self

with_bg(Color) -> Self

with_offset(Offset) -> Self


+ size() -> Offset

+ width() -> i16

+ height() -> i16

+ format() -> BitmapFormat

+ row<T>(i16) -> Option<&[T]>

<<struct>>...

<<struct>>
BitBlt = ffi::gl_bitblt_t


+ new_fill(Rect, Rect, color) -> Option<Self>

+ new_copy(Rect, Rect, &BitmapView)

+ with_dst(&Bitmap)


+ rgb565_fill()

rgb565_copy_mono4()

rgb565_copy_rgb565()

rgb565_blend_mono4()


rgba8888_fill()

rgba8888_copy_mono4()

rgba8888_copy_rgb565()

rgba8888_copy_rgba8888()

rgba8888_blend_mono4()


mono8_fill()

mono8_copy_mono1p()

mono8_copy_mono4()

mono8_blend_mono1p()

mono8_blend_mono4()




<<struct>>...
Shape objects
Shape objects

<<struct>>
shape::Bar


area: Rect

- fg_color: Option<Color>
- bg_color: Option<Color>

- thickness: i16

radius: i16


+ new(Rect) -> Self

+ with_fg(Color) -> Self

with_bg(Color) -> Self

with_radius(i16) -> Self

with_thickness(i16) -> Self


+ render(&mut impl Renderer)

<<struct>>...

<<struct>>
shape::Circle


center:  Point

- fg_color: Option<Color>
- bg_color: Option<Color>

- thickness: i16

radius: i16

- start_angle: Option<i16>

- end_angle: Option<i16>


+ new(center: Point,radius: i16) -> Self

+ with_fg(Color) -> Self

with_bg(Color) -> Self

with_thickness(i16) -> Self

+ with_start_angle(i16) -> Self

+ with_end_angle(i16) -> Self



+ render(&mut impl Renderer)

<<struct>>...

<<struct>>
shape::Text


area: Rect

text: &str

- color: Color

- font: Font


+ new(area: Rect, &str) -> Self

+ with_fg(Color) -> Self

with_font(Font) -> Self





+ render(&mut impl Renderer)

<<struct>>...

<<struct>>
shape::ToifImage


- pos: Point

- toif: Toif

- fg_color: Color

- bg_color: Option<Color>


+ new(area: Rect, Toif) -> Self

+ with_fg(Color) -> Self

with_bg(Color) -> Self





+ render(&mut impl Renderer)

<<struct>>...

<<struct>>
shape::JpegImage


- pos: Point

- jpeg: &[u8]

- scale: u8

- blur_radius: usize


+ new(area: Rect, &[u8]) -> Self

with_scale(u8) -> Self

with_blur(usize) -> Self





+ render(&mut impl Renderer)

<<struct>>...

<<struct>>
shape::QrCode


- area: Rect

- qr_modules: [u8; ..]

- qr_size: i16

- fg_color: Color

- bg_color: Option<Color>


+ new(pos: Point, &str) -> Self






+ render(&mut impl Renderer)

<<struct>>...

<<struct>>
shape::Blurring


- area: Rect

- radius: usize


+ new(area: Rect, usize) -> Self









+ render(&mut impl Renderer)

<<struct>>...
1
1

<<struct>>
Mono8Canvas


bitmap: Bitmap

viewport: Viewport


new(size: Offset, Option<i16>, &mut [u8) -> Option<Self>

row_mut(row: i16) -> Option<&mut [u32])


<<struct>>...
\ No newline at end of file +

<<trait>>
Shape


+ bounds(&DrawingCache) -> Offset

+ draw(&mut dyn Canvas, &DrawingCache)
+ cleanup(&DrawingCache)


<<trait>>...

<<trait>>
ShapeClone


+ clone_at_pool(&LocalAllocExt) -> Option<&dyn Shape>

<<trait>>...

<<trait>>
Renderer


+ render_shape(Shape + ShapeClone)

+ viewport() -> Viewport


+ set_viewport(Viewport)
+ set_window(window: Rect) -> Viewport

+ set_clip(clip: Rect) -> Viewport


+ in_window(Rect, &dyn Fn(&mut Self))

+ in_clip(Rect, &dyn Fn(&mut Self))

+ with_origin(Rect, &dyn Fn(&mut Self))



<<trait>>...

<<struct>>
DirectRenderer


- canvas: &mut C: Canvas
- cache: DrawingCache


+ new(&mut C: Canvas, bg_color: Option<Color>, &DrawingCache)

<<struct>>...

<<struct>>
ProgressiveRenderer


- canvas: &mut C: BasicCanvas
- bump: &LocalAllocExt

- shapes: FixedVec<ShapeHolder>

- viewport: Viewport

- bg_color: Option<Color>

- cache: DrawingCache



+ new(&mug C: BasicCanvvas, bg_color: Option<Color>, &DrawingCavhas,  &LocalAllocExt, max_shapes: usize) -> Self
+ render(lines: usize)


<<struct>>...

<<struct>>
ShapeHolder


+ shape: &mut dyn Shape
+ viewport: Viewport


<<struct>>...
Relation
Relation
0..n
0..n
1
1

<<struct>>
DrawingCache



+ new() -> Self

+ zlib() -> RefMut<ZlibCache>

+ jpeg() -> RefMut<JpegCache>

+ blur() -> RefMut<BlurCache>

+ image_buff() -> Option<RefMut<ImageBuffRef>>

+ render_buff() -> Option<RefMut<RenderBuffRef>>


<<struct>>...
1
1
1
1

<<struct>>
Viewport


origin: Offset
clip: Rect


+ from_size(Offset) -> Self

+ contains(Rect) -> bool

+ translate(Offset) -> Viewport

+ with_origin(Offset) -> Viewport

+ absolute_clip(Rect) -> Viewport

+ relative_clip(Rect) -> Viewport

+ relative_window(Rect) -> Viewport


<<struct>>...
Extends
Extends
1
1
1
1

<<struct>>
ZlibCache


- slots: [ZlibCacheSlot]


+ new(&bump, slot_count: u32) -> Option<Self>

+ uncompress(zdata: &[u8], offset: usize, dest_buf: &mut [u8]) -> Result<bool, ())

<<struct>>...

<<struct>>
ZlibCacheSlot


- zdata_tag: *const u8

- offset: usize

- dc: Option<UzlibContext>


+ empty() -> Self

+ initialize(zdata: &[u8])

+ reset()

+ uncompress(dest_buf: &mut [u8]) 

+ skip(nbytes: usize)

+ is_for(zdata: & [u8]) -> bool


<<struct>>...

<<struct>>
JpegCache


- slots: [JpegCacheSlot]


+ new(&bump, slot_count: u32) -> Option<Self>

<<struct>>...

<<struct>>
JpegCacheSlot


- jpeg: & [u8]
- input: tjpgd::BufferInput

- decoder: tjpgd::JDEC


+ new(jpeg: &[u8]) -> Result<Self, Error>

+ jpeg_size() -> Offset

+ is_for(jpeg: &[u8]) -> bool


<<struct>>...
1
1
1
1
Relation
Relation
0..n
0..n
1
1
Relation
Relation
0..1
0..1
1
1

<<struct>>
BlurCache


- algo: Option<BlurAlgorithm>
buff: &UnsafeCell<BlurBuff>

- tag: u32


+ new(&bump)

+ get(size: Offset, radius: usize, tag: Option<u32>) -> Result<&mut BlurAlgorithm<'a>, u32), ()>

<<struct>>...

<<trait>>
BasicCanvas


size() -> Offset

bounds() -> Rect

width() -> i16

height() -> i16


+ viewport() -> Viewport

+ set_viewport(Viewport)

set_window(Rect) -> Viewport

set_clip(Rect) -> Viewport


fill_rect(Rect, Color)

fill_background(Color)

draw_bitmap(Rect, BitmapRef)







<<trait>>...

<<trait>>
Canvas


+ view() -> BitmapView


draw_pixel(Point, Color)

blend_pixel(Point, Color, u8)


blend_bitmap(Rect, BitmapView)

blur_rect(Rect, radius)


draw_round_rect(Rect, radius, Color)

fill_round_rect(Rect, radius, color)


draw_circle(Point, radius, Color)

fill_circle(Point, radius, Color)


+ fill_sector(Point, i16, i16, i16, Color)

<<trait>>...
Extends
Extends

<<struct>>
Rgb565Canvas


- bitmap: Bitmap

- viewport: Viewport


+ new(size: Offset, Option<i16>, &mut [u8]) -> Option<Self>

+ row_mut(row: i16) -> Option<&mut [u16])


<<struct>>...

<<struct>>
Rgba8888Canvas


bitmap: Bitmap

viewport: Viewport


new(size: Offset, Option<i16>, &mut [u8) -> Option<Self>

row_mut(row: i16) -> Option<&mut [u32])


<<struct>>...
Use
Use

<<struct>>
Bitmap


- ptr: *mut u8

- stride: usize

- size: Offset

- format: BitmapFormat

- mutable: bool

- dma_pending: bool


+ new(BitmapFormat, Option<usize>, Offset,  Option<i16>, & [u8]) -> Self

new_mut(BitmapFormat, Option<usize>, Offset,  Option<i16>, &mut  [u8]) -> Self


size() -> Offset

width() -> i16

height() -> i16

+ stride() -> usize

+ view() -> BitmapView


+ row<T>(i16) -> Option<&[T}>

+ row_mut<T>(i16) -> Option<&mut [T}>

+ rows_mut<T>(i16, i16) -> Option<&mut [T}>


+ rgb565_fill(Rect, Rect, Color)

+ rgb565_copy(Rect, Rect, &BitmapView)

+ rgb565_blend(Rect, Rect, &BitmapView)


rgba8888_fill(Rect, Rect, Color)

rgba8888_copy(Rect, Rect, &BitmapView)

rgba8888_blend(Rect, Rect, &BitmapView)


mono8_fill(Rect, Rect, Color)

mono8_copy(Rect, Rect, &BitmapView)

mono8_blend(Rect, Rect, &BitmapView)




<<struct>>...

<<struct>>
BitmapView


bitmap: &Bitmap

- fg_color: Color
- bg_color: Color

- offset: Offset



+ new(&Bitmap) -> Self

+ with_fg(Color) -> Self

with_bg(Color) -> Self

with_offset(Offset) -> Self


+ size() -> Offset

+ width() -> i16

+ height() -> i16

+ format() -> BitmapFormat

+ row<T>(i16) -> Option<&[T]>

<<struct>>...

<<struct>>
BitBltFill


+ new(Rect, Rect, color) -> Option<Self>


+ rgb565_fill(dst: &Bitmap)

rgba8888_fill(dst: &Bitmap)

mono8_fill(dst: &Bitmap)

+ display_fill(dst: &Bitmap)




<<struct>>...
Shape objects
Shape objects

<<struct>>
shape::Bar


area: Rect

- fg_color: Option<Color>
- bg_color: Option<Color>

- thickness: i16

radius: i16


+ new(Rect) -> Self

+ with_fg(Color) -> Self

with_bg(Color) -> Self

with_radius(i16) -> Self

with_thickness(i16) -> Self


+ render(&mut impl Renderer)

<<struct>>...

<<struct>>
shape::Circle


center:  Point

- fg_color: Option<Color>
- bg_color: Option<Color>

- thickness: i16

radius: i16

- start_angle: Option<i16>

- end_angle: Option<i16>


+ new(center: Point,radius: i16) -> Self

+ with_fg(Color) -> Self

with_bg(Color) -> Self

with_thickness(i16) -> Self

+ with_start_angle(i16) -> Self

+ with_end_angle(i16) -> Self



+ render(&mut impl Renderer)

<<struct>>...

<<struct>>
shape::Text


area: Rect

text: &str

- color: Color

- font: Font


+ new(area: Rect, &str) -> Self

+ with_fg(Color) -> Self

with_font(Font) -> Self





+ render(&mut impl Renderer)

<<struct>>...

<<struct>>
shape::ToifImage


- pos: Point

- toif: Toif

- fg_color: Color

- bg_color: Option<Color>


+ new(area: Rect, Toif) -> Self

+ with_fg(Color) -> Self

with_bg(Color) -> Self





+ render(&mut impl Renderer)

<<struct>>...

<<struct>>
shape::JpegImage


- pos: Point

- jpeg: &[u8]

- scale: u8

- blur_radius: usize


+ new(area: Rect, &[u8]) -> Self

with_scale(u8) -> Self

with_blur(usize) -> Self





+ render(&mut impl Renderer)

<<struct>>...

<<struct>>
shape::QrCode


- area: Rect

- qr_modules: [u8; ..]

- qr_size: i16

- fg_color: Color

- bg_color: Option<Color>


+ new(pos: Point, &str) -> Self






+ render(&mut impl Renderer)

<<struct>>...

<<struct>>
shape::Blurring


- area: Rect

- radius: usize


+ new(area: Rect, usize) -> Self









+ render(&mut impl Renderer)

<<struct>>...
1
1

<<struct>>
Mono8Canvas


bitmap: Bitmap

viewport: Viewport


new(size: Offset, Option<i16>, &mut [u8) -> Option<Self>

row_mut(row: i16) -> Option<&mut [u32])


<<struct>>...

<<struct>>
BitBltCopy


+ new_copy(Rect, Rect, &BitmapView)


rgb565_copy(dst: &Bitmap)

rgb565_blend(dst: &Bitmap)


rgba8888_copy(dst: &Bitmap)

rgba8888_blend_mono4(dst: &Bitmap)


mono8_copy(dst: &Bitmap)

mono8_blend(dst: &Bitmap)


+ display_copy()




<<struct>>...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/core/embed/rust/src/ui/shape/drawlib-toplevel-arch.drawio.svg b/core/embed/rust/src/ui/shape/drawlib-toplevel-arch.drawio.svg index 05e7faaee..fc0ae12ca 100644 --- a/core/embed/rust/src/ui/shape/drawlib-toplevel-arch.drawio.svg +++ b/core/embed/rust/src/ui/shape/drawlib-toplevel-arch.drawio.svg @@ -1,4 +1,4 @@ -
SHAPE
SHAPE
RENDERER
RENDERER
CANVAS
CANVAS
BitBlt (bitblt.rs)

2D bit-block transfer routines 
(Rust API)
BitBlt (bitblt.rs)...
gl_bitblt

2D bit-block transfer routines
(C API)
gl_bitblt...
dma2d_bitblt

Hardware accelerated bitblt operations
dma2d_bitblt...
display_driver

Display initialization, framebuffer implementation, backlight, orientation, synchronization

display_driver...
Bit-blt API
for simple access or non-fb drivers
Bit-blt API...
gl_draw

Simple drawing routines
(C API)
gl_draw...
Canvas
Canvas
BasicCanvas
BasicCanvas
LIB
(C)
LIB...
HAL
(C)
HAL...
TrezorHal (RUST)
TrezorH...
High-level abstraction for drawing implements simple objects (such as BarCircleImageToifImageJpeg) that can be renderered on the display through the lower layer. 
High-level abstraction for drawing implements simple objects (such as Bar, C...
Provides two distinguished mechanisms for rendering shape on the display: DirectRenderer for drawing using display drivers exposing framebuffer, and ProgressiveRenderer for drawing on displays without framebuffer in MCU RAM providing just simple bit-blt operations.
Provides two distinguished mechanisms for rendering shape on the display: Dire...
Several implementations of the Canvas trait (Rgb565Canvas, RGBA8888Canvas, Mono8Canvas) for different types of framebuffers/displays.
Several implementations of the Canvas trait (Rgb565Canvas, RGBA8888Canvas...
direct drawing without rust lib
direct drawing without rust...
UI (RUST)
UI (RUS...
\ No newline at end of file +
SHAPE
SHAPE
RENDERER
RENDERER
CANVAS
CANVAS
BitBlt (bitblt.rs)

2D bit-block transfer routines 
(Rust API)
BitBlt (bitblt.rs)...
gfx_bitblt

2D bit-block transfer routines
(C API)
gfx_bitblt...
dma2d_bitblt

Hardware accelerated bitblt operations
dma2d_bitblt...
display_driver

Display initialization, framebuffer implementation, backlight, orientation, synchronization

display_driver...
Bit-blt API
for simple access or non-fb drivers
Bit-blt API...
gfx_draw

Simple drawing routines
(C API)
gfx_draw...
Canvas
Canvas
BasicCanvas
BasicCanvas
LIB
(C)
LIB...
HAL
(C)
HAL...
TrezorHal (RUST)
TrezorH...
High-level abstraction for drawing implements simple objects (such as BarCircleImageToifImageJpeg) that can be renderered on the display through the lower layer. 
High-level abstraction for drawing implements simple objects (such as Bar, C...
Provides two distinguished mechanisms for rendering shape on the display: DirectRenderer for drawing using display drivers exposing framebuffer, and ProgressiveRenderer for drawing on displays without framebuffer in MCU RAM providing just simple bit-blt operations.
Provides two distinguished mechanisms for rendering shape on the display: Dire...
Several implementations of the Canvas trait (Rgb565Canvas, RGBA8888Canvas, Mono8Canvas) for different types of framebuffers/displays.
Several implementations of the Canvas trait (Rgb565Canvas, RGBA8888Canvas...
direct drawing without rust lib
direct drawing without rust...
UI (RUST)
UI (RUS...
Text is not SVG - cannot display
\ No newline at end of file