1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
18 //============================================================================
19 //==== Titre: AlienImage_GIFLZWDict.hxx
20 //============================================================================
22 #ifndef _AlienImage_GIFLZWDict_HeaderFile
23 #define _AlienImage_GIFLZWDict_HeaderFile
25 //==== Definition de Type ====================================================
26 #include <Standard_Type.hxx>
27 const Handle(Standard_Type)& STANDARD_TYPE(AlienImage_GIFLZWDict);
29 //============================================================================
30 #include <OSD_File.hxx>
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;
40 typedef unsigned char* PBYTE;
44 #undef NOGDI /* we need GDI definitions here... */
49 #if defined(__alpha) || defined(DECOSF1) || defined(WNT)
50 # define SWAP_WORD(__w) (__w)
51 # define SWAP_DWORD(__w) (__w)
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) )
60 #define MAX_CODE ( ( 1 << NBITS ) - 1 )
66 //=============================================================================
67 // Functions and structs to write GIF image to file.
68 //=============================================================================
69 extern int _lzw_encode (OSD_File&, const BYTE*, int, int, int);
90 } AlienImage_GIFLZWDict;
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 ) )
106 } RGBQUAD, *LPRGBQUAD;
111 BOOL __fastcall _convert24to8 (LPRGBQUAD, PBYTE, PBYTE, int, int);
113 #endif // _AlienImage_GIFLZWDict_HeaderFile