Subversion Repositories Kolibri OS

Rev

Rev 717 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
717 mikedld 1
;;================================================================================================;;
999 diamond 2
;;//// bmp.inc //// (c) mike.dld, 2007-2008, (c) diamond, 2009 ///////////////////////////////////;;
717 mikedld 3
;;================================================================================================;;
4
;;                                                                                                ;;
5
;; This file is part of Common development libraries (Libs-Dev).                                  ;;
6
;;                                                                                                ;;
7
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
999 diamond 8
;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
9
;; of the License, or (at your option) any later version.                                         ;;
717 mikedld 10
;;                                                                                                ;;
11
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without  ;;
12
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  ;;
999 diamond 13
;; Lesser General Public License for more details.                                                ;;
717 mikedld 14
;;                                                                                                ;;
999 diamond 15
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev.  ;;
16
;; If not, see .                                                    ;;
717 mikedld 17
;;                                                                                                ;;
18
;;================================================================================================;;
19
 
20
 
21
struct bmp.FileHeader
22
  Type	  dw ?	      ; File type, always 4D42h ("BM")
23
  Size	  dd ?	      ; Size of the file in bytes
24
	  dw 2 dup(?) ; Reserved; must be set to zero.
25
  OffBits dd ?	      ; Starting position of image data in bytes
26
ends
27
 
28
struct bmp.InfoHeader
29
; v2 (Windows 2.x)
30
  Size		 dd ? ; Size of this header in bytes
999 diamond 31
  union
32
    struct ; new format
33
      Width 	 dd ? ; Image width in pixels
34
      Height	 dd ? ; Image height in pixels
35
      Planes	 dw ? ; Number of color planes
36
      BitCount	 dw ? ; Number of bits per pixel
37
    ends
38
    struct ; old format
39
      OldWidth   dw ? ; Image width in pixels as word
40
      OldHeight  dw ? ; Image height in pixels as word
41
      OldPlanes  dw ? ; Number of color planes
42
      OldBitCount dw ? ; Number of bits per pixel
43
    ends
44
  ends
717 mikedld 45
; v3 (Windows 3.x)
46
  Compression	 dd ? ; Compression method used
47
  SizeImage	 dd ? ; Size of bitmap in bytes
48
  XPelsPerMeter  dd ? ; Horizontal resolution in pixels per meter
49
  YPelsPerMeter  dd ? ; Vertical resolution in pixels per meter
50
  ClrUsed	 dd ? ; Number of colors in the image
51
  ClrImportant	 dd ? ; Minimum number of important colors
52
  union
53
    Palette	 dd ? ; Image palette if BitCount in [1,4,8]
54
; v4 (Windows 95)
55
    struct
56
      RedMask	 dd ? ; Mask identifying bits of red component
57
      GreenMask  dd ? ; Mask identifying bits of green component
58
      BlueMask	 dd ? ; Mask identifying bits of blue component
59
      AlphaMask  dd ? ; Mask identifying bits of alpha component
60
      CSType	 dd ? ; Color space type
61
      RedX	 dd ? ; X coordinate of red endpoint
62
      RedY	 dd ? ; Y coordinate of red endpoint
63
      RedZ	 dd ? ; Z coordinate of red endpoint
64
      GreenX	 dd ? ; X coordinate of green endpoint
65
      GreenY	 dd ? ; Y coordinate of green endpoint
66
      GreenZ	 dd ? ; Z coordinate of green endpoint
67
      BlueX	 dd ? ; X coordinate of blue endpoint
68
      BlueY	 dd ? ; Y coordinate of blue endpoint
69
      BlueZ	 dd ? ; Z coordinate of blue endpoint
70
      GammaRed	 dd ? ; Gamma red coordinate scale value
71
      GammaGreen dd ? ; Gamma green coordinate scale value
72
      GammaBlue  dd ? ; Gamma blue coordinate scale value
73
    ends
74
  ends
75
ends
76
 
77
define bmp.BI_RGB	0
78
define bmp.BI_RLE8	1
79
define bmp.BI_RLE4	2
80
define bmp.BI_BITFIELDS 3
81
define bmp.BI_JPEG	4
82
define bmp.BI_PNG	5
83
 
84
struct bmp.Header
85
  file bmp.FileHeader
86
  info bmp.InfoHeader
87
ends
88
 
89
struct bmp.RgbByteQuad
90
  Red	db ?
91
  Green db ?
92
  Blue	db ?
93
  Alpha db ?
94
ends
95
 
96
struct bmp.RgbQuad
97
  Red	dd ?
98
  Green dd ?
99
  Blue	dd ?
100
  Alpha dd ?
101
ends
102
 
103
;;------------------------------------------------------------------------------------------------;;
104
 
105
struct bmp.Image
106
  info bmp.InfoHeader
107
ends