Subversion Repositories Kolibri OS

Rev

Rev 999 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;================================================================================================;;
  2. ;;//// bmp.inc //// (c) mike.dld, 2007-2008 //////////////////////////////////////////////////////;;
  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 ;;
  8. ;; General Public License as published by the Free Software Foundation, either version 3 of the   ;;
  9. ;; License, or (at your option) any later version.                                                ;;
  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  ;;
  13. ;; General Public License for more details.                                                       ;;
  14. ;;                                                                                                ;;
  15. ;; You should have received a copy of the GNU General Public License along with Libs-Dev. If not, ;;
  16. ;; see <http://www.gnu.org/licenses/>.                                                            ;;
  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
  31.   Width          dd ? ; Image width in pixels
  32.   Height         dd ? ; Image height in pixels
  33.   Planes         dw ? ; Number of color planes
  34.   BitCount       dw ? ; Number of bits per pixel
  35. ; v3 (Windows 3.x)
  36.   Compression    dd ? ; Compression method used
  37.   SizeImage      dd ? ; Size of bitmap in bytes
  38.   XPelsPerMeter  dd ? ; Horizontal resolution in pixels per meter
  39.   YPelsPerMeter  dd ? ; Vertical resolution in pixels per meter
  40.   ClrUsed        dd ? ; Number of colors in the image
  41.   ClrImportant   dd ? ; Minimum number of important colors
  42.   union
  43.     Palette      dd ? ; Image palette if BitCount in [1,4,8]
  44. ; v4 (Windows 95)
  45.     struct
  46.       RedMask    dd ? ; Mask identifying bits of red component
  47.       GreenMask  dd ? ; Mask identifying bits of green component
  48.       BlueMask   dd ? ; Mask identifying bits of blue component
  49.       AlphaMask  dd ? ; Mask identifying bits of alpha component
  50.       CSType     dd ? ; Color space type
  51.       RedX       dd ? ; X coordinate of red endpoint
  52.       RedY       dd ? ; Y coordinate of red endpoint
  53.       RedZ       dd ? ; Z coordinate of red endpoint
  54.       GreenX     dd ? ; X coordinate of green endpoint
  55.       GreenY     dd ? ; Y coordinate of green endpoint
  56.       GreenZ     dd ? ; Z coordinate of green endpoint
  57.       BlueX      dd ? ; X coordinate of blue endpoint
  58.       BlueY      dd ? ; Y coordinate of blue endpoint
  59.       BlueZ      dd ? ; Z coordinate of blue endpoint
  60.       GammaRed   dd ? ; Gamma red coordinate scale value
  61.       GammaGreen dd ? ; Gamma green coordinate scale value
  62.       GammaBlue  dd ? ; Gamma blue coordinate scale value
  63.     ends
  64.   ends
  65. ends
  66.  
  67. define bmp.BI_RGB       0
  68. define bmp.BI_RLE8      1
  69. define bmp.BI_RLE4      2
  70. define bmp.BI_BITFIELDS 3
  71. define bmp.BI_JPEG      4
  72. define bmp.BI_PNG       5
  73.  
  74. struct bmp.Header
  75.   file bmp.FileHeader
  76.   info bmp.InfoHeader
  77. ends
  78.  
  79. struct bmp.RgbByteQuad
  80.   Red   db ?
  81.   Green db ?
  82.   Blue  db ?
  83.   Alpha db ?
  84. ends
  85.  
  86. struct bmp.RgbQuad
  87.   Red   dd ?
  88.   Green dd ?
  89.   Blue  dd ?
  90.   Alpha dd ?
  91. ends
  92.  
  93. ;;------------------------------------------------------------------------------------------------;;
  94.  
  95. struct bmp.Image
  96.   info bmp.InfoHeader
  97. ends
  98.