NBT2QCONKZ2E5I7HIQJUNQAUNJA6RPYYTUVZQCT6Z6ABU42A277AC XTYFIHM6F5QCIGESYIWC5PLHKKA3JE5XZAXTPILYZTSGVMOU7BCAC ALRSGGIYO2DYI7QMBE5HRMBYTZKPIJ6UKVDI5LCKMN4SVZE3K4DQC 3MJHVTOTVPO6KYWXVKALETNOZBHQ3XSI3SDUWIPHGWP5ZITQL4KAC KLGRQAFUQPJP75NVLS5MZZ3CY4TGNVGB4K2YHQSLYVGAPKCLBLUAC 2NFFH775XBXGXBJYGTGUAUH45T5ZI6FFJXHFGUQQS324XEAFKT7AC I3F42XELTBNGNFJGKEDBRYU75HHQX2CHMWPEIEMXAGU2FFHQVHKAC NOSXMSCMJV75LYKAIRD4FG4LFPYQ4CI5SIKGQC7MEYUEAB7X7NWAC TWBSX7IMMGO6G6CEEMPQZHBVDG4XHDMHL6FEAKOH34ILJJNMRUIQC RBDTDLSVTRYZYKAVDPMBTDL6W45H4ZHRB3XZTXBASOI4VCOTRS6QC SDFC64IQZWAAG36UV4GVSAER5S3FISBQEE2NVGI4G6ODD6CCGBIAC FJVNPRZD2CQHHDZMFTPW57J3QR3HOF7B5ONBDTPGRBGNJOXU36WAC 5S34ANJMEKYNSGROMFRDP22UA2FK2ENSGOBB4MPSHS7PG2BW6DLAC B5TJA6MYFWB6PLH4KGQO5D42QHUZUWC627OKENXP6HBD6PG37ECQC EGIP2DL3KS6L3H6N7SMSTTNTZQECHFZPX3WL7KSU2KOC7V2RLS4QC YR6S4ANJ34M45KU6BU5RRJWI5AW5SSFPCDLH4KUO55DICUK5LQ4QC PTQ26KY65NDVZ35EG66SARWRGGYKDJ2BT3EVK4RJFS2J5AQUX6OQC #[inline]#[allow(clippy::too_many_arguments)]fn rasterize_segment(&mut self,buf: &mut [u8],size: (u32, u32),font: FontIndex,glyph_buffer: &GlyphBuffer,upe: i32,font_size: u32,color: [u8; 4],pos: &mut (usize, usize),) {let fs = font_size as i32;for i in 0..glyph_buffer.len() {let ginfo = glyph_buffer.glyph_infos()[i];let gpos = glyph_buffer.glyph_positions()[i];let (metrics, data) = self.rasterize_glyph(font, ginfo.glyph_id as u16, font_size);let x_off = gpos.x_offset * fs / upe + metrics.xmin;let y_off = gpos.y_offset * fs / upe - metrics.ymin - metrics.height as i32;for row in 0..metrics.height {for column in 0..metrics.width {let x = pos.0 + x_off as usize + column;let y = pos.1 + y_off as usize + row;let bidx = (x + y * size.0 as usize) * 4;let sidx = column + row * metrics.width;if bidx >= buf.len() {break;}if x > size.0 as usize {break;}for i in 0..3 {let m = data[sidx] as u32;let d = buf[bidx + i] as u32;let s = color[i] as u32;let res = (d * (255 - m) + s * m) / 255;buf[bidx + i] = res as u8;}buf[bidx + 3] = 255;}}pos.0 += (gpos.x_advance * fs / upe) as usize;pos.1 += (gpos.y_advance * fs / upe) as usize;}}
fn draw_background<T: Iterator<Item = usize> + Clone, U: Iterator<Item = usize>>(buf: &mut [u8],x: T,y: U,size: (u32, u32),color: [u8; 4],) {for i in y {for j in x.clone() {if j >= size.0 as usize {
fn draw_background(&mut self, x: usize, y: usize, w: usize, h: usize, color: [u8; 4]) {let buf = self.pixels.frame_mut();for i in y..(y + h) {for j in x..(x + w) {if j >= self.size.0 {
}}}#[allow(clippy::too_many_arguments)]fn rasterize_segment(&mut self,font: FontIndex,glyph_buffer: &GlyphBuffer,color: [u8; 4],pos: &mut (usize, usize),) {let fs = self.font_size as i32;let upe = self.shaper.fonts[font].1.units_per_em();let buf = self.pixels.frame_mut();for i in 0..glyph_buffer.len() {let ginfo = glyph_buffer.glyph_infos()[i];let gpos = glyph_buffer.glyph_positions()[i];let (metrics, data) =self.rasterizer.rasterize_glyph(font, ginfo.glyph_id as u16, self.font_size);let x_off = gpos.x_offset * fs / upe + metrics.xmin;let y_off = gpos.y_offset * fs / upe - metrics.ymin - metrics.height as i32;for row in 0..metrics.height {for column in 0..metrics.width {let x = (pos.0 as i32 + x_off) as usize + column;let y = (pos.1 as i32 + y_off) as usize + row;let bidx = (x + y * self.size.0) * 4;let sidx = column + row * metrics.width;if bidx >= buf.len() {break;}if x > self.size.0 {break;}for i in 0..3 {let m = data[sidx] as u32;let d = buf[bidx + i] as u32;let s = color[i] as u32;let res = (d * (255 - m) + s * m) / 255;buf[bidx + i] = res as u8;}buf[bidx + 3] = 255;}
let run_length = run_length(glyph_buffer, *upe, self.font_size as i32);Self::draw_background(self.pixels.frame_mut(),pos.0..(pos.0 + run_length as usize),(pos.1 - line_height + 4)..(pos.1 + 4),self.size,
let run_length = run_length(glyph_buffer, upe, self.font_size);self.draw_background(pos.0,pos.1 - line_height + 4,run_length as usize,line_height,
self.rasterizer.rasterize_segment(self.pixels.frame_mut(),self.size,*font,glyph_buffer,*upe,self.font_size,fg,&mut pos,);
self.rasterize_segment(*font, glyph_buffer, fg, &mut pos);
for (face, font, upe, glyph_buffer) in self.shaper.make_runs(ui.prompt_line.clone()) {
for (face, font, glyph_buffer) in self.shaper.make_runs(ui.prompt_line.clone()).iter() {let upe = self.shaper.fonts[*font].1.units_per_em();
let run_length = run_length(glyph_buffer, *upe, self.font_size as i32);Self::draw_background(self.pixels.frame_mut(),pos.0..(pos.0 + run_length as usize),(pos.1 - line_height + 4)..(pos.1 + 4),self.size,
let run_length = run_length(glyph_buffer, upe, self.font_size);self.draw_background(pos.0,pos.1 - line_height + 4,run_length as usize,line_height,
self.rasterizer.rasterize_segment(self.pixels.frame_mut(),self.size,*font,glyph_buffer,*upe,self.font_size,fg,&mut pos,);
self.rasterize_segment(*font, glyph_buffer, fg, &mut pos);
pos.0 = self.size.0 as usize - text_width as usize;for (face, font, upe, glyph_buffer) in mode_line {
pos.0 = self.size.0.saturating_sub(text_width as usize);for (face, font, glyph_buffer) in mode_line.iter() {let upe = self.shaper.fonts[*font].1.units_per_em();
let run_length = run_length(glyph_buffer, *upe, self.font_size as i32);Self::draw_background(self.pixels.frame_mut(),pos.0..(pos.0 + run_length as usize),(pos.1 - line_height + 4)..(pos.1 + 4),self.size,
let run_length = run_length(glyph_buffer, upe, self.font_size);self.draw_background(pos.0,pos.1 - line_height + 4,run_length as usize,line_height,
self.rasterizer.rasterize_segment(self.pixels.frame_mut(),self.size,*font,glyph_buffer,*upe,self.font_size,fg,&mut pos,);
self.rasterize_segment(*font, glyph_buffer, fg, &mut pos);}let info_padding_x: usize = 5;let info_padding_y: usize = 5;for info in &ui.infos {let mut runss = Vec::new();for line in &info.content {runss.push(self.shaper.make_runs(line.clone()));}let width = runss.iter().map(|run| {run.iter().map(|(_, font, glyph_buffer)| {let upe = self.shaper.fonts[*font].1.units_per_em();run_length(glyph_buffer, upe, self.font_size)}).sum::<i32>()}).max().unwrap_or(0) as usize+ info_padding_x * 2;let height = line_height * info.content.len() + info_padding_y * 2;let info_bg = info.face.bg.to_rgba(config).unwrap_or(default_bg);match info.style {InfoShowStyle::Prompt => {pos.0 = self.size.0.saturating_sub(width);pos.1 = self.size.1.saturating_sub(height + line_height + status_padding);}InfoShowStyle::Modal => {pos.0 = (self.size.0.saturating_sub(width)) / 2;pos.1 = (self.size.1.saturating_sub(height)) / 2;}_ => {}}self.draw_background(pos.0, pos.1, width, height, info_bg);let start = pos.0 + info_padding_x;pos.1 += info_padding_y;for run in runss {pos.0 = start;pos.1 += line_height;for (face, font, glyph_buffer) in run.iter() {let upe = self.shaper.fonts[*font].1.units_per_em();if let Some(bg) = face.bg.to_rgba(config) {let run_length = run_length(glyph_buffer, upe, self.font_size);self.draw_background(pos.0,pos.1 - line_height + 4,run_length as usize,line_height,bg,);}let fg = info.face.fg.to_rgba(config).unwrap_or(info.face.fg.to_rgba(config).unwrap_or(default_fg));self.rasterize_segment(*font, glyph_buffer, fg, &mut pos);}}