1# tkimg.decls -- -*- tcl -*-
2#
3# This file contains the declarations for all supported public functions
4# that are exported by the TKIMG library via the stubs table. This file
5# is used to generate the tkimgDecls.h/tkimgStubsLib.c/tkimgStubsInit.c
6# files.
7#
8
9# Declare each of the functions in the public tkimg interface.
10# Note that an index should never be reused for a different
11# function in order to preserve backwards compatibility.
12
13library tkimg
14
15# Define the TKIMG interface:
16
17interface tkimg
18scspec TKIMGAPI
19
20#########################################################################
21###  Reading and writing image data from channels and/or strings.
22
23declare 0 {
24    Tcl_Channel tkimg_OpenFileChannel(Tcl_Interp *interp,
25	const char *fileName, int permissions)
26}
27declare 1 {
28    int tkimg_ReadInit(Tcl_Obj *data, int c, tkimg_MFile *handle)
29}
30declare 2 {
31    void tkimg_WriteInit(Tcl_DString *buffer, tkimg_MFile *handle)
32}
33declare 3 {
34    int tkimg_Getc(tkimg_MFile *handle)
35}
36declare 4 {
37    int tkimg_Read(tkimg_MFile *handle, char *dst, int count)
38}
39declare 5 {
40    int tkimg_Putc(int c, tkimg_MFile *handle)
41}
42declare 6 {
43    int tkimg_Write(tkimg_MFile *handle, const char *src, int count)
44}
45declare 7 {
46    void tkimg_ReadBuffer(int onOff)
47}
48declare 8 {
49    size_t tkimg_Read2(tkimg_MFile *handle, char *dst, size_t count)
50}
51declare 9 {
52    size_t tkimg_Write2(tkimg_MFile *handle, const char *src, size_t count)
53}
54
55#########################################################################
56###  Specialized put block handling transparency
57
58declare 10 {
59    int tkimg_PhotoPutBlock(Tcl_Interp *interp, Tk_PhotoHandle handle,
60	Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int flags)
61}
62declare 11 {
63    int tkimg_PhotoExpand(Tcl_Interp *interp, Tk_PhotoHandle handle,
64	int width, int height)
65}
66declare 12 {
67    int tkimg_PhotoSetSize(Tcl_Interp *interp, Tk_PhotoHandle handle,
68	int width, int height)
69}
70
71#########################################################################
72###  Like the core functions, except that they accept objPtr == NULL.
73###  The byte array function also handles both UTF and non-UTF cores.
74
75declare 30 {
76    const char *tkimg_GetStringFromObj(Tcl_Obj *objPtr, int *lengthPtr)
77}
78declare 31 {
79    unsigned char *tkimg_GetByteArrayFromObj(Tcl_Obj *objPtr, int *lengthPtr)
80}
81declare 32 {
82    int tkimg_ListObjGetElements(Tcl_Interp *interp, Tcl_Obj *objPtr, int *argc, Tcl_Obj ***argv)
83}
84declare 33 {
85    const char *tkimg_GetStringFromObj2(Tcl_Obj *objPtr, size_t *lengthPtr)
86}
87declare 34 {
88    unsigned char *tkimg_GetByteArrayFromObj2(Tcl_Obj *objPtr, size_t *lengthPtr)
89}
90
91#########################################################################
92###  Specialized functions for handling images containing short or float values.
93
94declare 50 {
95    int tkimg_IsIntel (void)
96}
97declare 51 {
98    void tkimg_CreateGammaTable(float gammaVal, float *gammaTable)
99}
100declare 52 {
101    float tkimg_LookupGammaTable(float val, const float *gammaTable)
102}
103declare 53 {
104    void tkimg_UShortToUByte (int n, const unsigned short *shortIn,
105         const float *gammaTable, unsigned char *ubOut)
106}
107declare 54 {
108    void tkimg_ShortToUByte (int n, const short *shortIn,
109         const float *gammaTable, unsigned char *ubOut)
110}
111declare 55 {
112    void tkimg_FloatToUByte (int n, const float *floatIn,
113         const float *gammaTable, unsigned char *ubOut)
114}
115declare 56 {
116    int tkimg_ReadUByteRow (tkimg_MFile *handle, unsigned char *pixels, int nBytes)
117}
118declare 57 {
119    int tkimg_ReadUShortRow (tkimg_MFile *handle, unsigned short *pixels,
120        int nShorts, char *buf, int swapBytes)
121}
122declare 58 {
123    int tkimg_ReadShortRow (tkimg_MFile *handle, short *pixels,
124        int nShorts, char *buf, int swapBytes)
125}
126declare 59 {
127    int tkimg_ReadFloatRow (tkimg_MFile *handle, float *pixels,
128        int nFloats, char *buf, int swapBytes)
129}
130declare 60 {
131    int tkimg_ReadUByteFile (tkimg_MFile *handle, unsigned char *buf,
132        int width, int height,
133        int nchan, int verbose, int findMinMax,
134        float *minVals, float *maxVals)
135}
136declare 61 {
137    int tkimg_ReadUShortFile (tkimg_MFile *handle, unsigned short *buf,
138        int width, int height,
139        int nchan, int swapBytes, int verbose, int findMinMax,
140        float *minVals, float *maxVals)
141}
142declare 62 {
143    int tkimg_ReadFloatFile (tkimg_MFile *handle, float *buf,
144        int width, int height,
145        int nchan, int swapBytes, int verbose, int findMinMax,
146        float *minVals, float *maxVals, float saturation)
147}
148declare 63 {
149    void tkimg_RemapUShortValues (unsigned short *buf, int width, int height,
150         int nchan, float *minVals, float *maxVals)
151}
152declare 64 {
153    void tkimg_RemapFloatValues (float *buf, int width, int height, int nchan,
154         float *minVals, float *maxVals, float agcCutOffPercent, int printAgc)
155}
156
157#########################################################################
158