1 /*
2  * tkimgDecls.h --
3  *
4  *  Declarations of functions in the platform independent public TKIMG API.
5  *
6  */
7 
8 #ifndef _TKIMGDECLS
9 #define _TKIMGDECLS
10 
11 /*
12  * WARNING: The contents of this file is automatically generated by the
13  * genStubs.tcl script. Any modifications to the function declarations
14  * below should be made in the tkimg.decls script.
15  */
16 
17 #include <tk.h>
18 
19 #ifdef TKIMGAPI
20 #   undef TCL_STORAGE_CLASS
21 #   define TCL_STORAGE_CLASS DLLEXPORT
22 #else
23 #   define TKIMGAPI extern
24 #   undef USE_TKIMG_STUBS
25 #   define USE_TKIMG_STUBS 1
26 #endif
27 
28 EXTERN int Tkimg_Init(Tcl_Interp *interp);
29 EXTERN int Tkimg_SafeInit(Tcl_Interp *interp);
30 
31 typedef struct tkimg_MFile {
32 	Tcl_DString *buffer; /* pointer to dynamical string */
33 	char *data; /* mmencoded source string */
34 	int c; /* bits left over from previous char */
35 	int state; /* decoder state (0-4 or IMG_DONE) */
36 #if TCL_MAJOR_VERSION > 8
37 	size_t length; /* length of physical line already written */
38 #else
39 	unsigned int length; /* length of physical line already written */
40 	int notused; /* just to be sure to always allocate more than enough */
41 #endif
42 } tkimg_MFile;
43 
44 /* !BEGIN!: Do not edit below this line. */
45 
46 /*
47  * Exported function declarations:
48  */
49 
50 /* 0 */
51 TKIMGAPI Tcl_Channel	tkimg_OpenFileChannel(Tcl_Interp *interp,
52 				const char *fileName, int permissions);
53 /* 1 */
54 TKIMGAPI int		tkimg_ReadInit(Tcl_Obj *data, int c,
55 				tkimg_MFile *handle);
56 /* 2 */
57 TKIMGAPI void		tkimg_WriteInit(Tcl_DString *buffer,
58 				tkimg_MFile *handle);
59 /* 3 */
60 TKIMGAPI int		tkimg_Getc(tkimg_MFile *handle);
61 /* 4 */
62 TKIMGAPI int		tkimg_Read(tkimg_MFile *handle, char *dst, int count);
63 /* 5 */
64 TKIMGAPI int		tkimg_Putc(int c, tkimg_MFile *handle);
65 /* 6 */
66 TKIMGAPI int		tkimg_Write(tkimg_MFile *handle, const char *src,
67 				int count);
68 /* 7 */
69 TKIMGAPI void		tkimg_ReadBuffer(int onOff);
70 /* 8 */
71 TKIMGAPI size_t		tkimg_Read2(tkimg_MFile *handle, char *dst,
72 				size_t count);
73 /* 9 */
74 TKIMGAPI size_t		tkimg_Write2(tkimg_MFile *handle, const char *src,
75 				size_t count);
76 /* 10 */
77 TKIMGAPI int		tkimg_PhotoPutBlock(Tcl_Interp *interp,
78 				Tk_PhotoHandle handle,
79 				Tk_PhotoImageBlock *blockPtr, int x, int y,
80 				int width, int height, int flags);
81 /* 11 */
82 TKIMGAPI int		tkimg_PhotoExpand(Tcl_Interp *interp,
83 				Tk_PhotoHandle handle, int width, int height);
84 /* 12 */
85 TKIMGAPI int		tkimg_PhotoSetSize(Tcl_Interp *interp,
86 				Tk_PhotoHandle handle, int width, int height);
87 /* Slot 13 is reserved */
88 /* Slot 14 is reserved */
89 /* Slot 15 is reserved */
90 /* Slot 16 is reserved */
91 /* Slot 17 is reserved */
92 /* Slot 18 is reserved */
93 /* Slot 19 is reserved */
94 /* Slot 20 is reserved */
95 /* Slot 21 is reserved */
96 /* Slot 22 is reserved */
97 /* Slot 23 is reserved */
98 /* Slot 24 is reserved */
99 /* Slot 25 is reserved */
100 /* Slot 26 is reserved */
101 /* Slot 27 is reserved */
102 /* Slot 28 is reserved */
103 /* Slot 29 is reserved */
104 /* 30 */
105 TKIMGAPI const char *	tkimg_GetStringFromObj(Tcl_Obj *objPtr,
106 				int *lengthPtr);
107 /* 31 */
108 TKIMGAPI unsigned char * tkimg_GetByteArrayFromObj(Tcl_Obj *objPtr,
109 				int *lengthPtr);
110 /* 32 */
111 TKIMGAPI int		tkimg_ListObjGetElements(Tcl_Interp *interp,
112 				Tcl_Obj *objPtr, int *argc, Tcl_Obj ***argv);
113 /* 33 */
114 TKIMGAPI const char *	tkimg_GetStringFromObj2(Tcl_Obj *objPtr,
115 				size_t *lengthPtr);
116 /* 34 */
117 TKIMGAPI unsigned char * tkimg_GetByteArrayFromObj2(Tcl_Obj *objPtr,
118 				size_t *lengthPtr);
119 /* Slot 35 is reserved */
120 /* Slot 36 is reserved */
121 /* Slot 37 is reserved */
122 /* Slot 38 is reserved */
123 /* Slot 39 is reserved */
124 /* Slot 40 is reserved */
125 /* Slot 41 is reserved */
126 /* Slot 42 is reserved */
127 /* Slot 43 is reserved */
128 /* Slot 44 is reserved */
129 /* Slot 45 is reserved */
130 /* Slot 46 is reserved */
131 /* Slot 47 is reserved */
132 /* Slot 48 is reserved */
133 /* Slot 49 is reserved */
134 /* 50 */
135 TKIMGAPI int		tkimg_IsIntel(void);
136 /* 51 */
137 TKIMGAPI void		tkimg_CreateGammaTable(float gammaVal,
138 				float *gammaTable);
139 /* 52 */
140 TKIMGAPI float		tkimg_LookupGammaTable(float val,
141 				const float *gammaTable);
142 /* 53 */
143 TKIMGAPI void		tkimg_UShortToUByte(int n,
144 				const unsigned short *shortIn,
145 				const float *gammaTable,
146 				unsigned char *ubOut);
147 /* 54 */
148 TKIMGAPI void		tkimg_ShortToUByte(int n, const short *shortIn,
149 				const float *gammaTable,
150 				unsigned char *ubOut);
151 /* 55 */
152 TKIMGAPI void		tkimg_FloatToUByte(int n, const float *floatIn,
153 				const float *gammaTable,
154 				unsigned char *ubOut);
155 /* 56 */
156 TKIMGAPI int		tkimg_ReadUByteRow(tkimg_MFile *handle,
157 				unsigned char *pixels, int nBytes);
158 /* 57 */
159 TKIMGAPI int		tkimg_ReadUShortRow(tkimg_MFile *handle,
160 				unsigned short *pixels, int nShorts,
161 				char *buf, int swapBytes);
162 /* 58 */
163 TKIMGAPI int		tkimg_ReadShortRow(tkimg_MFile *handle,
164 				short *pixels, int nShorts, char *buf,
165 				int swapBytes);
166 /* 59 */
167 TKIMGAPI int		tkimg_ReadFloatRow(tkimg_MFile *handle,
168 				float *pixels, int nFloats, char *buf,
169 				int swapBytes);
170 /* 60 */
171 TKIMGAPI int		tkimg_ReadUByteFile(tkimg_MFile *handle,
172 				unsigned char *buf, int width, int height,
173 				int nchan, int verbose, int findMinMax,
174 				float *minVals, float *maxVals);
175 /* 61 */
176 TKIMGAPI int		tkimg_ReadUShortFile(tkimg_MFile *handle,
177 				unsigned short *buf, int width, int height,
178 				int nchan, int swapBytes, int verbose,
179 				int findMinMax, float *minVals,
180 				float *maxVals);
181 /* 62 */
182 TKIMGAPI int		tkimg_ReadFloatFile(tkimg_MFile *handle, float *buf,
183 				int width, int height, int nchan,
184 				int swapBytes, int verbose, int findMinMax,
185 				float *minVals, float *maxVals,
186 				float saturation);
187 /* 63 */
188 TKIMGAPI void		tkimg_RemapUShortValues(unsigned short *buf,
189 				int width, int height, int nchan,
190 				float *minVals, float *maxVals);
191 /* 64 */
192 TKIMGAPI void		tkimg_RemapFloatValues(float *buf, int width,
193 				int height, int nchan, float *minVals,
194 				float *maxVals, float agcCutOffPercent,
195 				int printAgc);
196 
197 typedef struct TkimgStubs {
198     int magic;
199     const struct TkimgStubHooks *hooks;
200 
201     Tcl_Channel (*tkimg_OpenFileChannelPtr) (Tcl_Interp *interp, const char *fileName, int permissions); /* 0 */
202     int (*tkimg_ReadInitPtr) (Tcl_Obj *data, int c, tkimg_MFile *handle); /* 1 */
203     void (*tkimg_WriteInitPtr) (Tcl_DString *buffer, tkimg_MFile *handle); /* 2 */
204     int (*tkimg_GetcPtr) (tkimg_MFile *handle); /* 3 */
205     int (*tkimg_ReadPtr) (tkimg_MFile *handle, char *dst, int count); /* 4 */
206     int (*tkimg_PutcPtr) (int c, tkimg_MFile *handle); /* 5 */
207     int (*tkimg_WritePtr) (tkimg_MFile *handle, const char *src, int count); /* 6 */
208     void (*tkimg_ReadBufferPtr) (int onOff); /* 7 */
209     size_t (*tkimg_Read2Ptr) (tkimg_MFile *handle, char *dst, size_t count); /* 8 */
210     size_t (*tkimg_Write2Ptr) (tkimg_MFile *handle, const char *src, size_t count); /* 9 */
211     int (*tkimg_PhotoPutBlockPtr) (Tcl_Interp *interp, Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int flags); /* 10 */
212     int (*tkimg_PhotoExpandPtr) (Tcl_Interp *interp, Tk_PhotoHandle handle, int width, int height); /* 11 */
213     int (*tkimg_PhotoSetSizePtr) (Tcl_Interp *interp, Tk_PhotoHandle handle, int width, int height); /* 12 */
214     void (*reserved13)(void);
215     void (*reserved14)(void);
216     void (*reserved15)(void);
217     void (*reserved16)(void);
218     void (*reserved17)(void);
219     void (*reserved18)(void);
220     void (*reserved19)(void);
221     void (*reserved20)(void);
222     void (*reserved21)(void);
223     void (*reserved22)(void);
224     void (*reserved23)(void);
225     void (*reserved24)(void);
226     void (*reserved25)(void);
227     void (*reserved26)(void);
228     void (*reserved27)(void);
229     void (*reserved28)(void);
230     void (*reserved29)(void);
231     const char * (*tkimg_GetStringFromObjPtr) (Tcl_Obj *objPtr, int *lengthPtr); /* 30 */
232     unsigned char * (*tkimg_GetByteArrayFromObjPtr) (Tcl_Obj *objPtr, int *lengthPtr); /* 31 */
233     int (*tkimg_ListObjGetElementsPtr) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *argc, Tcl_Obj ***argv); /* 32 */
234     const char * (*tkimg_GetStringFromObj2Ptr) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 33 */
235     unsigned char * (*tkimg_GetByteArrayFromObj2Ptr) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 34 */
236     void (*reserved35)(void);
237     void (*reserved36)(void);
238     void (*reserved37)(void);
239     void (*reserved38)(void);
240     void (*reserved39)(void);
241     void (*reserved40)(void);
242     void (*reserved41)(void);
243     void (*reserved42)(void);
244     void (*reserved43)(void);
245     void (*reserved44)(void);
246     void (*reserved45)(void);
247     void (*reserved46)(void);
248     void (*reserved47)(void);
249     void (*reserved48)(void);
250     void (*reserved49)(void);
251     int (*tkimg_IsIntelPtr) (void); /* 50 */
252     void (*tkimg_CreateGammaTablePtr) (float gammaVal, float *gammaTable); /* 51 */
253     float (*tkimg_LookupGammaTablePtr) (float val, const float *gammaTable); /* 52 */
254     void (*tkimg_UShortToUBytePtr) (int n, const unsigned short *shortIn, const float *gammaTable, unsigned char *ubOut); /* 53 */
255     void (*tkimg_ShortToUBytePtr) (int n, const short *shortIn, const float *gammaTable, unsigned char *ubOut); /* 54 */
256     void (*tkimg_FloatToUBytePtr) (int n, const float *floatIn, const float *gammaTable, unsigned char *ubOut); /* 55 */
257     int (*tkimg_ReadUByteRowPtr) (tkimg_MFile *handle, unsigned char *pixels, int nBytes); /* 56 */
258     int (*tkimg_ReadUShortRowPtr) (tkimg_MFile *handle, unsigned short *pixels, int nShorts, char *buf, int swapBytes); /* 57 */
259     int (*tkimg_ReadShortRowPtr) (tkimg_MFile *handle, short *pixels, int nShorts, char *buf, int swapBytes); /* 58 */
260     int (*tkimg_ReadFloatRowPtr) (tkimg_MFile *handle, float *pixels, int nFloats, char *buf, int swapBytes); /* 59 */
261     int (*tkimg_ReadUByteFilePtr) (tkimg_MFile *handle, unsigned char *buf, int width, int height, int nchan, int verbose, int findMinMax, float *minVals, float *maxVals); /* 60 */
262     int (*tkimg_ReadUShortFilePtr) (tkimg_MFile *handle, unsigned short *buf, int width, int height, int nchan, int swapBytes, int verbose, int findMinMax, float *minVals, float *maxVals); /* 61 */
263     int (*tkimg_ReadFloatFilePtr) (tkimg_MFile *handle, float *buf, int width, int height, int nchan, int swapBytes, int verbose, int findMinMax, float *minVals, float *maxVals, float saturation); /* 62 */
264     void (*tkimg_RemapUShortValuesPtr) (unsigned short *buf, int width, int height, int nchan, float *minVals, float *maxVals); /* 63 */
265     void (*tkimg_RemapFloatValuesPtr) (float *buf, int width, int height, int nchan, float *minVals, float *maxVals, float agcCutOffPercent, int printAgc); /* 64 */
266 } TkimgStubs;
267 
268 #ifdef __cplusplus
269 extern "C" {
270 #endif
271 TKIMGAPI const TkimgStubs *tkimgStubsPtr;
272 #ifdef __cplusplus
273 }
274 #endif
275 
276 #if defined(USE_TKIMG_STUBS)
277 
278 /*
279  * Inline function declarations:
280  */
281 
282 #define tkimg_OpenFileChannel \
283 	(tkimgStubsPtr->tkimg_OpenFileChannelPtr) /* 0 */
284 #define tkimg_ReadInit \
285 	(tkimgStubsPtr->tkimg_ReadInitPtr) /* 1 */
286 #define tkimg_WriteInit \
287 	(tkimgStubsPtr->tkimg_WriteInitPtr) /* 2 */
288 #define tkimg_Getc \
289 	(tkimgStubsPtr->tkimg_GetcPtr) /* 3 */
290 #define tkimg_Read \
291 	(tkimgStubsPtr->tkimg_ReadPtr) /* 4 */
292 #define tkimg_Putc \
293 	(tkimgStubsPtr->tkimg_PutcPtr) /* 5 */
294 #define tkimg_Write \
295 	(tkimgStubsPtr->tkimg_WritePtr) /* 6 */
296 #define tkimg_ReadBuffer \
297 	(tkimgStubsPtr->tkimg_ReadBufferPtr) /* 7 */
298 #define tkimg_Read2 \
299 	(tkimgStubsPtr->tkimg_Read2Ptr) /* 8 */
300 #define tkimg_Write2 \
301 	(tkimgStubsPtr->tkimg_Write2Ptr) /* 9 */
302 #define tkimg_PhotoPutBlock \
303 	(tkimgStubsPtr->tkimg_PhotoPutBlockPtr) /* 10 */
304 #define tkimg_PhotoExpand \
305 	(tkimgStubsPtr->tkimg_PhotoExpandPtr) /* 11 */
306 #define tkimg_PhotoSetSize \
307 	(tkimgStubsPtr->tkimg_PhotoSetSizePtr) /* 12 */
308 /* Slot 13 is reserved */
309 /* Slot 14 is reserved */
310 /* Slot 15 is reserved */
311 /* Slot 16 is reserved */
312 /* Slot 17 is reserved */
313 /* Slot 18 is reserved */
314 /* Slot 19 is reserved */
315 /* Slot 20 is reserved */
316 /* Slot 21 is reserved */
317 /* Slot 22 is reserved */
318 /* Slot 23 is reserved */
319 /* Slot 24 is reserved */
320 /* Slot 25 is reserved */
321 /* Slot 26 is reserved */
322 /* Slot 27 is reserved */
323 /* Slot 28 is reserved */
324 /* Slot 29 is reserved */
325 #define tkimg_GetStringFromObj \
326 	(tkimgStubsPtr->tkimg_GetStringFromObjPtr) /* 30 */
327 #define tkimg_GetByteArrayFromObj \
328 	(tkimgStubsPtr->tkimg_GetByteArrayFromObjPtr) /* 31 */
329 #define tkimg_ListObjGetElements \
330 	(tkimgStubsPtr->tkimg_ListObjGetElementsPtr) /* 32 */
331 #define tkimg_GetStringFromObj2 \
332 	(tkimgStubsPtr->tkimg_GetStringFromObj2Ptr) /* 33 */
333 #define tkimg_GetByteArrayFromObj2 \
334 	(tkimgStubsPtr->tkimg_GetByteArrayFromObj2Ptr) /* 34 */
335 /* Slot 35 is reserved */
336 /* Slot 36 is reserved */
337 /* Slot 37 is reserved */
338 /* Slot 38 is reserved */
339 /* Slot 39 is reserved */
340 /* Slot 40 is reserved */
341 /* Slot 41 is reserved */
342 /* Slot 42 is reserved */
343 /* Slot 43 is reserved */
344 /* Slot 44 is reserved */
345 /* Slot 45 is reserved */
346 /* Slot 46 is reserved */
347 /* Slot 47 is reserved */
348 /* Slot 48 is reserved */
349 /* Slot 49 is reserved */
350 #define tkimg_IsIntel \
351 	(tkimgStubsPtr->tkimg_IsIntelPtr) /* 50 */
352 #define tkimg_CreateGammaTable \
353 	(tkimgStubsPtr->tkimg_CreateGammaTablePtr) /* 51 */
354 #define tkimg_LookupGammaTable \
355 	(tkimgStubsPtr->tkimg_LookupGammaTablePtr) /* 52 */
356 #define tkimg_UShortToUByte \
357 	(tkimgStubsPtr->tkimg_UShortToUBytePtr) /* 53 */
358 #define tkimg_ShortToUByte \
359 	(tkimgStubsPtr->tkimg_ShortToUBytePtr) /* 54 */
360 #define tkimg_FloatToUByte \
361 	(tkimgStubsPtr->tkimg_FloatToUBytePtr) /* 55 */
362 #define tkimg_ReadUByteRow \
363 	(tkimgStubsPtr->tkimg_ReadUByteRowPtr) /* 56 */
364 #define tkimg_ReadUShortRow \
365 	(tkimgStubsPtr->tkimg_ReadUShortRowPtr) /* 57 */
366 #define tkimg_ReadShortRow \
367 	(tkimgStubsPtr->tkimg_ReadShortRowPtr) /* 58 */
368 #define tkimg_ReadFloatRow \
369 	(tkimgStubsPtr->tkimg_ReadFloatRowPtr) /* 59 */
370 #define tkimg_ReadUByteFile \
371 	(tkimgStubsPtr->tkimg_ReadUByteFilePtr) /* 60 */
372 #define tkimg_ReadUShortFile \
373 	(tkimgStubsPtr->tkimg_ReadUShortFilePtr) /* 61 */
374 #define tkimg_ReadFloatFile \
375 	(tkimgStubsPtr->tkimg_ReadFloatFilePtr) /* 62 */
376 #define tkimg_RemapUShortValues \
377 	(tkimgStubsPtr->tkimg_RemapUShortValuesPtr) /* 63 */
378 #define tkimg_RemapFloatValues \
379 	(tkimgStubsPtr->tkimg_RemapFloatValuesPtr) /* 64 */
380 
381 #endif /* defined(USE_TKIMG_STUBS) */
382 
383 /* !END!: Do not edit above this line. */
384 
385 #undef TCL_STORAGE_CLASS
386 #define TCL_STORAGE_CLASS DLLIMPORT
387 
388 #endif /* _TKIMGDECLS */
389