@@ -15,7 +15,21 @@ written in RUST.
1515- Supports LVGL binary format
1616- Supports preview a wide range of image formats and LVGL binary format
1717
18- # How to build
18+ # How to install
19+
20+ ICU is written in RUST, so you need to have the RUST environment installed on your system.
21+
22+ ``` shell
23+ curl --proto ' =https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
24+ ```
25+
26+ After that, you can install ICU by running the following command:
27+
28+ ``` shell
29+ cargo install icu_tool
30+ ```
31+
32+ # How to build yourself
1933
2034``` shell
2135cargo build --release
@@ -60,58 +74,3 @@ icu show res/img_0.bin -f lvgl-v9
6074
6175And you will get a window with the image like before.
6276
63- # How to use
64-
65- ``` rust
66- use icu_lib :: endecoder :: {common, lvgl_v9};
67- use icu_lib :: midata :: MiData ;
68- use icu_lib :: EncoderParams ;
69- use std :: fs;
70-
71- fn main () {
72- const DATA : & [u8 ] = include_bytes! (" ../res/img_0.png" );
73-
74- // Decode the image data and automatically detect the format
75- let mid = MiData :: decode_from :: <common :: AutoDectect >(Vec :: from (DATA ));
76-
77- // Encode the image data to the LVGL binary format with ARGB8888 color format
78- let data = mid . encode_into :: <lvgl_v9 :: ColorFormatARGB8888 >(
79- EncoderParams {
80- stride_align : 256 ,
81- dither : false ,
82- });
83-
84- fs :: write (" img_0.bin" , data ). expect (" Unable to write file" );
85- }
86- ```
87-
88- # Architecture
89-
90- ``` text
91- βββββββββββββββββ
92- β β
93- β β
94- β β β β β β β β β
95- β β β β β β β
96- β EnDecoder β βΌ
97- β β β β β β β β β β β β β β
98- βββββββββββββββ β β β β β β
99- β PNG β β MidData β
100- βββββββββββββββ β β β β β β
101- βββββββββββββ βββββββββββββββ
102- ββ JPEG ββ β ARGB β
103- βββββββββββββ βββββββββββββββ β-------------β
104- βββββββββββββββ βββββββββββββ β ICU_LIB β
105- β SVG β ββ PATH ββ β-------------β
106- βββββββββββββββ βββββββββββββ
107- βββββββββββββ ββββ βββ βββ ββ
108- ββ LVGL BIN ββ CUSTOM β
109- βββββββββββββ ββββ βββ βββ ββ
110- ββββ βββ βββ ββ β β β β β β β
111- CUSTOM β β
112- ββββ βββ βββ ββ β
113- β β β β β β β β
114- β² β
115- β β
116- βββββββββββββββββ
117- ```
0 commit comments