Tizen 2.1 base
[platform/upstream/hplip.git] / ip / hpip.h
1 /* libhpojip -- HP OfficeJet image-processing library. */
2
3 /* Copyright (C) 1995-2002 Hewlett-Packard Company
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * is provided AS IS, WITHOUT ANY WARRANTY; without even the implied
12  * warranty of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, and
13  * NON-INFRINGEMENT.  See the GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18  * MA 02111-1307, USA.
19  *
20  * In addition, as a special exception, Hewlett-Packard Company
21  * gives permission to link the code of this program with any
22  * version of the OpenSSL library which is distributed under a
23  * license identical to that listed in the included LICENSE.OpenSSL
24  * file, and distribute linked combinations including the two.
25  * You must obey the GNU General Public License in all respects
26  * for all of the code used other than OpenSSL.  If you modify
27  * this file, you may extend this exception to your version of the
28  * file, but you are not obligated to do so.  If you do not wish to
29  * do so, delete this exception statement from your version.
30  */
31
32 /* Original author: Mark Overton and others.
33  *
34  * Ported to Linux by David Paschal.
35  */
36
37 /*****************************************************************************\
38  *
39  * hpojip.h - Interface into the Image Processing module
40  *
41  *****************************************************************************
42  *
43  * Mark Overton, Dec 1997
44  *
45 \*****************************************************************************/
46
47
48 #if !defined HPIP_INC
49 #define HPIP_INC
50
51 #if defined(__cplusplus)
52         extern "C" {
53 #endif
54
55 #include <stdlib.h>
56
57 /* TODO: Fix this! */
58 // #include <endian.h>
59 #undef LITTLE_ENDIAN
60
61 #define FAR
62 #define WINAPI
63 #define EXPORT(x) x
64
65 typedef unsigned char BYTE, *PBYTE, FAR *LPBYTE;
66 typedef unsigned short WORD, *PWORD, FAR *LPWORD;
67 typedef unsigned short USHORT, *PUSHORT, FAR *LPUSHORT;
68 typedef unsigned int DWORD, *PDWORD, FAR *LPDWORD;
69 typedef unsigned int UINT, *PUINT, FAR *LPUINT;
70 typedef unsigned long ULONG, *PULONG, FAR *LPULONG;
71 typedef enum { FALSE=0, TRUE=1 } BOOL;
72 typedef void VOID, *PVOID, FAR *LPVOID;
73 typedef long long int __int64;
74
75 typedef struct {
76         BYTE rgbRed:8;
77         BYTE rgbGreen:8;
78         BYTE rgbBlue:8;
79 } __attribute__((packed)) RGBQUAD;
80
81 /****************************************************************************\
82  ****************************************************************************
83  *
84  * COMMON DEFINITIONS for both xform drivers and ip functions
85  *
86  ****************************************************************************
87 \****************************************************************************/
88
89 #define IP_MAX_XFORMS   20      /* Max number of xforms we can handle. */
90
91 /* These bit-values are returned by all transform driver and ip functions.
92  * Zero or more of these bits is set, telling you if anything interesting
93  * happened.
94  */
95 #define IP_READY_FOR_DATA      0X0001u
96 #define IP_PARSED_HEADER       0x0002u
97 #define IP_CONSUMED_ROW        0x0004u
98 #define IP_PRODUCED_ROW        0x0008u
99 #define IP_INPUT_ERROR         0x0010u
100 #define IP_FATAL_ERROR         0x0020u
101 #define IP_NEW_INPUT_PAGE      0x0040u
102 #define IP_NEW_OUTPUT_PAGE     0x0080u
103 #define IP_WRITE_INSERT_OK     0x0100u
104 #define IP_DONE                0x0200u
105
106
107 /* IP_IMAGE_TRAITS describes everything about an image.  If an item is not
108  * known, a negative number is used, meaning "I don't know."  So all items
109  * are signed.
110  */
111 typedef struct {
112     int  iPixelsPerRow;
113     int  iBitsPerPixel;
114     int  iComponentsPerPixel;
115     long lHorizDPI;           /* 32.0 or 16.16 fixed-point */
116     long lVertDPI;            /* 32.0 or 16.16 fixed-point */
117     long lNumRows;
118     int  iNumPages;
119     int  iPageNum;
120 } IP_IMAGE_TRAITS, *PIP_IMAGE_TRAITS, FAR*LPIP_IMAGE_TRAITS;
121
122 typedef union {
123         DWORD dword;
124         PVOID pvoid;
125         __int64 i64;
126         RGBQUAD rgbquad;
127         float fl;
128 } DWORD_OR_PVOID;
129
130 //#ifdef HPIP_INTERNAL
131 #include "xform.h"   // this file uses the above definitions
132 //#else
133 //typedef struct IP_XFORM_TBL_s FAR *LPIP_XFORM_TBL;
134 //#endif
135
136
137 /****************************************************************************\
138  ****************************************************************************
139  *
140  * Definitions for Exported IP Routines
141  *
142  ****************************************************************************
143 \****************************************************************************/
144
145
146 /* Synopsis of the interface:
147  *
148  *    Main routines:
149  *
150  *       ipOpen             - opens a new conversion-job
151  *       ipConvert          - converts some data
152  *       ipClose            - closes the conversion-job
153  *
154  *    Ancillary routines:
155  *
156  *       ipGetFuncPtrs      - loads table with ptrs to these global routines
157  *       ipGetClientDataPtr - returns ptr to client data-area in instance
158  *       ipInsertedData     - client inserted some data in output data stream
159  *       ipGetImageTraits   - returns traits of input and output images
160  */
161
162 /* handle for a conversion job */
163 typedef void FAR*IP_HANDLE, *FAR*PIP_HANDLE, FAR*FAR*LPIP_HANDLE;
164
165 typedef void (WINAPI *LPIP_PEEK_FUNC)(
166     IP_HANDLE         hJob,       /* handle for job making the callback */
167     LPIP_IMAGE_TRAITS pTraits,    /* traits of the data being peeked at */
168     int               nBytes,     /* # bytes in buffer below */
169     LPBYTE            pBuf,       /* data being peeked at */
170     long              nFilePos,   /* file-position where data belongs */
171     PVOID             pUserdata); /* Data passed to the user in peek calls. */ 
172
173
174 /* IP_XFORM - The list of the standard xforms supplied in image processor
175  *
176  * Warning: If the list below changes, you must also change an array in
177  * ipmain.c that is indexed by this enum.
178  */
179 typedef enum {
180     X_FAX_ENCODE,  X_FAX_DECODE,   /* MH, MR and MMR formats */
181     X_PCX_ENCODE,  X_PCX_DECODE,
182     /* X_BMP_ENCODE,  X_BMP_DECODE, */
183     X_JPG_ENCODE,  X_JPG_DECODE, X_JPG_FIX,
184     X_TIF_ENCODE,  X_TIF_DECODE,
185     X_PNM_ENCODE,  X_PNM_DECODE,
186     X_SCALE,
187     X_GRAY_2_BI, X_BI_2_GRAY,
188     X_CNV_COLOR_SPACE,
189     X_Y_EXTRACT,
190     /* X_HEADER, */
191     X_THUMB,
192     X_TABLE,      /* tables are: user1,user3,mirror,gamma,threshold,pass-thru */
193     X_CROP,
194     X_TONEMAP,
195     X_SATURATION,
196     X_ROTATE,
197     X_PAD,
198     X_FAKE_MONO,
199     X_GRAYOUT,
200     X_CHANGE_BPP,
201     X_MATRIX,
202     X_CONVOLVE,
203     X_INVERT,
204     X_SKEL,
205 } IP_XFORM, *PIP_XFORM, FAR*LPIP_XFORM;
206
207
208 #define IP_MAX_XFORM_INFO       8
209
210 /* IP_XFORM_SPEC - Fully specifies an xform
211  * Each transform driver documents what goes into aXformInfo.
212  */
213 typedef struct {
214     LPIP_XFORM_TBL pXform;        /* ptr to jmp-table for xform to do */
215     IP_XFORM       eXform;        /* which xform (used if pXform is NULL) */
216     LPIP_PEEK_FUNC pfReadPeek;    /* callback when xform dvr reads data */
217     LPIP_PEEK_FUNC pfWritePeek;   /* callback when xform dvr writes data */
218     PVOID          pUserData;     /* Data passed to user in peek functions. */
219     DWORD_OR_PVOID aXformInfo[IP_MAX_XFORM_INFO]; /* xform-specific info */
220 } IP_XFORM_SPEC, *PIP_XFORM_SPEC, FAR*LPIP_XFORM_SPEC;
221
222
223
224 /*****************************************************************************\
225  *
226  * ipOpen - Opens a new conversion job
227  *
228  *****************************************************************************
229  *
230  * This routine allocates some instance data, including space for nClientData.
231  * More memory is allocated once row-lengths are such are known.
232  * To deallocate all memory, ipClose must be called.
233  *
234  * The nXforms and pXforms parameters specify the sequence of transforms
235  * to go from input to output.  The handle for the new job is returned
236  * in *pXform.
237  *
238  * A restriction on the list of xforms: the data-flows between xforms must be
239  * fixed-length buffers. This restricts you to raw raster rows between xforms.
240  * The data-flows into and out of ipConvert can be variable-length in nature.
241  *
242  * Return value: IP_DONE=success; IP_FATAL_ERROR=misc error.
243  *
244 \*****************************************************************************/
245
246 EXPORT(WORD) ipOpen (
247     int             nXforms,      /* in:  number of xforms in lpXforms below */
248     LPIP_XFORM_SPEC lpXforms,     /* in:  list of xforms we should perform */
249     int             nClientData,  /* in:  # bytes of additional client data */
250     LPIP_HANDLE     phJob);       /* out: handle for conversion job */
251
252
253
254 /*****************************************************************************\
255  *
256  * ipMirrorBytes - Swaps bits in each byte of buffer
257  *                 (bits 0<->7, 1<->6, etc.)
258  *
259 \*****************************************************************************/
260
261 VOID ipMirrorBytes(PBYTE pbInputBuf,DWORD dwInputAvail);
262
263
264
265 /*****************************************************************************\
266  *
267  * ipConvert - Converts some input data (work-horse function)
268  *
269  *****************************************************************************
270  *
271  * This function consumes input data and produces output data via the
272  * input- and output-buffer parameters.  And it tells you what's happening
273  * via its function return value.
274  *
275  * On entry, pbInputBuf and wInputAvail specify the location and number of
276  * data-bytes in the input buffer.  On return, pwInputUsed tells you how
277  * many of those input bytes were consumed.  pdwInputNextPos tells you
278  * where in the input file you should read next for the following call;
279  * 0 is the beginning of the file.  This is almost always the current file
280  * position plus pwInputUsed; if not, a file-seek is being requested.
281  *
282  * The output buffer parameters are analogous to the input parameters,
283  * except that pdwOutputThisPos tells you where the bytes just output
284  * should be written in the output file.  That is, it applies to *this*
285  * write, not the *next* write, unlike the input arrangement.
286  * The output buffer pointers are allowed to be NULL, in which case
287  * the output is discarded.
288  *
289  * The function return value is a bit-mask that tells you if anything
290  * interesting happened.  Multiple bits can be set.  This information
291  * should be treated as independent of the data-transfers occuring via
292  * the parameters.  The IP_CONSUMED_ROW and IP_PRODUCED_ROW bits can
293  * be used to count how many rows have been input and output.
294  *
295  * The IP_NEW_OUTPUT_PAGE bit is set when or after the last row of the
296  * page has been sent, and before the first row of the following page (if
297  * any) is sent.
298  *
299  * You may wish to insert secret data, such as thumbnails, into the
300  * output stream.  When ipConvert returns the IP_WRITE_INSERT_OK bit,
301  * it is giving you permission to write stuff AFTER you write the output
302  * buffer it gave you.  After adding your secret data, you must call
303  * ipInsertedData to tell us how many bytes were added.
304  *
305  * When there is no more input data, ipConvert must be called repeatedly
306  * with a NULL pbInputBuf parameter, which tells the processor to flush out
307  * any buffered rows.  Keep calling it until it returns the IP_DONE bit.
308  *
309  * Do not call ipConvert again after it has returned either error bit or
310  * IP_DONE.
311  *
312  * At any time after ipConvert returns the IP_PARSED_HEADER bit,
313  * ipGetImageTraits may be called to obtain the input and output traits.
314  * IP_PARSED_HEADER is returned in *every* call after the header was parsed.
315  *
316  * Return value:  Zero or more of these bits may be set:
317  *
318  *     IP_PARSED_HEADER    = input header has been parsed; traits are known
319  *     IP_CONSUMED_ROW     = an input row was parsed
320  *     IP_PRODUCED_ROW     = an output row was produced
321  *     IP_INPUT_ERROR      = syntax error in input data
322  *     IP_FATAL_ERROR      = misc error (internal error or bad param)
323  *     IP_NEW_INPUT_PAGE   = just encountered end of page on input
324  *     IP_NEW_OUTPUT_PAGE  = just finished outputting a page
325  *     IP_WRITE_INSERT_OK  = okay to insert data in output file
326  *     IP_DONE             = conversion is completed.
327  *
328 \*****************************************************************************/
329
330 EXPORT(WORD) ipConvert (
331     IP_HANDLE   hJob,              /* in:  handle to conversion job */
332     DWORD       dwInputAvail,      /* in:  # avail bytes in input buf */
333     LPBYTE      pbInputBuf,        /* in:  ptr to input buffer */
334     LPDWORD     pdwInputUsed,      /* out: # bytes used from input buf */
335     LPDWORD     pdwInputNextPos,   /* out: file-pos to read from next */
336     DWORD       dwOutputAvail,     /* in:  # avail bytes in output buf */
337     LPBYTE      pbOutputBuf,       /* in:  ptr to output buffer */
338     LPDWORD     pdwOutputUsed,     /* out: # bytes written in out buf */
339     LPDWORD     pdwOutputThisPos); /* out: file-pos to write this data */
340
341
342
343 /*****************************************************************************\
344  *
345  * ipClose - Destroys the given conversion job
346  *
347  *****************************************************************************
348  *
349  * This routine deallocates all memory associated with the given conversion
350  * job.  It may be called at any time, which is how you do an abort.
351  *
352  * Return value: IP_DONE=success; IP_FATAL_ERROR=misc error.
353  *
354 \*****************************************************************************/
355
356 EXPORT(WORD) ipClose (
357     IP_HANDLE hJob);     /* in:  handle to conversion job */
358
359
360 /****************************************************************************\
361  *
362  * ipResultMask - Selects bit-results to be returned by ipConvert
363  *
364  ****************************************************************************
365  *
366  * The mask parameter is the OR of the IP_... bits you want returned by
367  * calls to ipConvert.  A 1 means you want that bit; 0 means you don't.
368  * By disabling frequently-returned bits, efficiency will improve because
369  * fewer ipConvert calls will be made because each call can do more work.
370  * 
371  * The mask is all zeroes by default.  The IP_DONE, IP_FATAL_ERROR, and
372  * IP_INPUT_ERROR bits are always enabled, regardless of their bit-values
373  * in the mask.
374  *
375 \*****************************************************************************/
376
377 EXPORT(WORD) ipResultMask (
378     IP_HANDLE hJob,     /* in:  handle to conversion job */
379     WORD      wMask);   /* in:  result bits you are interested in */
380
381
382 /*****************************************************************************\
383  *
384  * ipGetClientDataPtr - Returns ptr to client's data in conversion instance
385  *
386  *****************************************************************************
387  *
388  * ipOpen accepts an nClientData parameter which is the number of extra bytes
389  * we allocate for the client for his own use.  This function returns the
390  * pointer to that memory in the given conversion instance.
391  *
392  * Return value: IP_DONE=success; IP_FATAL_ERROR=misc error.
393  *
394 \*****************************************************************************/
395
396 EXPORT(WORD) ipGetClientDataPtr (
397     IP_HANDLE     hJob,            /* in:  handle to conversion job */
398     LPVOID    FAR*ppvClientData);  /* out: ptr to client's memory area */
399
400
401
402 /*****************************************************************************\
403  *
404  * ipSetDefaultInputTraits - Specifies default input image traits
405  *
406  *****************************************************************************
407  *
408  * The header of the file-type handled by the first transform might not
409  * include *all* the image traits we'd like to know.  Those not specified
410  * in the file-header are filled in from info provided by this routine.
411  *
412  * Return value: IP_DONE=success; IP_FATAL_ERROR=misc error.
413  *
414 \*****************************************************************************/
415
416 EXPORT(WORD) ipSetDefaultInputTraits (
417     IP_HANDLE         hJob,      /* in: handle to conversion job */
418     LPIP_IMAGE_TRAITS pTraits);  /* in: default image traits */
419
420
421
422 /*****************************************************************************\
423  *
424  * ipGetOutputTraits - Returns the output traits before ipConvert is called
425  *
426  *****************************************************************************
427  *
428  * If the first xform does not have a header, then you can call this function
429  * *after* calling ipSetDefaultInputTraits to get the output image traits.
430  * Ordinarily, you'd have to call ipConvert a few times and wait until it tells
431  * you that the (non-existent) header has been parsed.  But if you need the
432  * output traits before calling ipConvert, this function will return them.
433  *
434  * Return value: IP_DONE=success; IP_FATAL_ERROR=misc error.
435  *
436 \*****************************************************************************/
437
438 EXPORT(WORD) ipGetOutputTraits (
439     IP_HANDLE         hJob,      /* in:  handle to conversion job */
440     LPIP_IMAGE_TRAITS pTraits);  /* out: output image traits */
441
442
443
444 /*****************************************************************************\
445  *
446  * ipGetImageTraits - Returns traits of input and output images
447  *
448  *****************************************************************************
449  *
450  * At any time after ipConvert has returned the IP_PARSED_HEADER bit, this
451  * function may be called to obtain the traits of the input and output images.
452  * If a pointer parameter is NULL, that traits record is not returned.
453  *
454  * After the conversion job is done, these traits will contain the actual
455  * number of rows input and output.
456  *
457  * Return value: IP_DONE=success; IP_FATAL_ERROR=misc error.
458  *
459 \*****************************************************************************/
460
461 EXPORT(WORD) ipGetImageTraits (
462     IP_HANDLE         hJob,           /* in:  handle to conversion job */
463     LPIP_IMAGE_TRAITS pInputTraits,   /* out: traits of input image */
464     LPIP_IMAGE_TRAITS pOutputTraits); /* out: traits of output image */
465
466
467
468 /*****************************************************************************\
469  *
470  * ipInsertedData - Client inserted some bytes into our output stream
471  *
472  *****************************************************************************
473  *
474  * After ipConvert returns the IP_WRITE_INSERT_OK bit, and after the client
475  * writes out the output buffer, he is permitted to write out some additional
476  * data for his own use, such as a thumbnail image.  After writing the added
477  * data, the client calls this function to tell us how much data he wrote.
478  *
479  * Return value: IP_DONE=success; IP_FATAL_ERROR=misc error.
480  *
481 \*****************************************************************************/
482
483 EXPORT(WORD) ipInsertedData (
484     IP_HANDLE hJob,         /* in: handle to conversion job */
485     DWORD     dwNumBytes);  /* in: # of bytes of additional data written */
486
487
488
489 /*****************************************************************************\
490  *
491  * ipOverrideDPI - Force a different DPI to be reported in the output
492  *
493  *****************************************************************************
494  *
495  * The values supplied only change the DPI that's *reported* in the output
496  * traits and in the header (if any) of the output file.  These DPI values
497  * do *not* affect the transforms, and do *not* affect or change any scaling.
498  *
499  * The image processor code supplies these values in the input traits of
500  * the last transform in the list of transforms so that they'll make it
501  * in the output file header.
502  *
503  * The DPI values are in fixed-point with 16 bits of fraction.  A value of
504  * 0 means "no override; use the normal value".
505  *
506  * Return value: IP_DONE=success; IP_FATAL_ERROR=misc error.
507  *
508 \*****************************************************************************/
509
510 EXPORT(WORD) ipOverrideDPI (
511     IP_HANDLE hJob,        /* in: handle to conversion job */
512     DWORD     dwHorizDPI,  /* in: horiz DPI as 16.16; 0 means no override */
513     DWORD     dwVertDPI);  /* in: vert  DPI as 16.16; 0 means no override */
514
515
516
517 /*****************************************************************************\
518  *
519  * ipGetFuncPtrs - Loads jump-table with pointers to the ip entry points
520  *
521  *****************************************************************************
522  *
523  * This function loads a jump-table (typedef'ed below) for your convenience
524  * so you won't have to call GetProcAddress on every function.
525  *
526  * Return value: IP_DONE=success; IP_FATAL_ERROR=misc error.
527  *
528 \*****************************************************************************/
529
530 /*****************************************************************************\
531  *
532  * ipGetXformTable - Returns ptr to IP_XFORM_TBL for transform.
533  *
534  *****************************************************************************
535  *
536  *
537  * Return value: IP_DONE=success; IP_FATAL_ERROR=misc error.
538  *
539 \*****************************************************************************/
540
541 EXPORT(WORD) ipGetXformTable (LPIP_XFORM_TBL phXform);
542
543
544
545 /*** Prototype for ipGetFuncPtrs function ***/
546 typedef WORD (WINAPI *IPOPEN)             (int, LPIP_XFORM_SPEC, 
547                                            int, LPIP_HANDLE);
548 typedef WORD (WINAPI *IPCONVERT)          (IP_HANDLE, DWORD, LPBYTE,    
549                                            LPDWORD, LPDWORD, DWORD,      
550                                            LPBYTE, LPDWORD, LPDWORD);   
551 typedef WORD (WINAPI *IPCLOSE)            (IP_HANDLE);
552 typedef WORD (WINAPI *IPGETCLIENTDATAPTR) (IP_HANDLE, LPVOID FAR *);
553 typedef WORD (WINAPI *IPRESULTMASK)       (IP_HANDLE, WORD);
554 typedef WORD (WINAPI *IPSETDEFAULTINPUTTRAITS) (IP_HANDLE,
555                                                 LPIP_IMAGE_TRAITS);
556 typedef WORD (WINAPI *IPGETIMAGETRAITS)   (IP_HANDLE,
557                                            LPIP_IMAGE_TRAITS, 
558                                            LPIP_IMAGE_TRAITS);
559 typedef WORD (WINAPI *IPINSERTEDDATA)     (IP_HANDLE, DWORD);
560 typedef WORD (WINAPI *IPOVERRIDEDPI)      (IP_HANDLE, DWORD, DWORD);
561
562 typedef WORD (WINAPI *IPGETXFORMTABLE)    (LPIP_XFORM_TBL);
563
564 typedef WORD (WINAPI *IPGETOUTPUTTRAITS)  (IP_HANDLE,
565                                            LPIP_IMAGE_TRAITS);
566
567 typedef struct {
568     WORD                    wStructSize;   /* # of bytes in this struct */
569     IPOPEN                  ipOpen;
570     IPCONVERT               ipConvert;
571     IPCLOSE                 ipClose;
572     IPGETCLIENTDATAPTR      ipGetClientDataPtr;
573     IPRESULTMASK            ipResultMask;
574     IPSETDEFAULTINPUTTRAITS ipSetDefaultInputTraits;
575     IPGETIMAGETRAITS        ipGetImageTraits;
576     IPINSERTEDDATA          ipInsertedData;
577     IPOVERRIDEDPI           ipOverrideDPI;
578     IPGETOUTPUTTRAITS       ipGetOutputTraits;
579 } IP_JUMP_TBL, * PIP_JUMP_TBL, FAR * LPIP_JUMP_TBL;
580
581 /*** Prototype for ipGetFuncPtrs function ***/
582 typedef WORD (WINAPI *LPFNIPGETFUNCPTRS)  (LPIP_JUMP_TBL);
583
584 EXPORT(WORD) ipGetFuncPtrs (LPIP_JUMP_TBL lpJumpTbl);
585
586 /****************************************************************************\
587  ****************************************************************************
588  *
589  * OPTION DEFINITIONS for xform drivers
590  *
591  ****************************************************************************
592 \****************************************************************************/
593
594 /* xbi2gray.h */
595
596 /* This .h file contains symbols for the transform in the corresponding .c file.
597  * See that .c file for instructions on using this transform.
598  */
599
600 #define IP_BI_2_GRAY_OUTPUT_BPP         0
601 #define IP_BI_2_GRAY_WHITE_PIXEL        1
602 #define IP_BI_2_GRAY_BLACK_PIXEL        2
603
604
605 #if 0
606
607 /* xbmp.h */
608
609 /* This .h file contains symbols for the transform in the corresponding .c file.
610  * See that .c file for instructions on using this transform.
611  */
612
613 #define IP_BMP_NEGATIVE_HEIGHT          0
614
615 #endif
616
617
618 /* xchgbpp.h */
619
620 /* This .h file contains symbols for the transform in the corresponding .c file.
621  * See that .c file for instructions on using this transform.
622  */
623
624 #define IP_CHANGE_BPP_OUTPUT_BPP        0
625
626
627 /* xcolrspc.h */
628
629 /* This .h file contains symbols for the transform in the corresponding .c file.
630  * See that .c file for instructions on using this transform.
631  */
632
633 #define IP_CNV_COLOR_SPACE_WHICH_CNV    0
634 #define IP_CNV_COLOR_SPACE_GAMMA        1
635
636 /* The following conversions are possible: */
637
638 typedef enum {
639     IP_CNV_YCC_TO_CIELAB = 0,
640     IP_CNV_CIELAB_TO_YCC = 1,
641     IP_CNV_YCC_TO_SRGB   = 2,
642     IP_CNV_SRGB_TO_YCC   = 3,
643     IP_CNV_LHS_TO_SRGB   = 4,
644     IP_CNV_SRGB_TO_LHS   = 5,
645     IP_CNV_BGR_SWAP      = 100
646 } IP_WHICH_CNV;
647
648
649 /* xconvolve.h */
650
651 /* This .h file contains symbols for the transform in the corresponding .c file.
652  * See that .c file for instructions on using this transform.
653  */
654
655 #define IP_CONVOLVE_NROWS    0
656 #define IP_CONVOLVE_NCOLS    1
657 #define IP_CONVOLVE_MATRIX   2
658 #define IP_CONVOLVE_DIVISOR  3
659
660 #define IP_CONVOLVE_MAXSIZE  9  /* up to 9x9 matrix */
661
662
663 /* xcrop.h */
664
665 /* This .h file contains symbols for the transform in the corresponding .c file.
666  * See that .c file for instructions on using this transform.
667  */
668
669 #define IP_CROP_LEFT            0
670 #define IP_CROP_RIGHT           1
671 #define IP_CROP_TOP             2
672 #define IP_CROP_MAXOUTROWS      3
673
674
675 /* xfakemono.h */
676
677 /* This .h file contains symbols for the transform in the corresponding .c file.
678  * See that .c file for instructions on using this transform.
679  */
680
681 #define IP_FAKE_MONO_BPP        0
682
683
684 /* xfax.h */
685
686 /* This .h file contains symbols for the transform in the corresponding .c file.
687  * See that .c file for instructions on using this transform.
688  */
689
690 #define IP_FAX_FORMAT           0
691 #define IP_FAX_NO_EOLS          1
692 #define IP_FAX_MIN_ROW_LEN      2
693
694 enum {IP_FAX_MH, IP_FAX_MR, IP_FAX_MMR};
695
696
697 /* xgray2bi.h */
698
699 /* This .h file contains symbols for the transform in the corresponding .c file.
700  * See that .c file for instructions on using this transform.
701  */
702
703 #define IP_GRAY_2_BI_THRESHOLD  0
704
705
706 /* xgrayout.h */
707
708 /* This .h file contains symbols for the transform in the corresponding .c file.
709  * See that .c file for instructions on using this transform.
710  */
711
712 #define IP_GRAYOUT_LEFT         0
713 #define IP_GRAYOUT_RIGHT        1
714 #define IP_GRAYOUT_TOP          2
715 #define IP_GRAYOUT_BOTTOM       3
716
717
718 #if 0
719
720 /* xheader.h */
721
722 /* xheader.h - aXformInfo[0] struct given to xheader.c, the header generator
723  *
724  * Mark Overton, March 1998
725  */
726
727 #define IP_HEADER_SPEC  0
728
729 /* aXformInfo[IP_HEADER_SPEC] shall be a pointer pointing to this: */
730
731 typedef struct {
732     PSTR    pszLeftStr;    // ptr to left-justified string; 0 -> none
733     PSTR    pszCenterStr;  // ptr to centered string; 0 -> none
734     PSTR    pszRightStr;   // ptr to right-justified string; 0 -> none
735     WORD    wCharSet;      // character set (may be a two-byte set)
736     PSTR    pszTypeFace;   // ptr to name of typeface (required)
737     float   fHeightPoints; // point-size of font
738     float   fMarginPoints; // left and right margin, in points
739     BOOL    bOverlay;      // 0=append header, 1=overlay it on top of page
740     RGBQUAD rgbWhite;      // a white pixel
741     RGBQUAD rgbBlack;      // a black pixel
742 } __attribute__((packed)) XHEADER_SPEC, *PXHEADER_SPEC, FAR*LPXHEADER_SPEC;
743
744 /* A header is one line of text appearing at the top of faxes.  This is known
745  * as a "TTI" in faxland.  We implement this as a left-justified portion, a
746  * centered portion, and a right-justified portion.  All three portions are
747  * optional.
748  *
749  * Note that xheader.c copies over the string fields in the struct. Therefore,
750  * those strings may go away after the call to cvtOpen.
751  *
752  * The bOverlay field controls whether the header is concatenated
753  * to the top of the page (0), or overlays the top of the page (1).
754  *
755  * xheader.c needs to know what values to use for white and black pixels,
756  * so rgbWhite and rgbBlack are a white pixel and black pixel repectively.
757  * If the page data is gray (8 bits/pixel), only the rgbRed field is used.
758  * If the page data is bilevel, then only the least significant bit of rgbRed
759  * is used.
760  */
761 #endif
762
763
764 /* xjpg.h */
765
766 /* This .h file contains symbols xjpg_dec.c and xjpg_enc.c
767  * See those .c files for instructions on using these transforms.
768  */
769
770 /* Specifications for decoder: */
771
772 #define IP_JPG_DECODE_OUTPUT_SUBSAMPLED 0
773 #define IP_JPG_DECODE_FROM_DENALI       1
774
775 /* Specifications for encoder: */
776
777 #define IP_JPG_ENCODE_QUALITY_FACTORS           0
778 #define IP_JPG_ENCODE_SAMPLE_FACTORS            1
779 #define IP_JPG_ENCODE_ALREADY_SUBSAMPLED        2
780 #define IP_JPG_ENCODE_FOR_DENALI                3
781 #define IP_JPG_ENCODE_OUTPUT_DNL                4
782 #define IP_JPG_ENCODE_FOR_COLOR_FAX             5
783 #define IP_JPG_ENCODE_DUMMY_HEADER_LEN          6
784
785
786 /* xpad.h */
787
788 /* This .h file contains symbols for the transform in the corresponding .c file.
789  * See that .c file for instructions on using this transform.
790  */
791
792 #define IP_PAD_LEFT             0
793 #define IP_PAD_RIGHT            1
794 #define IP_PAD_TOP              2
795 #define IP_PAD_BOTTOM           3
796 #define IP_PAD_VALUE            4
797 #define IP_PAD_MIN_HEIGHT       5
798
799
800 /* xrotate.h */
801
802 /* This .h file contains symbols for the transform in the corresponding .c file.
803  * See that .c file for instructions on using this transform.
804  */
805
806 #define IP_ROTATE_UPPER_LEFT    0
807 #define IP_ROTATE_UPPER_RIGHT   1
808 #define IP_ROTATE_LOWER_LEFT    2
809 #define IP_ROTATE_OUTPUT_SIZE   3
810 #define IP_ROTATE_FAST          4
811
812
813 /* xsaturation.h */
814
815 /* This .h file contains symbols for the transform in the corresponding .c file.
816  * See that .c file for instructions on using this transform.
817  */
818
819 #define IP_SATURATION_FACTOR    0
820
821
822 /* xscale.h */
823
824 /* This .h file contains symbols for the transform in the corresponding .c file.
825  * See that .c file for instructions on using this transform.
826  */
827
828 #define IP_SCALE_HORIZ_FACTOR   0
829 #define IP_SCALE_VERT_FACTOR    1
830 #define IP_SCALE_FAST           2
831
832
833 /* xskel.h */
834
835 /* This .h file contains symbols for the transform in the corresponding .c file.
836  * See that .c file for instructions on using this transform.
837  */
838
839 #define IP_SKEL_SPEC_1          0
840 #define IP_SKEL_SPEC_2          1
841
842
843 /* xtable.h */
844
845 /* This .h file contains symbols for the transform in the corresponding .c file.
846  * See that .c file for instructions on using this transform.
847  */
848
849 #define IP_TABLE_WHICH  0
850 #define IP_TABLE_OPTION 1
851
852 #define IP_TABLE_COLOR_1   1
853 #define IP_TABLE_COLOR_2   2
854 #define IP_TABLE_COLOR_3   3
855
856 typedef enum {
857     IP_TABLE_USER,
858     IP_TABLE_PASS_THRU,
859     IP_TABLE_GAMMA,
860     IP_TABLE_THRESHOLD,
861     IP_TABLE_MIRROR,
862     IP_TABLE_USER_THREE,
863     IP_TABLE_BW_CLIP,
864     IP_TABLE_USER_WORD,
865     IP_TABLE_USER_THREE_WORD
866 } IP_TABLE_TYPE;
867
868
869 /* xthumb.h */
870
871 /* This .h file contains symbols for the transform in the corresponding .c file.
872  * See that .c file for instructions on using this transform.
873  */
874
875 #define IP_THUMB_SCALE_SPEC  0
876
877
878 /* xtiff.h */
879
880 /* This .h file contains symbols for the transform in the corresponding .c file.
881  * See that .c file for instructions on using this transform.
882  */
883
884 #define IP_TIFF_FILE_PATH       0
885
886
887 /* xtonemap.h */
888
889 /* This .h file contains symbols for the transform in the corresponding .c file.
890  * See that .c file for instructions on using this transform.
891  */
892
893 #define IP_TONEMAP_POINTER      0
894 #define IP_TONEMAP_LUM_SPACE    1
895
896
897 /* xyxtract.h */
898
899 /* This .h file contains symbols for the transform in the corresponding .c file.
900  * See that .c file for instructions on using this transform.
901  */
902
903 #define IP_Y_EXTRACT_COLOR_SPACE        0
904
905 typedef enum {
906    IP_Y_EXTRACT_LUM_CHROME,
907    IP_Y_EXTRACT_RGB,
908    IP_Y_EXTRACT_BGR
909 } IP_Y_EXTRACT_WHICH_SPACE;
910
911 #if defined(__cplusplus)
912         }
913 #endif
914
915 #endif
916
917
918 /* End of File */