From 3db384424bd7398ffbb7a355cab8f15f3add009f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 2 Oct 2016 19:24:58 +0200 Subject: New upstream version 1.9.1+repack --- rspl/rspl1.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'rspl/rspl1.h') diff --git a/rspl/rspl1.h b/rspl/rspl1.h index 747abd5..63be428 100644 --- a/rspl/rspl1.h +++ b/rspl/rspl1.h @@ -1,7 +1,7 @@ #ifndef _RSPL1_H_ - /* Single dimension regularized spline data structure */ +/* Single dimension regularized spline data structure */ /* * Argyll Color Correction System @@ -18,10 +18,22 @@ * */ +/* + * Might be nice to add support for simple rev lookup, so that + * standalone xcal can use it ?? + */ + + #ifdef __cplusplus extern "C" { #endif +/* Make up for possible lack of rspl.h */ +#ifndef MXDI +# define MXDI 10 /* Maximum input dimensionality */ +# define MXDO 10 /* Maximum output dimensionality (Is not fully tested!!!) */ +#endif + /* General data point position/value structure */ typedef double datai[1]; typedef double datao[1]; @@ -94,12 +106,30 @@ struct _rspl { double **ipos /* (not used) */ ); + /* Initialize the grid from a provided function. */ + /* Grid index values are supplied "under" in[] at *((int*)&in[-e-1]) */ + int + (*set_rspl)( + struct _rspl *s, /* this */ + int flags, /* (Not used) */ + void *cbntx, /* Opaque function context */ + void (*func)(void *cbntx, double *out, double *in), /* Function to set from */ + datai glow, /* Grid low scale, NULL = default 0.0 */ + datai ghigh, /* Grid high scale, NULL = default 1.0 */ + int gres[MXDI], /* Spline grid resolution */ + datao vlow, /* Data value low normalize, NULL = default 0.0 */ + datao vhigh /* Data value high normalize - NULL = default 1.0 */ + ); + /* Do forward interpolation */ /* Return 0 if OK, 1 if input was clipped to grid */ int (*interp)( struct _rspl *s, /* this */ co *p); /* Input and output values */ + /* Return a pointer to the resolution array */ + int *(*get_res)(struct _rspl *s); + }; typedef struct _rspl rspl; /* Create a new, empty rspl object */ -- cgit v1.2.3