Subversion Repositories Kolibri OS

Rev

Rev 1079 | Rev 1593 | 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
;;//// libimg.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 FormatsTableEntry
22
  Is	 dd ?
23
  Decode dd ?
24
  Encode dd ?
25
ends
26
 
27
struct Image
28
  Checksum dd ? ; ((Width ROL 16) OR Height) XOR Data[0]
29
  Width    dd ?
30
  Height   dd ?
31
  Next	   dd ?
32
  Previous dd ?
999 diamond 33
  Type     dd ? ; one of Image.bppN
717 mikedld 34
  Data	   dd ?
999 diamond 35
  Palette  dd ? ; used iff Type eq Image.bpp8
717 mikedld 36
  Extended dd ?
1079 diamond 37
  Flags    dd ? ; bitfield
38
  Delay    dd ? ; used iff Image.IsAnimated is set in Flags
717 mikedld 39
ends
40
 
1079 diamond 41
; values for Image.Type
42
; must be consecutive to allow fast switch on Image.Type in support functions
43
Image.bpp8  = 1
999 diamond 44
Image.bpp24 = 2
45
Image.bpp32 = 3
1079 diamond 46
Image.bpp15 = 4
47
Image.bpp16 = 5
999 diamond 48
 
1079 diamond 49
; bits in Image.Flags
50
Image.IsAnimated = 1
51
 
1102 diamond 52
struct ImageDecodeOptions
53
  UsedSize        dd ? ; if >=8, the field BackgroundColor is valid, and so on
54
  BackgroundColor dd ? ; used for transparent images as background
55
ends
56
 
717 mikedld 57
FLIP_VERTICAL	= 0x01
58
FLIP_HORIZONTAL = 0x02
59
FLIP_BOTH	= FLIP_VERTICAL or FLIP_HORIZONTAL
783 mikedld 60
 
61
ROTATE_90_CW   = 0x01
62
ROTATE_180     = 0x02
63
ROTATE_270_CW  = 0x03
64
ROTATE_90_CCW  = ROTATE_270_CW
65
ROTATE_270_CCW = ROTATE_90_CW