Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
717 mikedld 1
;;================================================================================================;;
2
;;//// gif.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 ;;
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 gif.FileHeader ; GIF87a
22
  Signature	  db 3 dup(?) ; Header Signature (always "GIF")
23
  Version	  db 3 dup(?) ; GIF format version("87a" or "89a")
24
ends
25
 
26
struct gif.LogicalScreenDescriptor ; GIF87a
27
  ScreenWidth	  dw ?	      ; Width of Display Screen in Pixels
28
  ScreenHeight	  dw ?	      ; Height of Display Screen in Pixels
29
  Packed	  db ?	      ; Screen and Color Map Information
30
  BackgroundColor db ?	      ; Background Color Index
31
  AspectRatio	  db ?	      ; Pixel Aspect Ratio
32
ends
33
 
34
gif.LSD.Packed.SizeOfGlobalColorTableMask  = 000000111b
35
gif.LSD.Packed.SizeOfGlobalColorTableShift = 0
36
gif.LSD.Packed.ColorTableSortFlag	   = 000001000b
37
gif.LSD.Packed.ColorTableSortShift	   = 3
38
gif.LSD.Packed.ColorResolutionMask	   = 001110000b
39
gif.LSD.Packed.ColorResolutionShift	   = 4
40
gif.LSD.Packed.GlobalColorTableFlag	   = 010000000b
41
gif.LSD.Packed.GlobalColorTableShift	   = 7
42
 
43
struct gif.Header
44
  file gif.FileHeader
45
  lsd  gif.LogicalScreenDescriptor
46
ends
47
 
48
struct gif.RgbTriplet ; GIF87a
49
  Red	db ? ; Red Color Element
50
  Green db ? ; Green Color Element
51
  Blue	db ? ; Blue Color Element
52
ends
53
 
54
struct gif.Block
55
  Introducer db ?
56
ends
57
 
58
gif.Block.Introducer.EndOfData	     = 0x00
59
gif.Block.Introducer.Extension	     = 0x21
60
gif.Block.Introducer.ImageDescriptor = 0x2C
61
gif.Block.Introducer.EndOfFile	     = 0x3B
62
 
63
struct gif.ImageDescriptor ; GIF87a
64
  b	     gif.Block ; Introducer = 2Ch (',')
65
  Left	     dw ?      ; X position of image on the display
66
  Top	     dw ?      ; Y position of image on the display
67
  Width      dw ?      ; Width of the image in pixels
68
  Height     dw ?      ; Height of the image in pixels
69
  Packed     db ?      ; Image and Color Table Data Information
70
ends
71
 
72
gif.ID.Packed.SizeOfLocalColorTableMask  = 000000111b
73
gif.ID.Packed.SizeOfLocalColorTableShift = 0
74
gif.ID.Packed.SortFlag			 = 000100000b
75
gif.ID.Packed.SortShift 		 = 5
76
gif.ID.Packed.InterleaceFlag		 = 001000000b
77
gif.ID.Packed.InterleaceShift		 = 6
78
gif.ID.Packed.LocalColorTableFlag	 = 010000000b
79
gif.ID.Packed.LocalColorTableShift	 = 7
80
 
81
struct gif.Extension
82
  b	     gif.Block ; Introducer = 21h ('|')
83
  Label      db ?      ; Extension label
84
ends
85
 
86
gif.Extension.Label.PlainText	    = 0x01
87
gif.Extension.Label.GraphicsControl = 0xF9
88
gif.Extension.Label.Comment	    = 0xFE
89
gif.Extension.Label.Application     = 0xFF
90
 
91
struct gif.PlainTextExtension ; GIF89a
92
  e		   gif.Extension ; Label = 01h
93
  BlockSize	   db ? 	 ; Size of Extension Block (always 0Ch)
94
  TextGridLeft	   dw ? 	 ; X position of text grid in pixels
95
  TextGridTop	   dw ? 	 ; Y position of text grid in pixels
96
  TextGridWidth    dw ? 	 ; Width of the text grid in pixels
97
  TextGridHeight   dw ? 	 ; Height of the text grid in pixels
98
  CellWidth	   db ? 	 ; Width of a grid cell in pixels
99
  CellHeight	   db ? 	 ; Height of a grid cell in pixels
100
  TextFgColorIndex db ? 	 ; Text foreground color index value
101
  TextBgColorIndex db ? 	 ; Text background color index value
102
  PlainTextData    db ? 	 ; The Plain Text data (*)
103
; Terminator       db ?          ; Block Terminator (always 0)
104
ends
105
 
106
struct gif.GraphicsControlExtension ; GIF89a
107
  e	     gif.Extension ; Label = F9h
108
  BlockSize  db ?	   ; Size of remaining fields (always 04h)
109
  Packed     db ?	   ; Method of graphics disposal to use
110
  DelayTime  dw ?	   ; Hundredths of seconds to wait
111
  ColorIndex db ?	   ; Transparent Color Index
112
; Terminator db ?          ; Block Terminator (always 0)
113
ends
114
 
115
struct gif.CommentExtension ; GIF89a
116
  e	      gif.Extension ; Label = FEh
117
  CommentData db ?	    ; Pointer to Comment Data sub-blocks (*)
118
; Terminator  db ?          ; Block Terminator (always 0)
119
ends
120
 
121
struct gif.ApplicationExtension ; GIF89a
122
  e		  gif.Extension ; Label = FFh
123
  BlockSize	  db ?		; Size of Extension Block (always 0Bh)
124
  Identifier	  db 8 dup(?)	; Application Identifier
125
  AuthentCode	  db 3 dup(?)	; Application Authentication Code
126
  ApplicationData db ?		; Point to Application Data sub-blocks (*)
127
; Terminator      db ?          ; Block Terminator (always 0)
128
ends
129
 
130
;;------------------------------------------------------------------------------------------------;;
131
 
132
struct gif.Image
133
  gce  gif.GraphicsControlExtension
134
  info gif.ImageDescriptor
135
ends
136
 
137
gif.Null equ 0x1000