4 // header file for the BMGLib DLL
5 // This DLL encapsulates the libTIFF library, libJPEG library,
6 // libPNG library, and the GeoTIFF library.
8 // Copyright 2000, 2001 M. Scott Heiman
10 // libTIFF is Copyright Sam Leffler and SGI
11 // libJPEG is Copyright (C) 1991-1998, Thomas G. Lane and is part of the
12 // Independent JPEG Group's software.
13 // libPNG is Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
14 // (libpng versions 0.5, May 1995, through 0.89c, May 1996)
15 // Copyright (c) 1996, 1997 Andreas Dilger
16 // (libpng versions 0.90, December 1996, through 0.96, May 1997)
17 // Copyright (c) 1998, 1999 Glenn Randers-Pehrson
18 // (libpng versions 0.97, January 1998, through 1.0.5, October 15, 1999)
19 // zLib Copyright (C) 1995-1998 Jean-loup Gailly.
20 // GeoTIFF is Copyright (c) 1999, Frank Warmerdam
21 // libPROJ (used by GeoTIFF) is Copytight (c) 2000, Frank Warmerdam
22 // libUnGif is Copyright (c) 1997, Eric S. Raymond
24 // You may use the software for any purpose you see fit. You may modify
25 // it, incorporate it in a commercial application, use it for school,
26 // even turn it in as homework. You must keep the Copyright in the
27 // header and source files. This software is not in the "Public Domain".
28 // You may use this software at your own risk. I have made a reasonable
29 // effort to verify that this software works in the manner I expect it to;
32 // THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND
33 // WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING
34 // WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A
35 // PARTICULAR PURPOSE. IN NO EVENT SHALL MICHAEL S. HEIMAN BE LIABLE TO
36 // YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR
37 // CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING
38 // WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE,
39 // OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT MICHAEL S. HEIMAN HAS
40 // BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
41 // ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
42 // POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
50 #if defined(__cplusplus)
54 /* returns a BITMAPINFO structure with the given height, width,
55 bit count, and compression scheme. This structure DOES NOT contain any
56 palette information (bmiColors = NULL) */
58 BITMAPINFO CreateBMI( unsigned int dwWidth, /* width in pixels */
59 unsigned int dwHeight, /* height in pixels */
60 unsigned short wBitCount, /* 1, 4, 8, 16, 24, & 32 */
61 int compression ); /* biCompression value */
63 /* returns an array of RGBA or BGRA values for all supported graphics file
64 formats. The RGBA pixel format is supported by all versions of OpenGL.
65 The BGRA format is an extension supported by may OpenGL vendors. */
67 BMGError GetUnpackedArray( const char *filename,
73 /* Saves an array of RGB, RGBA, BGR, and BGRA values to a file. The RGB and RGBA
74 pixel formats are supported by OpenGL. The BGR and BGRA extensions are
75 supported by many OpenGL vendors */
77 BMGError SaveUnpackedArray( const char *filename,
78 unsigned char bytes_per_pixel,
84 /* saves the contents of an HBITMAP to a file. The extension of the file name
85 // determines the file type. returns 1 if successfull, 0 otherwise */
87 BMGError SaveBitmapToFile( HBITMAP hBitmap, /* bitmap to be saved */
88 const char *filename, /* name of output file */
91 /* Creates an HBITMAP to an image file. The extension of the file name
92 // determines the file type. returns an HBITMAP if successfull, NULL
95 HBITMAP CreateBitmapFromFile( const char *filename,
99 /* extracts a BMGImageStruct from any one of the supported image files */
101 BMGError GetDataFromFile( const char *filename,
102 struct BMGImageStruct *img,
105 /* the following functions will read/write image files using raw data */
107 BMGError ReadRGB( const char *filename,
108 struct BMGImageStruct *img );
111 BMGError WriteRGB( const char *filename,
112 struct BMGImageStruct img );
115 BMGError ReadTGA( const char *filename,
116 struct BMGImageStruct *img );
119 BMGError WriteTGA( const char *filename,
120 struct BMGImageStruct img );
123 BMGError ReadBMP( const char *filename,
124 struct BMGImageStruct *img );
127 BMGError WriteBMP( const char *filename,
128 struct BMGImageStruct img );
131 BMGError ReadCEL( const char *filename,
132 struct BMGImageStruct *img );
135 BMGError ReadGIF( const char *filename,
136 struct BMGImageStruct *img );
139 BMGError ReadPSD( const char *filename,
140 struct BMGImageStruct *img );
143 BMGError ReadIFF( const char *filename,
144 struct BMGImageStruct *img );
147 BMGError ReadPCX( const char *filename,
148 struct BMGImageStruct *img );
150 #if defined(__cplusplus)