Browse Source

fix unicode bit indexing

main
Sam Blazes 2 years ago
parent
commit
333b8b1f37
  1. 260
      artspace.rs
  2. 8
      src/main.rs

260
artspace.rs

@ -1,132 +1,132 @@
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠗ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇ ⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃ ⣀⣾⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇ ⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃ ⢠⣾⣿⣿⣿⣿⣿*/
pub fn convert_bitmap_to_unicode(w: usize, h: usize, data: Vec<u8>) -> Vec<Vec<char>>/*⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠓ ⣈⣬⣿⣿⣿⣿⣿⣿⣿*/ pub fn convert_bitmap_to_unicode(w: usize, h: usize, data: Vec<u8>) -> Vec<Vec<char>>/*⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋ ⣠⣴⣿⣿⣿⣿⣿⣿⣿*/
{/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠓ ⢀⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⡿⠳⠁ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ {/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋ ⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⡷⠓ ⢀⣬⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋ ⢀⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿*/
/**/const CHARS: [&str; 4] = [/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠓ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⣈⣮⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠓ */ /**/const CHARS: [&str; 4] = [/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋ */
/*⣿⣿⣿⣿*/" ⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿",/* ⣈⣾⣿⣿⣿⣿⣿⣿⣿⡿⠓⠁ ⢀⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ */ /*⣿⣿⣿⣿*/" ⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿",/* ⣠⣾⣿⣿⣿⣿⣿⣿⣿⡿⠋⠁ ⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ */
/*⣿⣿⣿⣿*/"⡀⡁⡂⡃⡄⡅⡆⡇⡈⡉⡊⡋⡌⡍⡎⡏⡐⡑⡒⡓⡔⡕⡖⡗⡘⡙⡚⡛⡜⡝⡞⡟⡠⡡⡢⡣⡤⡥⡦⡧⡨⡩⡪⡫⡬⡭⡮⡯⡰⡱⡲⡳⡴⡵⡶⡷⡸⡹⡺⡻⡼⡽⡾⡿",/*⣾⣿⣿⣿⣿⣿⣿⣿⡿⠓ ⣈⣮⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ */ /*⣿⣿⣿⣿*/"⡀⡁⡂⡃⡄⡅⡆⡇⡈⡉⡊⡋⡌⡍⡎⡏⡐⡑⡒⡓⡔⡕⡖⡗⡘⡙⡚⡛⡜⡝⡞⡟⡠⡡⡢⡣⡤⡥⡦⡧⡨⡩⡪⡫⡬⡭⡮⡯⡰⡱⡲⡳⡴⡵⡶⡷⡸⡹⡺⡻⡼⡽⡾⡿",/*⣾⣿⣿⣿⣿⣿⣿⣿⡿⠋ ⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ */
/*⣿⣿⣿⣿*/"⢀⢁⢂⢃⢄⢅⢆⢇⢈⢉⢊⢋⢌⢍⢎⢏⢐⢑⢒⢓⢔⢕⢖⢗⢘⢙⢚⢛⢜⢝⢞⢟⢠⢡⢢⢣⢤⢥⢦⢧⢨⢩⢪⢫⢬⢭⢮⢯⢰⢱⢲⢳⢴⢵⢶⢷⢸⢹⢺⢻⢼⢽⢾⢿",/*⣿⣿⣿⣿⣿⣿⣿⠗ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ */ /*⣿⣿⣿⣿*/"⢀⢁⢂⢃⢄⢅⢆⢇⢈⢉⢊⢋⢌⢍⢎⢏⢐⢑⢒⢓⢔⢕⢖⢗⢘⢙⢚⢛⢜⢝⢞⢟⢠⢡⢢⢣⢤⢥⢦⢧⢨⢩⢪⢫⢬⢭⢮⢯⢰⢱⢲⢳⢴⢵⢶⢷⢸⢹⢺⢻⢼⢽⢾⢿",/*⣿⣿⣿⣿⣿⣿⣿⠏ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ */
/*⣿⣿⣿⣿*/"⣀⣁⣂⣃⣄⣅⣆⣇⣈⣉⣊⣋⣌⣍⣎⣏⣐⣑⣒⣓⣔⣕⣖⣗⣘⣙⣚⣛⣜⣝⣞⣟⣠⣡⣢⣣⣤⣥⣦⣧⣨⣩⣪⣫⣬⣭⣮⣯⣰⣱⣲⣳⣴⣵⣶⣷⣸⣹⣺⣻⣼⣽⣾⣿",/*⣿⣿⣿⣿⣿⠷⠁ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠳⠁ */ /*⣿⣿⣿⣿*/"⣀⣁⣂⣃⣄⣅⣆⣇⣈⣉⣊⣋⣌⣍⣎⣏⣐⣑⣒⣓⣔⣕⣖⣗⣘⣙⣚⣛⣜⣝⣞⣟⣠⣡⣢⣣⣤⣥⣦⣧⣨⣩⣪⣫⣬⣭⣮⣯⣰⣱⣲⣳⣴⣵⣶⣷⣸⣹⣺⣻⣼⣽⣾⣿",/*⣿⣿⣿⣿⣿⠟⠁ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁ */
/**/];/* ⢀⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⡿⠃ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠷⠑ */ /**/];/* ⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⡿⠃ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉ */
/**/let bitchars = CHARS.iter().flat_map(|t| t.chars()).collect::<Vec<_>>();/*⣿⠷ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠷⠑ */ /**/let bitchars = CHARS.iter().flat_map(|t| t.chars()).collect::<Vec<_>>();/*⣿⠟ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉ */
/*⣿⣿⣿⠿ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⢌ ⣼⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⢀⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠓⠁ ⢀*/ /*⣿⣿⣿⡟ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄ ⣼⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠁ ⢀*/
/**/let px = |i: usize, j: usize| if i < w && j < h {data[j * w + i]} else {0};/* ⢀⣬⣿⣿⣿⣿⣿⣿⣿⣿⡿⠓ ⢀⣬⣿*/ /**/let px = |i: usize, j: usize| if i < w && j < h {data[j * w + i]} else {0};/* ⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋ ⢀⣴⣿*/
/*⣿⠿ ⣨⣿⣿⣿⣿⣿⣿⣿⡿⠓ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯ ⣠⣿⣿⣿⣿⣿⣿⣿⠷ ⣀⣾⣿⣿⣿⣿⣿⣿⣿⣿⠗ ⣬⣿⣿⣿*/ /*⣿⡟ ⣰⣿⣿⣿⣿⣿⣿⣿⡿⠋ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷ ⢰⣿⣿⣿⣿⣿⣿⣿⠟ ⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣴⣿⣿⣿*/
/**/let mut output = vec![];/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢏ ⣿⣿⣿⣿⣿⣿⣿⠿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠌ ⣰⣿⣿⣿⣿*/ /**/let mut output = vec![];/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇ ⣿⣿⣿⣿⣿⣿⣿⡟ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⢸⣿⣿⣿⣿*/
/*⣿ ⣼⣿⣿⣿⣿⣿⣿⣿⠇ ⡰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣠⣿⣿⣿⣿⣿⣿⣿⠏ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⠈ ⣀⣿⣿⣿⣿⣿*/ /*⣿ ⣼⣿⣿⣿⣿⣿⣿⣿⠇ ⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⢰⣿⣿⣿⣿⣿⣿⣿⡇ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀ ⢠⣿⣿⣿⣿⣿*/
/**/for j in (0..h).step_by(4)/* ⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠌ ⣸⣿⣿⣿⣿⣿⣿⣿⠏ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⠈ ⢀⣿⣿⣿⣿⣿⣿*/ /**/for j in (0..h).step_by(4)/* ⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⣸⣿⣿⣿⣿⣿⣿⣿⡇ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀ ⢀⣿⣿⣿⣿⣿⣿*/
/**/{/* ⣼⣿⣿⣿⣿⣿⣿⣿⠟ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣿⣿⣿⣿⣿⣿⣿⣿⠇ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⢌ ⣰⣿⣿⣿⣿⣿⣿*/ /**/{/* ⣼⣿⣿⣿⣿⣿⣿⣿⡏ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⣿⣿⣿⣿⣿⣿⣿⣿⠇ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄ ⢸⣿⣿⣿⣿⣿⣿*/
/* */let mut line = vec![];/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣰⣿⣿⣿⣿⣿⣿⣿⣿ ⠰⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣎⢌ ⣷⣿⣿⣿⣿⣿*/ /* */let mut line = vec![];/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢸⣿⣿⣿⣿⣿⣿⣿⣿ ⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄ ⢿⣿⣿⣿⣿⣿*/
/* */for i in (0..w).step_by(2)/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⠱⡳⡷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⠈ ⠱⣷⣿⣿⣿*/ /* */for i in (0..w).step_by(2)/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⠙⠻⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀ ⠙⢿⣿⣿⣿*/
/* */{/*⣿⣿⣿⣿⣿⣿⣿⣿⠿ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⠑⠱⠳⡷⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎ ⠐⡳⣿*/ /* */{/*⣿⣿⣿⣿⣿⣿⣿⣿⡟ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⠉⠙⠛⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦ ⠈⠻⣿*/
/* */let mut index = 0;/* ⣳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⠐⠱⣷⣿⣿⣿⣿⣿⣿⣿⣿⣯ ⠐*/ /* */let mut index = 0;/* ⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⠈⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣷ ⠈*/
/* ⣸*/index |= if px(i+0, j+0) < 128 {0} else {1 << 0};/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⠱⣷⣿⣿⣿⣿⣿⣿⠷ */ /* ⣸*/index |= if px(i+0, j+0) < 128 {0} else {1 << 0};/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⠙⢿⣿⣿⣿⣿⣿⣿⠟ */
/* ⢀⣿*/index |= if px(i+0, j+1) < 128 {0} else {1 << 1};/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇ ⣳⣿⣿⣿⠷⠓ */ /* ⢀⣿*/index |= if px(i+0, j+1) < 128 {0} else {1 << 1};/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇ ⢻⣿⣿⣿⠟⠋ */
/* ⣸⣿*/index |= if px(i+0, j+2) < 128 {0} else {1 << 2};/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿ ⢈⣌⣬⣮⣮⣮⣎⣌⣌⣌⣌⣾⣿⡿⠁ */ /* ⣸⣿*/index |= if px(i+0, j+2) < 128 {0} else {1 << 2};/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿ ⣀⣤⣴⣶⣶⣶⣦⣤⣤⣤⣤⣾⣿⡿⠁ */
/* ⣀⣿⣿*/index |= if px(i+0, j+3) < 128 {0} else {1 << 3};/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⢀⣬⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢌ */ /* ⢠⣿⣿*/index |= if px(i+1, j+0) < 128 {0} else {1 << 3};/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⢀⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣄ */
/* ⣈⣿⣿⣿*/index |= if px(i+1, j+0) < 128 {0} else {1 << 4};/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⠗ ⣈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣌⠈ */ /* ⣠⣿⣿⣿*/index |= if px(i+1, j+1) < 128 {0} else {1 << 4};/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⡀ */
/* ⢀⣼⣿⣿⣿⣿*/index |= if px(i+1, j+1) < 128 {0} else {1 << 5};/*⣿⣿⣿⣿⣿⣿⣿⡿⠃ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⢌ */ /* ⢀⣼⣿⣿⣿⣿*/index |= if px(i+1, j+2) < 128 {0} else {1 << 5};/*⣿⣿⣿⣿⣿⣿⣿⡿⠃ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄ */
/*⢌⢈⣿⣿⣿⣿⣿⣿*/index |= if px(i+1, j+2) < 128 {0} else {1 << 6};/*⣿⣿⣿⣿⣿⣿⠷ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⡷⡷⡷⣿⣿⣿⣿⣿⣯⣎⢈ ⣴*/ /*⣄⣀⣿⣿⣿⣿⣿⣿*/index |= if px(i+0, j+3) < 128 {0} else {1 << 6};/*⣿⣿⣿⣿⣿⣿⠟ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠿⠿⣿⣿⣿⣿⣿⣷⣦⣀ ⢼*/
/*⣿⣿⣿⣿⣿⣿⣿⣿*/index |= if px(i+1, j+3) < 128 {0} else {1 << 7};/*⣿⣿⣿⣿⡷⠃ ⣨⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠓ ⠑⡳⣿⣿⣿⣿⣿⣿⣮⣮⣮⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿*/index |= if px(i+1, j+3) < 128 {0} else {1 << 7};/*⣿⣿⣿⣿⠿⠃ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋ ⠉⠻⣿⣿⣿⣿⣿⣿⣶⣶⣶⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿ ⠐⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠑ ⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠁ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟ ⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠉ ⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠁ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿*/line.push(bitchars[index]);/* ⠱⡷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⠳⠑ ⣈⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷ ⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿*/line.push(bitchars[index]);/* ⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉ ⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟ ⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿*/}/*⠟ ⣾⣿⣿⣿⣿⣿⣿⣿⣿⣎⠈ ⠐⠱⡷⣷⣿⡷⡷⠳⠑⠁ ⢀⣬⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿*/}/*⡏ ⣾⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀ ⠈⠙⠿⢿⣿⠿⠿⠛⠉⠁ ⢀⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿*/output.push(line);/*⣿⣿⣿⣿⣿⣿⣿⣿⣎⢌ ⢀⣌⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠗ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿*/output.push(line);/*⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄ ⢀⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/**/}/*⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⣌⢈⠈ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠳⠁ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /**/}/*⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣀⡀ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣮⣌⢈ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠷⠑ ⣀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣤⣀ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉ ⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/**/output/* ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⢌ ⠈⢀⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠑ ⢀⣬⣿⣿⣿⣿⣿⣿⣿⣿⡿⠷⠓⣳*/ /**/output/* ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄ ⡀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠉ ⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⢻*/
}/*⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠓⠑⠑⠑⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⠈ ⢀⡈⣚⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⠓ ⢈⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⠓ */ }/*⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠉⠉⠉⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀ ⢀⡠⣪⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋ ⣀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋ */
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⠐⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⠈ ⢈⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠳⠁ ⢈⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ */ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀ ⣀⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁ ⣀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ */
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠌ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⠟ ⠐⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⣌⢈⢈⢈⣌⣬⣮⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠓ ⢀⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ */ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⡏ ⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣤⣀⣀⣀⣤⣴⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋ ⢀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ */
fn read_jpeg_to_bitmap(file: &str) -> (usize, usize, Vec<u8>)/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⢀⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿ */ fn read_jpeg_to_bitmap(file: &str) -> (usize, usize, Vec<u8>)/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟ */
{/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠌ ⣷⣿⣿⣿⣿⣿⣿⠿ ⠱⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ */ {/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⢿⣿⣿⣿⣿⣿⣿⡟ ⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ */
/**/use zune_jpeg::zune_core::{colorspace::ColorSpace, options::DecoderOptions, bytestream::ZCursor};/*⣿⣿⣿⣿⣿⠁ */ /**/use zune_jpeg::zune_core::{colorspace::ColorSpace, options::DecoderOptions, bytestream::ZCursor};/*⣿⣿⣿⣿⣿⠁ */
/**/let data = std::fs::read(file).unwrap();/* ⣳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠁ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ */ /**/let data = std::fs::read(file).unwrap();/* ⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠁ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ */
/**/let options = DecoderOptions::default().jpeg_set_out_colorspace(ColorSpace::Luma);/*⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿ */ /**/let options = DecoderOptions::default().jpeg_set_out_colorspace(ColorSpace::Luma);/*⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿ */
/**/let mut decoder = zune_jpeg::JpegDecoder::new_with_options(ZCursor::new(&data), options);/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ */ /**/let mut decoder = zune_jpeg::JpegDecoder::new_with_options(ZCursor::new(&data), options);/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ */
/**/let pixels = decoder.decode().unwrap();/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠁ ⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁ */ /**/let pixels = decoder.decode().unwrap();/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠁ ⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁ */
/**/let (w, h) = decoder.dimensions().unwrap();/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠗ */ /**/let (w, h) = decoder.dimensions().unwrap();/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ */
/**/(w, h, pixels)/*⣯⣌⣌⣬⣾⣿⣿⣿⠎ ⢬⣭⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ */ /**/(w, h, pixels)/*⣷⣤⣤⣴⣾⣿⣿⣿⡆ ⣔⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ */
}/* ⠰⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⣐⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ */ }/* ⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⢨⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ */
/*⣯⠌ ⠐⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠈ ⣳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ */ /*⣷⡄ ⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡀ ⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ */
/*⣿⣿⠌ ⠐⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯ */ /*⣿⣿⡄ ⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷ */
fn main()/* ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁ ⡰⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠌ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ */ fn main()/* ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁ ⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ */
{/*⣿⣿⠏ ⣱⣿⣿⣿⣿⣿⣿⣿⠿ ⣳⣿⣿⣿⣿⣿⣿⣿⠿ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠌ ⣹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏ */ {/*⣿⣿⡇ ⢹⣿⣿⣿⣿⣿⣿⣿⡟ ⢻⣿⣿⣿⣿⣿⣿⣿⡟ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⣹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧ */
/**/match std::env::args().collect::<Vec<_>>().as_slice() {/*⣿⣿⣿⣿⣿⣿⣿⠌ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢎ */ /**/match std::env::args().collect::<Vec<_>>().as_slice() {/*⣿⣿⣿⣿⣿⣿⣿⡄ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆ */
/*⣿⣿⣿⣿*/[_, bitmap_file, source_file, output_file] =>/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢌ ⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢎ */ /*⣿⣿⣿⣿*/[_, bitmap_file, source_file, output_file] =>/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣄ ⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆ */
/*⣿⣿⣿⣿*/{/* ⠰⣿⣿⣿⣿⣿⣿⣿⣏ ⣨⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⠈ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣎⠈ */ /*⣿⣿⣿⣿*/{/* ⠘⣿⣿⣿⣿⣿⣿⣿⣧ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⡀ */
/*⣿⣿⣿⣿⣿ */let (w, h, pixels) = read_jpeg_to_bitmap(&bitmap_file);/*⣿⣿⣯⢌ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣎⣌⢌⢈⢈⢈⢈*/ /*⣿⣿⣿⣿⣿ */let (w, h, pixels) = read_jpeg_to_bitmap(&bitmap_file);/*⣿⣿⣷⣄ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣤⣄⣀⣀⣀⣀*/
/*⣿⣿⣿⣿⣿⠏ ⡰⣿⣿⣿⣿⣿⣿⣿⣿⣯⢌ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠑⠑⠑⠱⣷⣿⣿⣿⣿⣿⣿⣿⣯⢌ ⢀⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⡇ ⠸⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠉⠉⠉⠙⢿⣿⣿⣿⣿⣿⣿⣿⣷⣄ ⢀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿ */let char_bitmap = convert_bitmap_to_unicode(w, h, pixels);/*⣿⣿⣿⣯⣎⢈ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⠳⠳⠑⠑⠑⠑⠑⠑⠳⡳⡷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿ */let char_bitmap = convert_bitmap_to_unicode(w, h, pixels);/*⣿⣿⣿⣷⣦⣀ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠛⠉⠉⠉⠉⠉⠉⠛⠻⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⢏ ⠐⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⠱⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⠓ ⠑⠳⣷⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣇ ⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋ ⠉⠛⢿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⠌*/let source = std::fs::read_to_string(source_file).unwrap();/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⠐⠳⣷⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⡄*/let source = std::fs::read_to_string(source_file).unwrap();/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⠈⠛⢿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣯ ⡱⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎ ⡰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢏ ⡱⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠓ ⠐⠱⠳⡷*/ /*⣿⣿⣿⣿⣿⣿⣿⣷ ⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦ ⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇ ⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋ ⠈⠙⠛⠿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿*/let max_width = 120;/*⣏ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⠰⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ */ /*⣿⣿⣿⣿⣿⣿⣿⣿*/let max_width = 120;/*⣧ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ */
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⠈ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⠐⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ */ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ */
/*⣿⣿⣿⣿⣿⣿⣿⣿*/let mut modified_lines = vec![];/* ⠐⡳⣿⣿⣿⣿⣿⣿⣿⣿⠁ ⠱⡳⣿⣿⣿⣿⣿⣿⣿⡿⠓ ⢈⢈⢈⢈⢈⢈⢈⠈ */ /*⣿⣿⣿⣿⣿⣿⣿⣿*/let mut modified_lines = vec![];/* ⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⠁ ⠙⠻⣿⣿⣿⣿⣿⣿⣿⡿⠋ ⣀⣀⣀⣀⣀⣀⣀⡀ */
/*⣿⣿⣿⣿⣿⣿⣿⣿*/let mut buffer = Vec::with_capacity(1024);/*⣿⣿⣿⠿ ⠑⠱⠳⠳⠓⠁ ⢈⣌⣬⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⣌⠈ */ /*⣿⣿⣿⣿⣿⣿⣿⣿*/let mut buffer = Vec::with_capacity(1024);/*⣿⣿⣿⡟ ⠉⠙⠛⠛⠋⠁ ⣀⣤⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⡀ */
/*⣿⣿⣿⣿⣿⣿⣿⣿*/let mut row = 0;/*⣿⣿⣿⣿⣿⣿⣿⣿⣎ ⠐⠑⠑⠁ ⢀⣈⣮⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⢌⠈ */ /*⣿⣿⣿⣿⣿⣿⣿⣿*/let mut row = 0;/*⣿⣿⣿⣿⣿⣿⣿⣿⣦ ⠈⠉⠉⠁ ⢀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⡀ */
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⢏ ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏⠈ ⢀⢈⣌⣮⣮⣎⣌⢈ ⣈⣮⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮*/ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇ ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀ ⢀⣀⣤⣶⣶⣦⣤⣀ ⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶*/
/*⣿⣿⣿⣿⣿⣿⣿⣿*/for line in source.lines()/*⣿⢎ ⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⠈ ⢀⣬⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿*/for line in source.lines()/*⣿⣆ ⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀ ⢀⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿*/{/* ⢀⣜⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⢌ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⢌ ⢀⣈⣮⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⠷⠳⠳⠳⠳⠳⠳⠳⡷⡷⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿*/{/* ⢀⣬⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄ ⢀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠟⠛⠛⠛⠛⠛⠛⠛⠿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⡷⡷⡷⡷⣿⣿⣿⣿⣿⣿*/buffer.clear();/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⢌ ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⣮⣌⣬⣮⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠷⠓⠁ ⠐⠱⠳⡷⣿⣿⣿⣿*/ /*⣿⣿⠿⠿⠿⠿⣿⣿⣿⣿⣿⣿*/buffer.clear();/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄ ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣤⣴⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠁ ⠈⠙⠛⠿⣿⣿⣿⣿*/
/*⠓ ⠐⣷⣿⣿⣿⣿*/buffer.extend(line.chars());/*⣯⢌⠈ ⣨⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠑ ⠑⠱⠳*/ /*⠋ ⠈⢿⣿⣿⣿⣿*/buffer.extend(line.chars());/*⣷⣄⡀ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠉ ⠉⠙⠛*/
/* ⡳⣿⣿⣿*/if buffer.len() < max_width {/*⣿⣿⣮⢌⠈ ⣨⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⠳⠳⠑⠑⠳⡷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ */ /* ⠻⣿⣿⣿*/if buffer.len() < max_width {/*⣿⣿⣶⣄⡀ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠛⠉⠉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ */
/* ⠱⣷⣿⣿⣿⣿⣿*/let needed = max_width - buffer.len();/*⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⠐⠳⣷⣿⣿⣿⣿⣿⣿⣿⡿⠳⠁ */ /* ⠙⢿⣿⣿⣿⣿⣿*/let needed = max_width - buffer.len();/*⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁ */
/* ⠑⠑⠑ */buffer.extend(core::iter::repeat(' ').take(needed));/* ⠐⠱⠳⠳⠳⠳⠑ ⢈⣈⣌⣌⣬⣮⣎⣌⣌⢈ */ /* ⠉⠉⠉ */buffer.extend(core::iter::repeat(' ').take(needed));/* ⠈⠙⠛⠛⠛⠛⠉ ⣀⣠⣤⣤⣴⣶⣦⣤⣤⣀ */
/* */}/* ⠱⡷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠗ ⣈⣮⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣎⢌ */ /* */}/* ⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄ */
/* ⢈⣌⣬⣎⢌⠈ ⢈⢈⢈⢈⢈⢈⢈⠈ ⠐⠱⡷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⢌⠈ */ /* ⣀⣤⣴⣦⣄⡀ ⣀⣀⣀⣀⣀⣀⣀⡀ ⠈⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⡀ */
/*⣿⣿⣿⣿⣿⣿⣿⠌ */let mut i = 0;/*⣮⣎⣌⢈ ⠱⡳⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠁ ⢈⣌⣌⣌⠈ ⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⣌⢈⢈⢈*/ /*⣿⣿⣿⣿⣿⣿⣿⡄ */let mut i = 0;/*⣶⣦⣤⣀ ⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠁ ⣀⣤⣤⣤⡀ ⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣀⣀⣀*/
/*⣿⣿⣿⣿⣿⣿⣿⣿⢎ */for j in 0..buffer.len()/* ⠐⠱⡳⣷⣿⣿⣿⡿⠓ ⣈⣾⣿⣿⣿⣿⣿⣯⢌ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿⣆ */for j in 0..buffer.len()/* ⠈⠙⠻⢿⣿⣿⣿⡿⠋ ⣠⣾⣿⣿⣿⣿⣿⣷⣄ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣌⢈*/{/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣌⠈ ⠁ ⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⢈ ⢀⣬⣿⣿⣿⣿⣿⣿⣿⡿⠷⠳⠓⠑⠑⠑⠑⠑⠑⠱⡳⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣀*/{/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⡀ ⠁ ⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀ ⢀⣴⣿⣿⣿⣿⣿⣿⣿⡿⠟⠛⠋⠉⠉⠉⠉⠉⠉⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/if !buffer[j].is_whitespace()/* ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣎⣌⣌⣾⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/if !buffer[j].is_whitespace()/* ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣤⣤⣾⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⠳⠓⠑⠑⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/{/* ⠐⠱⠳⡷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⢌ ⣨⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⠰⣷⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⠛⠋⠉⠉⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/{/* ⠈⠙⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿*/
/* ⣳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟ */if j - i > 3/*⡷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⣌⢈ ⣈⣾⣿⣿⣿⣿⣿⡷⡷⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⠐⡳⣿⣿⣿⣿⣿⣿⣿*/ /* ⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏ */if j - i > 3/*⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣀ ⣠⣾⣿⣿⣿⣿⣿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⠈⠻⣿⣿⣿⣿⣿⣿⣿*/
/* ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ */{/* ⠐⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣎⢌⠈ ⢈⣬⣾⣿⣿⣿⣿⠷⠑ ⣱⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⠐⣳⣿⣿⣿⣿⣿*/ /* ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ */{/* ⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀ ⣀⣴⣾⣿⣿⣿⣿⠟⠉ ⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⠈⢻⣿⣿⣿⣿⣿*/
/* ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯ */let bmp_row = &char_bitmap[row];/*⣿⣿⣿⡿⠃ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⡱⣿⣿⣿⣿*/ /* ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷ */let bmp_row = &char_bitmap[row];/*⣿⣿⣿⡿⠃ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⠹⣿⣿⣿⣿*/
/* ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏ */for k in i..j {/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠁ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿ ⠰⣷⣿⣿*/ /* ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧ */for k in i..j {/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠁ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟ ⠘⢿⣿⣿*/
/* ⣨⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏ */buffer[k] = bmp_row[k % bmp_row.len()];/*⣰⣿⣿⣿⣿⣿⣿⣿⣿⠗ ⠐⣷⣿*/ /* ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧ */buffer[k] = bmp_row[k % bmp_row.len()];/*⢸⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⠈⢿⣿*/
/* ⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⠌ */}/* ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇ ⣿⣿⣿⣿⣿⣿⣿⣿⠿ ⣈⣌⢈ ⠐⡳*/ /* ⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄ */}/* ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇ ⣿⣿⣿⣿⣿⣿⣿⣿⡟ ⣠⣤⣀ ⠈⠻*/
/*⢀⣌⣾⣿⣿⣿⣿⠷⠑ ⠐⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢎ */buffer[i ] = '/';/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿ ⣰⣿⣿⣿⣿⣿⣿⣿⡿ ⣀⣾⣿⣿⣿⣯⠈ */ /*⢀⣤⣾⣿⣿⣿⣿⠟⠉ ⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆ */buffer[i ] = '/';/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿ ⢸⣿⣿⣿⣿⣿⣿⣿⡿ ⢠⣾⣿⣿⣿⣷⡀ */
/*⣿⣿⣿⣿⣿⠿⠁ ⣱⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎*/buffer[i+1] = '*';/*⣳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⣀⣿⣿⣿⣿⣿⣿⣿⠈ */ /*⣿⣿⣿⣿⣿⡟⠁ ⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦*/buffer[i+1] = '*';/*⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⢠⣿⣿⣿⣿⣿⣿⣿⡀ */
/*⣿⣿⣿⣿⠗ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/buffer[j-1] = '/';/*⡰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣠⣿⣿⣿⣿⣿⣿⣿⠿ ⣀⣿⣿⣿⣿⣿⣿⣿⣿⣏ */ /*⣿⣿⣿⣿⠏ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/buffer[j-1] = '/';/*⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢰⣿⣿⣿⣿⣿⣿⣿⡟ ⢠⣿⣿⣿⣿⣿⣿⣿⣿⣧ */
/*⣿⣿⣿⠿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/buffer[j-2] = '*';/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣰⣿⣿⣿⣿⣿⣿⣿⠇ ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⠎ */ /*⣿⣿⣿⡟ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/buffer[j-2] = '*';/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢸⣿⣿⣿⣿⣿⣿⣿⠇ ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⡆ */
/*⣿⣿⡿ ⣿⣿⣿⣿⣿⣿⣿*/}/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣸⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ */ /*⣿⣿⡿ ⣿⣿⣿⣿⣿⣿⣿*/}/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⣸⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ */
/*⣿⣿⠃ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣿⣿⣿⣿⣿⣿⣿⠿ ⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ */ /*⣿⣿⠃ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⣿⣿⣿⣿⣿⣿⣿⡟ ⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ */
/*⣿⠿ ⣿⣿⣿⣿⣿⣿⣿*/i = j + 1;/* ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣰⣿⣿⣿⣿⣿⣿⠏ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁ */ /*⣿⡟ ⣿⣿⣿⣿⣿⣿⣿*/i = j + 1;/* ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢸⣿⣿⣿⣿⣿⣿⡇ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁ */
/*⣿⠃ ⣠⣿⣿⣿*/}/*⣿⣿⣿⣿ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣿⣿⣿⣿⣿⣿⣿⠏ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ */ /*⣿⠃ ⢰⣿⣿⣿*/}/*⣿⣿⣿⣿ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⣿⣿⣿⣿⣿⣿⣿⡇ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ */
/*⣿⠈ */}/*⣿⣿⣿⣿⣿⣿⣿⣿⣏⠈ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣳⣿⣿⣿⣿⣿⣿⠏ ⡰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣌⢈ */ /*⣿⡀ */}/*⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢻⣿⣿⣿⣿⣿⣿⡇ ⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣤⣀ */
/*⣿⣯⠈ ⠐⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⠈ ⣳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⠰⣿⣿⣿⣿⣿⣿⣯⠈ ⠱⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⠈ */ /*⣿⣷⡀ ⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀ ⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⠘⣿⣿⣿⣿⣿⣿⣷⡀ ⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀ */
/*⣿⣿⣿⠌ */let j = buffer.len();/* ⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣷⣿⣿⣿⣿⣿⣿⣏ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢌ */ /*⣿⣿⣿⡄ */let j = buffer.len();/* ⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢿⣿⣿⣿⣿⣿⣿⣧ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣄ */
/*⣿⣿⣿⣿⠈ */if j - i > 3/*⣿⣿⣿⣎⠈ ⣳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣰⣿⣿⣿⣿⣿⣿⣿⢎ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠌ */ /*⣿⣿⣿⣿⡀ */if j - i > 3/*⣿⣿⣿⣦⡀ ⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢸⣿⣿⣿⣿⣿⣿⣿⣆ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄ */
/*⣿⣿⣿⣿⣏ */{/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⢈ ⠱⣷⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⠌ ⠐⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠯ */ /*⣿⣿⣿⣿⣧ */{/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀ ⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡗ */
/*⣿⣿⣿⣿⣿⢎ ⣰*/let bmp_row = &char_bitmap[row];/*⠱⣷⣿⣿⣿⣿⣿⠓ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⠈ ⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⢈⣬⣮⣿⣿*/ /*⣿⣿⣿⣿⣿⣆ ⢸*/let bmp_row = &char_bitmap[row];/*⠙⢿⣿⣿⣿⣿⣿⠋ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⡀ ⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ⣀⣴⣶⣿⣿*/
/*⣳⣿⣿⣿⣿⣿⣎⠈ ⢀⣀⣿*/for k in i..j {/*⣿⣿⣯⢌ ⠐⠳⠳⠳⠁ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯ ⠐⠳⣷⣿⣿⣿⣿⣿⠷⠁ ⢀⣬⣾⣿⣿⣿⣿⣿*/ /*⢻⣿⣿⣿⣿⣿⣦⡀ ⢀⢠⣿*/for k in i..j {/*⣿⣿⣷⣄ ⠈⠛⠛⠛⠁ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷ ⠈⠛⢿⣿⣿⣿⣿⣿⠟⠁ ⢀⣴⣾⣿⣿⣿⣿⣿*/
/* ⣿⣿⣿⣿⣿⣿⣿⣯⣌⢌⢈⣌⣬⣿⣿⣿⣿⣿⣿*/buffer[k] = bmp_row[k % bmp_row.len()];/* ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏ ⠑⠑⠁ ⣈⣾⣿⣿⣿⣿⣿⣿⣿*/ /* ⣿⣿⣿⣿⣿⣿⣿⣷⣤⣄⣀⣤⣴⣿⣿⣿⣿⣿⣿*/buffer[k] = bmp_row[k % bmp_row.len()];/* ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧ ⠉⠉⠁ ⣠⣾⣿⣿⣿⣿⣿⣿⣿*/
/*⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/}/*⠁ ⠑⠱⡷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⠈ ⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣨⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/}/*⠁ ⠉⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀ ⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/buffer[i ] = '/';/*⣿⣿⣿⣿⣿⣿⣎⢈ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠈ ⢈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/buffer[i ] = '/';/*⣿⣿⣿⣿⣿⣿⣦⣀ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡀ ⣀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿*/buffer[i+1] = '*';/*⣿⣿⣿⣿⣿⣿⣿⣿⣯⢌ ⣀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⢀⢈⣬⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿*/buffer[i+1] = '*';/*⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄ ⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢀⣀⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠓ */buffer[j-1] = '/';/*⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⢌⠈ ⢀⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏ ⣈⣮⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋ */buffer[j-1] = '/';/*⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⡀ ⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧ ⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟ */buffer[j-2] = '*';/* ⠐⠱⡷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⣎⣌⢈⢈ ⢀⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠌ ⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠑⠑⠱⣷⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏ */buffer[j-2] = '*';/* ⠈⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣦⣤⣀⣀ ⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠉⠉⠙⢿⣿⣿⣿⣿⣿*/
/* ⠱⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿*/}/* ⠐⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⠌ ⣰⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⣿⣿⣿⣿⣿*/ /* ⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/}/* ⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄ ⢸⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⣿⣿⣿⣿⣿*/
/* ⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏ ⢀⣈⣌⣌⣌⢈ ⠐⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠓⠑⠑⠑⠑⠳⡷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⠈ ⡰⣿⣿⣿⣿⣿⣿⣿⠃ ⣰⣿⣿⣿⣿*/ /* ⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧ ⢀⣠⣤⣤⣤⣀ ⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠉⠉⠉⠉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀ ⠸⣿⣿⣿⣿⣿⣿⣿⠃ ⢸⣿⣿⣿⣿*/
/* ⡱⣿⣿⣿⣿⣿⣿⣿*/modified_lines.push(buffer.iter().collect::<String>());/* ⠐⠱⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣎⠈ ⣳⣿⣿⣿⣿⣿⣿ ⣰⣿⣿⣿⣿*/ /* ⠹⣿⣿⣿⣿⣿⣿⣿*/modified_lines.push(buffer.iter().collect::<String>());/* ⠈⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀ ⢻⣿⣿⣿⣿⣿⣿ ⢸⣿⣿⣿⣿*/
/* ⣱⣿⣿⣿⣿⣿⣿*/row += 1;/* ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣯⠈ ⣳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢎ ⠐⣿⣿⣿⣿⣿⣿ ⣰⣿⣿⣿⣿*/ /* ⢹⣿⣿⣿⣿⣿⣿*/row += 1;/* ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀ ⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆ ⠈⣿⣿⣿⣿⣿⣿ ⢸⣿⣿⣿⣿*/
/* ⣿⣿⣿*/}/*⣿⣿ ⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏ ⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠓ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿ ⢀⣿⣿⣿⣿⣿⠏ ⣰⣿⣿⣿⣿*/ /* ⣿⣿⣿*/}/*⣿⣿ ⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧ ⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿ ⢀⣿⣿⣿⣿⣿⡇ ⢸⣿⣿⣿⣿*/
/* ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠎ ⠰⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⡈⣚⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⣰⣿⣿⣿⣿⣿⠁ ⠐⣿⣿⣿⣿*/ /* ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡆ ⠘⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⡠⣪⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⢸⣿⣿⣿⣿⣿⠁ ⠈⣿⣿⣿⣿*/
/* ⣀⣿⣿⣿⣿*/let new_source = modified_lines.join("\n");/*⠑ ⡀⣚⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠓ ⣾⣿⣿⣿⣿⣿ ⣰⣿⣿⣿⣿*/ /* ⢠⣿⣿⣿⣿*/let new_source = modified_lines.join("\n");/*⠉ ⠠⣪⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋ ⣾⣿⣿⣿⣿⣿ ⢸⣿⣿⣿⣿*/
/* ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟ ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠎ ⢀⣌⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠓ ⣸⣿⣿⣿⣿⣿⣿ ⣰⣿⣿⣿⣿*/ /* ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏ ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡆ ⢀⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋ ⣸⣿⣿⣿⣿⣿⣿ ⢸⣿⣿⣿⣿*/
/* ⣼⣿⣿⣿⣿⣿*/println!("{new_source}");/*⣿⣿⣿⣯ ⢀⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠓ ⣼⣿⣿⣿⣿⣿⣿⠿ ⣰⣿⣿⣿⣿*/ /* ⣼⣿⣿⣿⣿⣿*/println!("{new_source}");/*⣿⣿⣿⣷ ⢀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋ ⣼⣿⣿⣿⣿⣿⣿⡟ ⢸⣿⣿⣿⣿*/
/* ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠌ ⢈⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⠇ ⣰⣿⣿⣿⣿*/ /* ⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⣀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⠇ ⢸⣿⣿⣿⣿*/
/*⣀⣿⣿⣿⣿⣿⣿⣿*/std::fs::write(output_file, new_source).unwrap();/*⣌⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠳⠁ ⣈⣿⣿⣿⣿⣿⣿⣿⣿⡿ ⣰⣿⣿⣿⣿*/ /*⢠⣿⣿⣿⣿⣿⣿⣿*/std::fs::write(output_file, new_source).unwrap();/*⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁ ⣠⣿⣿⣿⣿⣿⣿⣿⣿⡿ ⢸⣿⣿⣿⣿*/
/*⣿⣿⣿⣿*/}/*⣿⣿⠟ ⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠎ ⢀⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠓ ⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿*/}/*⣿⣿⡏ ⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡆ ⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋ ⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿*/[path] =>/* ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏ ⣨⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠑ ⣀⣾⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⣠⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿*/[path] =>/* ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠉ ⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⢰⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿*/{/*⣿⠟ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⣀⣿⣿⣿⣿⣿⣿⣿⡿⠷⠓ ⣼⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿*/{/*⣿⡏ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⢠⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋ ⣼⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⣿*/println!("usage: {path} art.jpg input_src output_src");/*⣿⡿⠳⠁ ⡰⣷⡷⡷⠷⠳⠑⠁ ⣨⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⣿*/println!("usage: {path} art.jpg input_src output_src");/*⣿⡿⠛⠁ ⠸⢿⠿⠿⠟⠛⠉⠁ ⣰⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿*/}/*⠇ ⠑⠑ ⠐⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠌ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠓ ⣨⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿*/}/*⠇ ⠉⠉ ⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋ ⣰⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿*/_ =>/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠷ ⢀⣌⣬⣮⣾⣿⣿⣿⣿⣿⠌ ⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿*/_ =>/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟ ⢀⣤⣴⣶⣾⣿⣿⣿⣿⣿⡄ ⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿*/{/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⠰⣿⣿⣿⣿⣿⣿⣿⣿⠷⠁ ⢀⣬⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿*/{/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⠘⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⢀⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿*/}/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⣷⣿⣿⣿⣿⣿⠷⠁ ⢀⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢎ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿*/}/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⢿⣿⣿⣿⣿⣿⠟⠁ ⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/**/}/*⣿⣿ ⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⠱⠳⠳⠑ ⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢎ ⠱⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿*/ /**/}/*⣿⣿ ⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⠙⠛⠛⠉ ⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆ ⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿*/
/*⣿⣿⣿⣿⣿⣿⣿⠌ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠌ ⡳⡷⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏⠈ ⠑⡳⣷⣿⣿⣿⣿⣿⣿*/ /*⣿⣿⣿⣿⣿⣿⣿⡄ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀ ⠉⠻⢿⣿⣿⣿⣿⣿⣿*/
}/*⣿⣿⣿⣿⣿⣿⣯⠈ ⣈⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⠈ ⢀⢈⢈⢈ ⠑⠱⡳⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠌ ⠑⠳⡷⣿⣿⣿*/ }/*⣿⣿⣿⣿⣿⣿⣷⡀ ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀ ⢀⣀⣀⣀ ⠉⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⠉⠛⠿⣿⣿⣿*/

8
src/main.rs

@ -23,10 +23,10 @@ pub fn convert_bitmap_to_unicode(w: usize, h: usize, data: Vec<u8>) -> Vec<Vec<c
index |= if px(i+0, j+0) < 128 {0} else {1 << 0}; index |= if px(i+0, j+0) < 128 {0} else {1 << 0};
index |= if px(i+0, j+1) < 128 {0} else {1 << 1}; index |= if px(i+0, j+1) < 128 {0} else {1 << 1};
index |= if px(i+0, j+2) < 128 {0} else {1 << 2}; index |= if px(i+0, j+2) < 128 {0} else {1 << 2};
index |= if px(i+0, j+3) < 128 {0} else {1 << 3}; index |= if px(i+1, j+0) < 128 {0} else {1 << 3};
index |= if px(i+1, j+0) < 128 {0} else {1 << 4}; index |= if px(i+1, j+1) < 128 {0} else {1 << 4};
index |= if px(i+1, j+1) < 128 {0} else {1 << 5}; index |= if px(i+1, j+2) < 128 {0} else {1 << 5};
index |= if px(i+1, j+2) < 128 {0} else {1 << 6}; index |= if px(i+0, j+3) < 128 {0} else {1 << 6};
index |= if px(i+1, j+3) < 128 {0} else {1 << 7}; index |= if px(i+1, j+3) < 128 {0} else {1 << 7};
line.push(bitchars[index]); line.push(bitchars[index]);

Loading…
Cancel
Save