Remove unneeded code, and silence warnings.

This commit is contained in:
Nathan Vegdahl 2022-04-23 15:31:52 -07:00
parent 252c2541d6
commit 243f8b4b5a
3 changed files with 5 additions and 11 deletions

View File

@ -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

View File

@ -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;

View File

@ -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