Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / DtHelp / il / iljpgdecodeint.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: iljpgdecodeint.h /main/3 1995/10/23 15:54:54 rswiston $ */
24 /**---------------------------------------------------------------------
25 ***     
26 ***    (c)Copyright 1992 Hewlett-Packard Co.
27 ***    
28 ***                             RESTRICTED RIGHTS LEGEND
29 ***    Use, duplication, or disclosure by the U.S. Government is subject to
30 ***    restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
31 ***    Technical Data and Computer Software clause in DFARS 252.227-7013.
32 ***                             Hewlett-Packard Company
33 ***                             3000 Hanover Street
34 ***                             Palo Alto, CA 94304 U.S.A.
35 ***    Rights for non-DOD U.S. Government Departments and Agencies are as set
36 ***    forth in FAR 52.227-19(c)(1,2).
37 ***
38 ***-------------------------------------------------------------------*/
39
40 #ifndef ILJPGDECODEINT_H
41 #define ILJPGDECODEINT_H
42
43 #ifndef ILJPGDECODE_H
44 #include "iljpgdecode.h"
45 #endif
46
47 #ifndef ILJPGINT_H
48 #include "iljpgint.h"
49 #endif
50
51     /*  Codes returned from _iljpgHuffmanDecode() indicating which coefficients
52         of the 8x8 block are non-zero.
53     */
54 #define HUFF_DC_ONLY        0           /* only DCT non-zero */
55 #define HUFF_FOURX4         1           /* only top-left 4x4 matrix non-zero */
56 #define HUFF_FULL           2           /* "whole" 8x8 non-zero */
57
58
59     /*  Private data for decoding JPEG (not JIF), e.g. 
60         _iljpgDecodeInit/Execute/Cleanup().
61     */
62
63 typedef struct {
64     float          *pRevScale;              /* built from DCT Q table */
65     int             horiFactor, vertFactor; /* copied from iljpgDataRec */
66     long            width, height;          /* size of output buffer */
67     int             mcuXInc, mcuYInc;       /* value to inc (x,y) by, each MCU */
68     long            x, y;                   /* where to store next MCU */
69     int             lastDC;                 /* DC from previous 8x8 block */
70     } iljpgCompRec, *iljpgCompPtr;
71
72 typedef struct {
73     iljpgDataPtr        pData;              /* data passed to _iljpgDecodeInit() */
74     int                 mcuRestartCount;    /* # of mcu's since last restart */
75     iljpgPtr            pHuffPriv;          /* owned by iljpgdehuff.c */
76     float              *DCTRevScaleTables[4];       /* owned by iljpgdedct.c */
77     iljpgCompRec        compData[ILJPG_MAX_COMPS];  /* owned by iljpgdecode.c */
78     } iljpgDecodePrivRec, *iljpgDecodePrivPtr;
79
80
81     /*  Functions in iljpgdehuff.c */
82     ILJPG_PRIVATE_EXTERN
83 iljpgError _iljpgDehuffInit (
84     iljpgDecodePrivPtr  pPriv
85     );
86
87     ILJPG_PRIVATE_EXTERN
88 iljpgError _iljpgDehuffCleanup (
89     iljpgDecodePrivPtr  pPriv
90     );
91
92     ILJPG_PRIVATE_EXTERN
93 iljpgError _iljpgDehuffReset (
94     iljpgDecodePrivPtr  pPriv
95     );
96
97     ILJPG_PRIVATE_EXTERN
98 iljpgError _iljpgDehuffExecute (
99     iljpgDecodePrivPtr  pPriv,
100     ILJPG_DECODE_STREAM stream,
101     int                 comp,
102     int                *pOut,
103     unsigned int       *pBlockType
104     );
105
106     /*  Functions in iljpgdedct.c */
107     ILJPG_PRIVATE_EXTERN
108 iljpgError _iljpgDeDCTInit (
109     iljpgDecodePrivPtr  pPriv
110     );
111
112     ILJPG_PRIVATE_EXTERN
113 iljpgError _iljpgDeDCTCleanup (
114     iljpgDecodePrivPtr  pPriv
115     );
116
117     ILJPG_PRIVATE_EXTERN
118 void _iljpgDeDCTFull (
119     int                *pSrc,
120     long                nBytesPerRow,
121     iljpgPtr            ix,                 /* RETURNED */
122     float              *pRevScale
123     );
124
125     ILJPG_PRIVATE_EXTERN
126 void _iljpgDeDCT4x4 (
127     int                *pSrc,
128     long                nBytesPerRow,
129     iljpgPtr            ix,                 /* RETURNED */
130     float              *pRevScale
131     );
132
133     ILJPG_PRIVATE_EXTERN
134 void _iljpgDeDCTDCOnly (
135     int                *pSrc,
136     long                nBytesPerRow,
137     iljpgPtr            pDst,               /* RETURNED */
138     float              *pRevScale
139     );
140
141 #endif