0023024: Update headers of OCCT files
[occt.git] / src / AlienImage / AlienImage_GIFLZWDict.hxx
1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
2 //
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
7 //
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10 //
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
17
18 //============================================================================
19 //==== Titre: AlienImage_GIFLZWDict.hxx
20 //============================================================================
21
22 #ifndef _AlienImage_GIFLZWDict_HeaderFile
23 #define _AlienImage_GIFLZWDict_HeaderFile
24
25 //==== Definition de Type ====================================================
26 #include <Standard_Type.hxx>
27 const Handle(Standard_Type)& STANDARD_TYPE(AlienImage_GIFLZWDict);
28
29 //============================================================================
30 #include <OSD_File.hxx>
31
32 #ifndef WNT
33 typedef unsigned int   DWORD; // 32-bit signed
34 typedef int            LONG;  // 32-bit unsigned
35 typedef unsigned int   ULONG, UINT; // 32-bit signed
36 typedef unsigned short WORD;  // 16-bit unsigned
37 typedef unsigned char  BYTE;  // 8-bit unsigned
38 typedef unsigned int   BOOL;
39 typedef int*           PINT;
40 typedef unsigned char* PBYTE;
41 typedef void*          LPVOID;
42 #else
43 #ifdef NOGDI
44 #undef NOGDI /* we need GDI definitions here... */
45 #endif
46 # include <windows.h>
47 #endif
48
49 #if defined(__alpha)  || defined(DECOSF1) || defined(WNT)
50 #  define SWAP_WORD(__w)  (__w)
51 #  define SWAP_DWORD(__w)  (__w)
52 #else
53 #  define SWAP_WORD(__w) ((((__w)&0xFF) << 8) | (((__w)&0xFF00) >> 8))
54 #  define SWAP_DWORD(__w) ((((__w)&0x000000FF) << 24) | (((__w)&0x0000FF00) << 8) \
55          |  (((__w)&0xFF0000) >> 8)  |  (((__w)&0xFF000000) >> 24)  )
56 #endif
57
58 #define NBITS     12
59 #define TBL_SIZE  5021
60 #define MAX_CODE  (  ( 1 << NBITS ) - 1  )
61 #define BUFF_SIZE 255
62 #define UNUSED -1
63 #define TRUE 1
64 #define FALSE 0
65
66 //=============================================================================
67 // Functions and structs to write GIF image to file.
68 //=============================================================================
69 extern int _lzw_encode (OSD_File&, const BYTE*, int, int, int);
70
71 typedef struct {
72   char gifID[ 6 ];
73   WORD scrnWidth;
74   WORD scrnHeight;
75   BYTE scrnFlag;
76 } SCREEN_DESCR;
77
78 typedef struct {
79   WORD imgX;
80   WORD imgY;
81   WORD imgWidth;
82   WORD imgHeight;
83   BYTE imgFlag;
84 } IMAGE_DESCR;
85
86 typedef struct {
87   int code;
88   int prnt;
89   BYTE byte;
90 } AlienImage_GIFLZWDict;
91
92 //=============================================================================
93 // Functions to convert from 24 to 8 color image
94 //=============================================================================
95 #define PAD(a)     (   ( a ) % sizeof ( LONG ) ?                         \
96                     sizeof ( LONG ) - (  ( a ) % sizeof ( LONG )  ) : 0  )
97 #define MALLOC(s) calloc (  ( s ), 1  )
98 #define FREE(p)   free   (  ( p )     )
99
100 #ifndef WNT
101 typedef struct {
102   BYTE rgbBlue;
103   BYTE rgbGreen;
104   BYTE rgbRed;
105   BYTE rgbReserved;
106 } RGBQUAD, *LPRGBQUAD;
107
108 #define __fastcall
109 #endif // WNT
110
111 BOOL __fastcall _convert24to8 (LPRGBQUAD, PBYTE, PBYTE, int, int);
112
113 #endif // _AlienImage_GIFLZWDict_HeaderFile
114