Skip to content

Commit

Permalink
Merge pull request #23 from W-Mai/master
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski authored May 2, 2024
2 parents e2b938f + 89fa562 commit 0a8f644
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,16 @@ impl NeuQuant {
map
}

/// Return the Alpha channel of the color map calculated from the sample.
/// It's useful for transparency used in the tRNS chunk of the PNG format.
pub fn color_map_alpha(&self) -> Vec<u8> {
let mut map = Vec::with_capacity(self.netsize);
for entry in &self.colormap {
map.push(entry.a as u8);
}
map
}

/// Move neuron i towards biased (a,b,g,r) by factor alpha
fn salter_single(&mut self, alpha: f64, i: i32, quad: Quad<f64>) {
let n = &mut self.network[i as usize];
Expand Down

0 comments on commit 0a8f644

Please sign in to comment.