CRIMP
Diff
Not logged in

Differences From Artifact [ee8d27090d]:

To Artifact [a1b2ca87fe]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

25










26



27



28







29



30




31



32
33
34
35
36
37
38
#ifndef CRIMP_io_bmp_H
#define CRIMP_io_bmp_H

/*
 * CRIMP :: BMP helper dclarations. INTERNAL. Do not export.
 * Copyright (c) 1997-2003 Jan Nijtmans    <nijtmans@users.sourceforge.net>
 * Copyright (c) 2002      Andreas Kupries <andreas_kupries@users.sourceforge.net>
 */

#include <crimp_core/crimp_coreDecls.h>

/* Compression types */
#define BI_RGB          0
#define BI_RLE8         1
#define BI_RLE4         2
#define BI_BITFIELDS    3

/* Structure for reading bit masks for compression type BI_BITFIELDS */
typedef struct {
  unsigned int mask;
  unsigned int shiftin;
  unsigned int shiftout;
} BitmapChannel;


extern int










bmp_read_header (crimp_buffer* buf,



		 int* w, int* h,



		 unsigned char **colorMap,







		 int* numBits, int* numCols, int* comp,



		 unsigned int* mask);









/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:











<
<
<
<
<
<







>
|
>
>
>
>
>
>
>
>
>
>
|
>
>
>
|
>
>
>
|
>
>
>
>
>
>
>
|
>
>
>
|
>
>
>
>

>
>
>







1
2
3
4
5
6
7
8
9
10
11






12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef CRIMP_io_bmp_H
#define CRIMP_io_bmp_H

/*
 * CRIMP :: BMP helper dclarations. INTERNAL. Do not export.
 * Copyright (c) 1997-2003 Jan Nijtmans    <nijtmans@users.sourceforge.net>
 * Copyright (c) 2002      Andreas Kupries <andreas_kupries@users.sourceforge.net>
 */

#include <crimp_core/crimp_coreDecls.h>







/* Structure for reading bit masks for compression type BI_BITFIELDS */
typedef struct {
  unsigned int mask;
  unsigned int shiftin;
  unsigned int shiftout;
} BitmapChannel;

/*
 * Compression types
 */
typedef enum {
    bc_rgb,      /* Uncompressed pixels */
    bc_rle4,     /* RLE-encoding for 4 bits/pixel */
    bc_rle8,     /* RLE-encoding for 8 bits/pixel */
    bc_bitfield, /* Packed RGB (or 1d huffman) */
    bc_jpeg,     /* Embedded JPEG, or RLE-24 -- NOT SUPPORTED */
    bc_png,      /* Embedded PNG             -- NOT SUPPORTED */
    bc_alphabit  /*                          -- NOT SUPPORTED */
} bmp_compression;

/*
 * bmp decoder information.
 */

typdef struct bmp_info {
    unsigned int    w;             /* Image width */
    unsigned int    h;             /* Image height */
    unsigned char*  colorMap;      /* Palette, NULL if not used */
    unsigned int    numColors;     /* #colors in the palette */
    unsigned int    numBits;       /* bits/pixel */
    bmp_compression mode;          /* Pixel compression method, s.a. */
    int             topdown;       /* Direction of scan-line storage */
    unsigned int    numPixelBytes; /* #bytes of pixel data */
    crimp_buffer*   input;         /* buffer holding the BMP */
} bmp_info;

/*
 * Main functions.
 */

extern int
bmp_read_header (Tcl_Interp*     interp,
		 crimp_buffer*   buf,
		 bmp_info*       info);

extern void
bmp_read_pixels (bmp_info*      info,
		 crimp_image*   destination);

/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End: