-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathXFaceTransferInHexString.pas
More file actions
69 lines (52 loc) · 1.46 KB
/
XFaceTransferInHexString.pas
File metadata and controls
69 lines (52 loc) · 1.46 KB
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
unit XFaceTransferInHexString;
(*
* Compface - 48x48x1 image compression and decompression
*
* Copyright (c) James Ashton - Sydney University - June 1990.
*
* Written 11th November 1989.
*
* Delphi conversion Copyright (c) Nicholas Ring February 2012
*
* Permission is given to distribute these sources, as long as the
* copyright messages are not removed, and no monies are exchanged.
*
* No responsibility is taken for any errors on inaccuracies inherent
* either to the comments or the code of this program, but if reported
* to me, then an attempt will be made to fix them.
*)
{$IFDEF FPC}{$mode delphi}{$ENDIF}
interface
uses
XFaceInterfaces;
type
{ THexStrTransferIn }
TXFaceTransferInHexString = class(TInterfacedObject, IXFaceTransferIn)
private
FHexString : string;
public
constructor Create(const AHexString : string);
procedure StartTransfer();
function TransferIn(const AIndex : Cardinal) : Byte;
procedure EndTransfer();
end;
implementation
uses
SysUtils;
{ THexStrTransferIn }
constructor TXFaceTransferInHexString.Create(const AHexString : string);
begin
inherited Create();
FHexString := AHexString;
end;
procedure TXFaceTransferInHexString.StartTransfer();
begin
end;
function TXFaceTransferInHexString.TransferIn(const AIndex : Cardinal) : Byte;
begin
Result := StrToIntDef('0x' + Copy(FHexString, (AIndex - 1) * 2 + 1, 2), 0);
end;
procedure TXFaceTransferInHexString.EndTransfer();
begin
end;
end.