PageRenderTime 14ms CodeModel.GetById 2ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/ocr/ocrservice/jni/hydrogen/include/leptonica/bmp.h

http://eyes-free.googlecode.com/
C++ Header | 74 lines | 31 code | 9 blank | 34 comment | 0 complexity | eb1ad37dd1d00b30106b8d257073bc02 MD5 | raw file
 1/*====================================================================*
 2 -  Copyright (C) 2001 Leptonica.  All rights reserved.
 3 -  This software is distributed in the hope that it will be
 4 -  useful, but with NO WARRANTY OF ANY KIND.
 5 -  No author or distributor accepts responsibility to anyone for the
 6 -  consequences of using this software, or for whether it serves any
 7 -  particular purpose or works at all, unless he or she says so in
 8 -  writing.  Everyone is granted permission to copy, modify and
 9 -  redistribute this source code, for commercial or non-commercial
10 -  purposes, with the following restrictions: (1) the origin of this
11 -  source code must not be misrepresented; (2) modified versions must
12 -  be plainly marked as such; and (3) this notice may not be removed
13 -  or altered from any source or modified source distribution.
14 *====================================================================*/
15
16#ifndef  LEPTONICA_BMP_H
17#define  LEPTONICA_BMP_H
18
19/*
20 * This file is here to describe the fields in the header of
21 * the BMP file.  These fields are not used directly in Leptonica.
22 * The only thing we use are the sizes of these two headers.
23 * Furthermore, because of potential namespace conflicts with
24 * the typedefs and defined sizes, we have changed the names
25 * to protect anyone who may also need to use the original definitions.
26 * Thanks to J. D. Bryan for pointing out the potential problems when
27 * developing on Win32 compatible systems.
28 */
29
30/*-------------------------------------------------------------*
31 *                       BMP file header                       *
32 *-------------------------------------------------------------*/
33struct BMP_FileHeader
34{
35    l_int16        bfType;                /* file type; must be "BM" */
36    l_int16        bfSize;                /* length of the file;
37                                   sizeof(BMP_FileHeader) +
38                                   sizeof(BMP_InfoHeader) +
39                                   size of color table +
40                                   size of DIB bits */
41    l_int16        bfFill1;        /* remainder of the bfSize field */
42    l_int16        bfReserved1;        /* don't care (set to 0)*/
43    l_int16        bfReserved2;        /* don't care (set to 0)*/
44    l_int16        bfOffBits;        /* offset from beginning of file */
45    l_int16        bfFill2;        /* remainder of the bfOffBits field */
46};
47typedef struct BMP_FileHeader  BMP_FH;
48
49#define BMP_FHBYTES  sizeof(BMP_FH)
50
51
52/*-------------------------------------------------------------*
53 *                       BMP info header                       *
54 *-------------------------------------------------------------*/
55struct BMP_InfoHeader
56{
57    l_int32        biSize;                  /* size of the BMP_InfoHeader struct */
58    l_int32        biWidth;         /* bitmap width in pixels */
59    l_int32        biHeight;         /* bitmap height in pixels */
60    l_int16        biPlanes;         /* number of bitmap planes */
61    l_int16        biBitCount;         /* number of bits per pixel */
62    l_int32        biCompression;         /* compression format (0 == uncompressed) */
63    l_int32        biSizeImage;         /* size of image in bytes */
64    l_int32        biXPelsPerMeter; /* pixels per meter in x direction */
65    l_int32        biYPelsPerMeter; /* pixels per meter in y direction */
66    l_int32        biClrUsed;          /* number of colors used */
67    l_int32        biClrImportant;         /* number of important colors used */
68};
69typedef struct BMP_InfoHeader  BMP_IH;
70
71#define BMP_IHBYTES  sizeof(BMP_IH)
72
73 
74#endif  /* LEPTONICA_BMP_H */