2003-11-25 21:49:16 +08:00
|
|
|
/*
|
2006-12-10 05:33:38 +08:00
|
|
|
* GIMP - The GNU Image Manipulation Program
|
2003-11-25 21:49:16 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2003-11-25 21:49:16 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2003-11-25 21:49:16 +08:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2003-11-25 21:49:16 +08:00
|
|
|
*/
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2008-08-12 03:42:08 +08:00
|
|
|
#ifndef __BMP_H__
|
|
|
|
#define __BMP_H__
|
|
|
|
|
|
|
|
#define LOAD_PROC "file-bmp-load"
|
|
|
|
#define SAVE_PROC "file-bmp-save"
|
|
|
|
#define PLUG_IN_BINARY "file-bmp"
|
2011-04-09 02:31:34 +08:00
|
|
|
#define PLUG_IN_ROLE "gimp-file-bmp"
|
2006-08-16 01:35:00 +08:00
|
|
|
|
2003-11-25 21:49:16 +08:00
|
|
|
#define MAXCOLORS 256
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-11-25 21:49:16 +08:00
|
|
|
#define BitSet(byte, bit) (((byte) & (bit)) == (bit))
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-04-12 06:07:00 +08:00
|
|
|
#define ReadOK(file,buffer,len) (fread(buffer, len, 1, file) != 0)
|
1998-03-26 10:08:31 +08:00
|
|
|
#define Write(file,buffer,len) fwrite(buffer, len, 1, file)
|
1998-04-12 06:07:00 +08:00
|
|
|
#define WriteOK(file,buffer,len) (Write(buffer, len, file) != 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2008-08-19 14:27:32 +08:00
|
|
|
|
|
|
|
gint32 ReadBMP (const gchar *filename,
|
|
|
|
GError **error);
|
|
|
|
GimpPDBStatusType WriteBMP (const gchar *filename,
|
|
|
|
gint32 image,
|
|
|
|
gint32 drawable_ID,
|
|
|
|
GError **error);
|
|
|
|
|
2000-02-13 01:39:21 +08:00
|
|
|
|
2006-07-13 14:20:58 +08:00
|
|
|
extern gboolean interactive;
|
2006-08-16 01:35:00 +08:00
|
|
|
extern gboolean lastvals;
|
2003-11-25 21:49:16 +08:00
|
|
|
extern const gchar *filename;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-12-16 19:23:30 +08:00
|
|
|
extern struct Bitmap_File_Head_Struct
|
2000-02-13 01:39:21 +08:00
|
|
|
{
|
2006-07-12 22:25:17 +08:00
|
|
|
gchar zzMagic[2]; /* 00 "BM" */
|
2000-02-13 01:39:21 +08:00
|
|
|
gulong bfSize; /* 02 */
|
2006-07-12 22:25:17 +08:00
|
|
|
gushort zzHotX; /* 06 */
|
|
|
|
gushort zzHotY; /* 08 */
|
2000-02-13 01:39:21 +08:00
|
|
|
gulong bfOffs; /* 0A */
|
|
|
|
gulong biSize; /* 0E */
|
|
|
|
} Bitmap_File_Head;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-12-16 19:23:30 +08:00
|
|
|
extern struct Bitmap_Head_Struct
|
2000-02-13 01:39:21 +08:00
|
|
|
{
|
2005-03-25 04:56:39 +08:00
|
|
|
glong biWidth; /* 12 */
|
2005-01-14 06:00:32 +08:00
|
|
|
glong biHeight; /* 16 */
|
2000-02-13 01:39:21 +08:00
|
|
|
gushort biPlanes; /* 1A */
|
|
|
|
gushort biBitCnt; /* 1C */
|
|
|
|
gulong biCompr; /* 1E */
|
|
|
|
gulong biSizeIm; /* 22 */
|
|
|
|
gulong biXPels; /* 26 */
|
|
|
|
gulong biYPels; /* 2A */
|
|
|
|
gulong biClrUsed; /* 2E */
|
|
|
|
gulong biClrImp; /* 32 */
|
2006-07-12 22:25:17 +08:00
|
|
|
guint32 masks[4]; /* 36 */
|
2000-02-13 01:39:21 +08:00
|
|
|
} Bitmap_Head;
|
2004-07-26 08:44:01 +08:00
|
|
|
|
|
|
|
typedef struct _Bitmap_Channel
|
|
|
|
{
|
|
|
|
guint32 mask;
|
|
|
|
guint32 shiftin;
|
2006-07-12 22:25:17 +08:00
|
|
|
gfloat max_value;
|
2004-07-26 08:44:01 +08:00
|
|
|
} Bitmap_Channel;
|
2008-08-12 03:42:08 +08:00
|
|
|
|
|
|
|
#endif /* __BMP_H__ */
|