diff --git a/src/linear_log.rs b/src/linear_log.rs index 352b3ea..d195479 100644 --- a/src/linear_log.rs +++ b/src/linear_log.rs @@ -55,16 +55,6 @@ pub fn find_log_offset_for_end(end: f64, line_offset: f64, slope: f64, base: f64 offset_up } -// Transition point between log and linear. -// -// Returned as (linear, non-linear). -pub fn transition_point(line_offset: f64, slope: f64, log_offset: f64, base: f64) -> (f64, f64) { - let transition = 1.0 / (slope * base.ln()); - let k = transition + log_offset; - - (k, (k - line_offset) * slope) -} - //------------------------------------------------------------- /// Generates Rust code for a both linear-to-log and log-to-linear diff --git a/src/optimize_log.rs b/src/optimize_log.rs index 790b7e0..b556ef3 100644 --- a/src/optimize_log.rs +++ b/src/optimize_log.rs @@ -45,7 +45,6 @@ pub fn find_parameters(lut: &[f32]) { 100, ); let log_offset = crate::linear_log::find_log_offset_for_end(end, offset, slope, base); - let transition = crate::linear_log::transition_point(offset, slope, log_offset, base); // Calculate the error of our model. let mut max_err = 0.0f64; diff --git a/src/test_image.rs b/src/test_image.rs index fcd6035..af450c3 100644 --- a/src/test_image.rs +++ b/src/test_image.rs @@ -61,6 +61,7 @@ pub fn build() -> Vec<[f32; 3]> { /// Gives the index in the test image Vec of the given /// gray-gradient index. +#[allow(unused)] #[inline(always)] pub fn gray_idx(idx: usize) -> usize { idx @@ -68,6 +69,7 @@ pub fn gray_idx(idx: usize) -> usize { /// Gives the index in the test image Vec of the given /// red-gradient index. +#[allow(unused)] #[inline(always)] pub fn red_idx(idx: usize) -> usize { GRADIENT_LEN + idx @@ -75,6 +77,7 @@ pub fn red_idx(idx: usize) -> usize { /// Gives the index in the test image Vec of the given /// green-gradient index. +#[allow(unused)] #[inline(always)] pub fn green_idx(idx: usize) -> usize { GRADIENT_LEN * 2 + idx @@ -82,6 +85,7 @@ pub fn green_idx(idx: usize) -> usize { /// Gives the index in the test image Vec of the given /// blue-gradient index. +#[allow(unused)] #[inline(always)] pub fn blue_idx(idx: usize) -> usize { GRADIENT_LEN * 3 + idx @@ -89,6 +93,7 @@ pub fn blue_idx(idx: usize) -> usize { /// Gives the index in the test image Vec of the given /// rgb table indices. +#[allow(unused)] #[inline(always)] pub fn rgb_idx(r_idx: usize, g_idx: usize, b_idx: usize) -> usize { (GRADIENT_LEN * 4) + (r_idx * TABLE_SIZE * TABLE_SIZE) + (g_idx * TABLE_SIZE) + b_idx