~ubuntu-branches/ubuntu/saucy/argyll/saucy

« back to all changes in this revision

Viewing changes to spectro/conv.h

  • Committer: Package Import Robot
  • Author(s): Christian Marillat
  • Date: 2012-04-25 07:46:07 UTC
  • mfrom: (1.2.2) (13.1.15 sid)
  • Revision ID: package-import@ubuntu.com-20120425074607-yjqadetw8kum9skc
Tags: 1.4.0-4
Should Build-Depends on libusb-dev (Closes: #670329).

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 */
22
22
 
23
23
#if defined (NT)
24
 
#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0501
25
 
# define _WIN32_WINNT 0x0501
26
 
#endif
27
 
#define WIN32_LEAN_AND_MEAN
28
 
#include <windows.h>
 
24
# if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0501
 
25
#  if defined _WIN32_WINNT
 
26
#   undef _WIN32_WINNT
 
27
#  endif
 
28
#  define _WIN32_WINNT 0x0501
 
29
# endif
 
30
# define WIN32_LEAN_AND_MEAN
 
31
# include <windows.h>
 
32
# include <io.h>
29
33
#endif
30
34
 
31
35
#if defined (UNIX) || defined(__APPLE__)
32
 
#include <pthread.h>
 
36
# include <unistd.h>
 
37
# include <glob.h>
 
38
# include <pthread.h>
33
39
#endif
34
40
 
35
41
#ifdef __cplusplus
85
91
void msec_sleep(unsigned int msec);
86
92
 
87
93
/* Return the current time in msec since */
88
 
/* the process started. */
 
94
/* the first invokation of msec_time() */
89
95
unsigned int msec_time();
90
96
 
 
97
/* Return the current time in usec */
 
98
/* the first invokation of usec_time() */
 
99
double usec_time();
 
100
 
91
101
/* Activate the system beeper after a delay */
92
102
/* (Note frequancy and duration may not be honoured on all systems) */
93
103
void msec_beep(int delay, int freq, int msec);
118
128
#if defined (UNIX) || defined(__APPLE__)
119
129
        pthread_t thid;                 /* Thread ID */
120
130
#endif
 
131
        int finished;                   /* Set when the thread returned */
121
132
        int result;                             /* Return code from thread function */
122
133
 
123
134
        /* Thread function to call */
126
137
        /* And the context to call it with */
127
138
        void *context;
128
139
 
 
140
        /* Wait for the thread to exit. Return the result */
 
141
        int (*wait)(struct _athread *p);
 
142
 
129
143
    /* Kill the thread and delete the object */
130
144
        /* (Killing it may have side effects, so this is a last */
131
145
        /*  resort if the thread hasn't exited) */
159
173
    void (*del)(struct _kkill_nproc_ctx *p);
160
174
}; typedef struct _kkill_nproc_ctx kkill_nproc_ctx;
161
175
 
162
 
#ifdef __APPLE__
 
176
#if defined(__APPLE__) || defined(NT)
163
177
 
164
178
/* Kill a list of named processes. NULL for last */
165
179
/* return < 0 if this fails. */
171
185
/* Call ctx->del() when done */
172
186
kkill_nproc_ctx *kkill_nprocess(char **pname, int debug);
173
187
 
174
 
#endif /* __APPLE__ */
 
188
#endif /* __APPLE__ || NT */
175
189
 
176
190
#include "xdg_bds.h"
177
191
 
178
192
/* - - - - - - - - - - - - - - - - - - -- */
 
193
/* CCSS support */
 
194
 
 
195
typedef struct {
 
196
        char *path;             /* Path to the file */
 
197
        char *desc;             /* Technolofy + display description */
 
198
} iccss;
 
199
 
 
200
/* return a list of installed ccss files. */
 
201
/* The list is sorted by description and terminated by a NULL entry. */
 
202
/* If no is != NULL, return the number in the list */
 
203
/* Return NULL and -1 if there is a malloc error */
 
204
iccss *list_iccss(int *no);
 
205
 
 
206
/* Free up a iccss list */
 
207
void free_iccss(iccss *list);
 
208
 
 
209
/* - - - - - - - - - - - - - - - - - - -- */
179
210
/* A very small subset of icclib */
180
211
#ifdef SALONEINSTLIB
181
212
 
185
216
    double  Z;
186
217
} sa_XYZNumber;
187
218
 
 
219
typedef enum {
 
220
    sa_SigXYZData                        = 0x58595A20L,  /* 'XYZ ' */
 
221
    sa_SigLabData                        = 0x4C616220L   /* 'Lab ' */
 
222
} sa_ColorSpaceSignature;
 
223
 
188
224
extern sa_XYZNumber sa_D50;
189
225
void sa_SetUnity3x3(double mat[3][3]);
190
226
void sa_Cpy3x3(double out[3][3], double mat[3][3]);
191
227
void sa_MulBy3x3(double out[3], double mat[3][3], double in[3]);
192
228
void sa_Mul3x3_2(double dst[3][3], double src1[3][3], double src2[3][3]);
193
229
int sa_Inverse3x3(double out[3][3], double in[3][3]);
 
230
void sa_Transpose3x3(double out[3][3], double in[3][3]);
 
231
void sa_Scale3(double out[3], double in[3], double rat);
 
232
double sa_LabDE(double *in0, double *in1);
 
233
 
194
234
 
195
235
#define icmXYZNumber sa_XYZNumber
 
236
#define icColorSpaceSignature sa_ColorSpaceSignature
 
237
#define icSigXYZData sa_SigXYZData
 
238
#define icSigLabData sa_SigLabData
196
239
#define icmD50 sa_D50
197
240
#define icmSetUnity3x3 sa_SetUnity3x3
198
241
#define icmCpy3x3 sa_Cpy3x3
199
242
#define icmMulBy3x3 sa_MulBy3x3
200
243
#define icmMul3x3_2 sa_Mul3x3_2
201
244
#define icmInverse3x3 sa_Inverse3x3
 
245
#define icmTranspose3x3 sa_Transpose3x3
 
246
#define icmScale3 sa_Scale3
 
247
#define icmLabDE sa_LabDE
 
248
 
 
249
/* A subset of numlib */
 
250
 
 
251
int sa_lu_psinvert(double **out, double **in, int m, int n);
 
252
 
 
253
#define lu_psinvert sa_lu_psinvert
202
254
 
203
255
#endif /* SALONEINSTLIB */
204
256
/* - - - - - - - - - - - - - - - - - - -- */