Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
curve_tools.c File Reference
#include "curve_tools.h"
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
+ Include dependency graph for curve_tools.c:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EPSILON   2 * FLT_MIN
 
#define MAX_ITER   10
 

Functions

float spline_cubic_val (int n, float t[], float tval, float y[], float ypp[])
 
float catmull_rom_val (int n, float x[], float xval, float y[], float tangents[])
 
float * spline_cubic_set (int n, float t[], float y[])
 
float * catmull_rom_set (int n, float x[], float y[])
 
float * monotone_hermite_set (int n, float x[], float y[])
 
float * d3_np_fs (int n, float a[], float b[])
 
static float * spline_cubic_set_internal (int n, float t[], float y[], int ibcbeg, float ybcbeg, int ibcend, float ybcend)
 
float * interpolate_set (int n, float x[], float y[], unsigned int type)
 
float interpolate_val (int n, float x[], float xval, float y[], float tangents[], unsigned int type)
 
int CurveDataSample (CurveData *curve, CurveSample *sample)
 

Variables

static const int curvedata_anchors_max = 20
 
float(* spline_val [])(int, float[], float, float[], float[]) = { spline_cubic_val, catmull_rom_val, catmull_rom_val }
 
float *(* spline_set [])(int, float[], float[]) = { spline_cubic_set, catmull_rom_set, monotone_hermite_set }
 

Macro Definition Documentation

◆ EPSILON

#define EPSILON   2 * FLT_MIN

◆ MAX_ITER

#define MAX_ITER   10

Function Documentation

◆ catmull_rom_set()

float * catmull_rom_set ( int  n,
float  x[],
float  y[] 
)

References m.

◆ catmull_rom_val()

float catmull_rom_val ( int  n,
float  x[],
float  xval,
float  y[],
float  tangents[] 
)

◆ CurveDataSample()

◆ d3_np_fs()

float * d3_np_fs ( int  n,
float  a[],
float  b[] 
)

◆ interpolate_set()

float * interpolate_set ( int  n,
float  x[],
float  y[],
unsigned int  type 
)

References spline_set, and type.

Referenced by CurveDataSample(), and dt_draw_curve_calc_value().

◆ interpolate_val()

float interpolate_val ( int  n,
float  x[],
float  xval,
float  y[],
float  tangents[],
unsigned int  type 
)

References spline_val, and type.

Referenced by CurveDataSample(), and dt_draw_curve_calc_value().

◆ monotone_hermite_set()

float * monotone_hermite_set ( int  n,
float  x[],
float  y[] 
)

References EPSILON, and m.

◆ spline_cubic_set()

float * spline_cubic_set ( int  n,
float  t[],
float  y[] 
)

◆ spline_cubic_set_internal()

static float * spline_cubic_set_internal ( int  n,
float  t[],
float  y[],
int  ibcbeg,
float  ybcbeg,
int  ibcend,
float  ybcend 
)
static

References d3_np_fs().

Referenced by spline_cubic_set().

◆ spline_cubic_val()

float spline_cubic_val ( int  n,
float  t[],
float  tval,
float  y[],
float  ypp[] 
)

ypval = ( y[ival+1] - y[ival] ) / h

  • ( ypp[ival+1] / 6.0E+00 + ypp[ival] / 3.0E+00 ) * h
  • dt * ( ypp[ival]
  • dt * ( 0.5E+00 * ( ypp[ival+1] - ypp[ival] ) / h ) );

yppval = ypp[ival] + dt * ( ypp[ival+1] - ypp[ival] ) / h;

Variable Documentation

◆ curvedata_anchors_max

const int curvedata_anchors_max = 20
static

Referenced by d3_np_fs().

◆ spline_set

float *(* spline_set[])(int, float[], float[]) ( int  ,
float  [],
float  [] 
) = { spline_cubic_set, catmull_rom_set, monotone_hermite_set }

Referenced by interpolate_set().

◆ spline_val

float(* spline_val[])(int, float[], float, float[], float[]) ( int  ,
float  [],
float  ,
float  [],
float  [] 
) = { spline_cubic_val, catmull_rom_val, catmull_rom_val }

Referenced by interpolate_val().