1 #ifndef IMDI_H
2 #define IMDI_H
3 
4 /* Integer Multi-Dimensional Interpolation */
5 /*
6  * Copyright 2000 - 2002 Graeme W. Gill
7  * All rights reserved.
8  *
9  * This material is licenced under the GNU GENERAL PUBLIC LICENCE :-
10  * see the Licence.txt file for licencing details.
11  */
12 
13 /*
14  * This software provides support for high speed integer
15  * multimensional interpolation.
16  */
17 
18 /*
19  * This file provides the common definitions for IMDI, and
20  * the data structures for communcating between the client
21  * imdi object.
22 */
23 
24 /* Pixel representation description */
25 
26 /* This is a high level macro desciption of the pixel layout. */
27 /* It can be expanded by adding a new enumeration, and then */
28 /* implementing the code in imdi_gen to translate the enumeration */
29 /* into the exact pixlayout structure details. */
30 
31 typedef enum {
32 	invalid_rep = 0,
33 	pixint8    = 1,		/* 8 Bits per value, pixel interleaved, no padding */
34 	planeint8  = 2,		/* 8 bits per value, plane interleaved */
35 	pixint16   = 3,		/* 16 Bits per value, pixel interleaved, no padding */
36 	planeint16 = 4		/* 16 bits per value, plane interleaved */
37 } imdi_pixrep;
38 
39 /* IMDI Object */
40 struct _imdi {
41 	void *impl;			/* Pointer to implementation information */
42 
43 	/* Do the interpolation */
44 	void (*interp)(struct _imdi *s, void **inp, void **outp, unsigned int npixels);
45 	void (*done)(struct _imdi *s);		/* Done with it */
46 
47 }; typedef struct _imdi imdi;
48 
49 /* Create a new imdi */
50 /* Return NULL if request is not supported */
51 imdi *new_imdi(
52 	int id,			/* Number of input dimensions */
53 	int od,			/* Number of output dimensions */
54 	imdi_pixrep in,	/* Input pixel representation */
55 	int in_signed,	/* Bit flag per channel, NZ if treat as signed */
56 	imdi_pixrep out,/* Output pixel representation */
57 	int out_signed,	/* Bit flag per channel, NZ if treat as signed */
58 	int res,		/* Desired table resolution */
59 
60 	/* Callbacks to lookup the mdi table values */
61 	double (*input_curve) (void *cntx, int ch, double in_val),
62 	void   (*md_table)    (void *cntx, double *out_vals, double *in_vals),
63 	double (*output_curve)(void *cntx, int ch, double in_val),
64 	void *cntx		/* Context to callbacks */
65 );
66 
67 #endif /* IMDI_H */
68 
69 
70 
71 
72 
73 
74