-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathIMAGETEX.PAS
254 lines (230 loc) · 8.38 KB
/
IMAGETEX.PAS
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
Unit ImageTex;
INTERFACE
Uses Systex;
Const
{ Code de marqueur IMI (Intelligent Image) }
imiEnd=0; { Fin de l'image }
imiTrueColor16=1; { Couleur v‚ritable en 16-bits }
imiTrueColor24=2; { Couleur v‚ritable en 24-bits }
imiTrueColor32=3; { Couleur v‚ritable en 32-bits }
imiRealPoint=4; { Point en format r‚el }
imiRealLine=5; { Ligne en format r‚el }
imiRealBox=6; { Rectangle }
imiDFDProcessus=100; { DFD - Processus }
imiDFDDepot=101; { DFD - D‚p“t }
imiDFDEntite=102; { DFD - Entit‚ externe }
imiDFDFlux=120; { DFD - Flux de donn‚es diagonale }
{ Code de marqueur JPEG }
mcjTEM=$01;
mcjSOF0=$C0;
mcjSOF1=$C1;
mcjSOF2=$C2;
mcjSOF3=$C3;
mcjDHT=$C4;
mcjSOF5=$C5;
mcjSOF6=$C6;
mcjSOF7=$C7;
mcjJPG=$C8;
mcjSOF9=$C9;
mcjSOF10=$CA;
mcjSOF11=$CB;
mcjDAC=$CC;
mcjSOF13=$CD;
mcjSOF14=$CE;
mcjSOF15=$CF;
mcjRST0=$D0;
mcjRST1=$D1;
mcjRST2=$D2;
mcjRST3=$D3;
mcjRST4=$D4;
mcjRST5=$D5;
mcjRST6=$D6;
mcjRST7=$D7;
mcjSOI=$D8;
mcjEOI=$D9;
mcjSOS=$DA;
mcjDQT=$DB;
mcjDNL=$DC;
mcjDRI=$DD;
mcjDHP=$DE;
mcjEXP=$DF;
mcjAPP0=$E0;
mcjAPP15=$EF;
mcjJPG0=$F0;
mcjJPG13=$FD;
mcjCOM=$FE;
mcjERROR=$100;
{Constante d'Ic“ne Windows}
ihwIcon=1; { Ic“ne }
ihwCursor=2; { Curseur }
{Type de compression Windows}
bi_RGB=0;
bi_RLE8=1;
bi_RLE4=2;
Type
{Entˆte d'un format d'image BGX }
BGXHeader=Record
Sign:Array[0..3]of Char; { Signature }
NumXPixels,NumYPixels:Word;{ Nombre de pixels horizontal et vertical }
BitsPerPixel:Byte; { Nombre de bits par pixel }
End;
{Entˆte d'un format d'image Gem/Img Ventura}
HeaderGemImgRec=Record
Sign:Array[0..1]of Char; { Signature: #$00#$01 }
StartOff:Word; { Point de d‚part (format Motorola) }
BitsPerPixel:Word; { Bits par pixel (format Motorola) }
PatternSize:Word; { Taille de la palette }
ResA:Array[8..11]of Byte; { R‚serv‚s }
NumXPixels:Word; { Largeur de l'image (format Motorola) }
NumYPixels:Word; { Hauteur de l'image (format Motorola) }
ResB:Array[16..18]of Byte;{ R‚serv‚s }
End;
{Entˆte d'un format d'image MacPaint }
HeaderOldMacPaint=Record
ZeroByte:Byte; { Octet toujours … 0 }
Name:String[63]; { V‚ritable nom du dessin }
TypeFile:Array[1..4]of Char; { PNTG }
Creator:Array[1..4]of Char; { Nom du cr‚ateur du dessin }
Filler:Array[0..9]of Byte; { Non utilis‚ }
DataForkSize:LongInt;
RsrcForkSize:LongInt;
CreationDate:LongInt;
ModifData:LongInt;
Filler2:Array[0..28]of Byte;
End;
{Entˆte d'un format d'image LBM }
LBMHeader=Record
Msg1:Array[1..4]of Char; { Signature: "FORM" }
FLen:LongInt; { Longueur du fichier - 8 }
Msg2:Array[1..8]of Char; { Signature: "ILBMBMHD" ou "PBM BMHD" }
HLen:LongInt; { Longueur de l'entˆte }
Width,Length, { Largeur et longueur }
XOff,YOff:Word; { Position (X1,Y1) }
BitsPerPixel, { Nombre de bits par pixel }
Masking, { Masque }
Compression, { Compression }
Pad:Byte; { Pad }
Transparent:Integer; { Transparence }
XAspect,YAspect:Byte; { Ratio X:Y }
ScreenWidth, { Largeur de l'image }
ScreenHeight:Word; { Hauteur de l'image }
End;
{Entˆte de fichier de format Targa}
TGAHeader=Record
IDFieldLength:Byte; { Taille de l'en-tˆte en octets }
ColorMapType:Byte; { Version du format TGA : }
{ 1 -> Celle reconnue par cette unit‚ }
ImageType:Byte; { Format de codage des donn‚es : }
{ 1 -> Donn‚es directes en 8bpp }
{ 2 -> Donn‚es directes en 24bpp (RVB) }
{ 9 -> Codage des r‚p‚titions (RLE) en 8 bpp }
{ (non support‚ par cette unit‚) }
{ 10 -> Codage des r‚p‚titions (RLE) en 24 bpp}
{ (non support‚ par cette unit‚) }
CMapOrigin:Word; { Position dans le fichier de la palette }
CMapLength:Word; { Nombre de couleurs }
ColorMapEntrySize:Byte;
Xmin,Ymin, { Position d'orgine dans l'image (rarement }
{ utilis‚, et non support‚ par cette unit‚) }
NumXPixels,NumYPixels:Word;{ Dimensions de l'image }
BitsPerPixel, { Nombre de bits par pixel }
Option:Byte; { Option de l'image : }
{ 0 -> Image renvers‚e verticalement }
{ 32 -> Image dans le sens normal }
End;
{Entˆte de fichier de format BitMap Windows}
HeaderBMP=Record
Sign:Array[0..1]of Char;
Size,Reserved0,OffBits:LongInt;
biSize,NumXPixels,NumYPixels:LongInt;
Planes,BitCount:Word;
Compression,SizeImage:LongInt;
XPelsPerMeter,YPelsPerMeter,ClrUsed,ClrImportant:LongInt;
End;
{Format d'image SCi - RIX3 }
SCiHeader=Record
Sign:Array[0..3]of Char; { Signature: RIX3 }
NumXPixels:Word; { Nombre de pixels horizontalement }
NumYPixels:Word; { Nombre de pixels verticalement }
Reserved:Word; { R‚serv‚e }
End;
{Entˆte de fichier de format GIF}
HeaderGIF=Record
Sign,Ver:Array[0..2]of Char; { Signature et version (GIF87a ou GIF89a)}
NumXPixels,NumYPixels:Word; { Largeur et hauteur de l'image en pixels }
ExtInfo, { Information de palettes }
Background, { ArriŠre plan }
AspectRatio:Byte; { Ratio }
End;
{Entˆte d'image du fichier de format GIF}
HeaderImageGIF=Record
Seperator:Byte; { S‚parateur ',' }
X1,Y1:Word; { Position X,Y ou commence l'image }
NumXPixels,NumYPixels:Word; { Largeur et hauteur de l'image }
ExtInfo:Byte; { Information de palettes }
End;
{$I Library\Files\Images\JFIFHead.Inc}
{$I Library\Files\Images\PCXHeade.Inc}
{$I Library\Files\Images\TiffData.Inc}
Type
{Structure d'une image IMI (Intelligent Image) }
ImiHeader=Record
Sign:Array[0..2]of Char; { Signature = "IMI" }
NumXPixels:Word; { Nombre de pixels horizontal }
NumYPixels:Word; { Nombre de pixels vertical }
BitsPerPixel:Byte; { Nombre de bits par pixel }
ScaleX:Real; { chelle horizontal }
ScaleY:Real; { chelle vertical }
System:Byte; { SystŠme: 0=M‚trique, 1=Imp‚rial }
Langue:Byte; { Langue: 0=Fran‡ais, 1=Anglais, 2=Russes}
CountryCode:Word; { Code de pays/r‚gion du Malte Genesis }
BackgroundColor:RGB; { Couleur d'arriŠre plan }
Mode:Byte; { Mode d'object (drw????) }
NameProject:String[40]; { Nom du projet }
NameModele:String[40]; { Nom du modŠle }
Alias:String[30]; { Alias }
Author:String[30]; { Auteur du dessin }
Responsable:String[30]; { Nom du responsable }
NameOrganisme:String[50]; { Nom de la compagnie }
Description:String; { Description du dessin }
Version:String[10]; { Num‚ro de version du dessin }
Email:String[60]; { Courriel de l'auteur }
Password:String[19]; { Mot de passe }
Logo:String; { Chemin du Logo }
ScaleZ:Real; { chelle Z (3 dimensions seulement ) }
Origin:Byte; { Mode de dessin (DFD, Electronique,...)}
Reserved:Array[7..511]of Byte; { R‚serv‚ pour des ajouts potentiel }
DateCreated:LongInt; { Date de cr‚ation }
DateModified:LongInt; { Date de modification }
NumModified:LongInt; { Nombre de modification }
CurrObject:LongInt; { Object courant }
NumObject:LongInt; { Nombre d'objet }
End;
{Structure d'une image 3D Studio}
Chunk3DStudio=Record
ID:Word;
Next:LongInt;
End;
{ÄÄ D‚finition des structures par d‚faut des ic“nes ÄÄ}
{$I Library\System\Windows\Icon.Inc}
{$I Library\System\OS2\Icon.Inc}
Function RGB2Win32bits(R:Byte;G:Byte;B:Byte):LongInt;
{$IFNDEF Win32}
{$IFNDEF __TMT__}
InLine($5A/ { POP DX }
$5B/ { POP BX }
$58/ { POP AX }
$8A/$E3/ { MOV AH,BL }
$32/$F6); { XOR DH,DH }
{$ENDIF}
{$ENDIF}
IMPLEMENTATION
{$IFDEF Win32}
Function RGB2Win32bits(R:Byte;G:Byte;B:Byte):LongInt;Begin
End;
{$ENDIF}
{$IFDEF __TMT__}
Function RGB2Win32bits(R:Byte;G:Byte;B:Byte):LongInt;Begin
End;
{$ENDIF}
END.