Browse Source

+ Forgot to commit support for writing targa

michael 21 years ago
parent
commit
67f23651c2
1 changed files with 28 additions and 0 deletions
  1. 28 0
      fcl/image/targacmn.pp

+ 28 - 0
fcl/image/targacmn.pp

@@ -1,9 +1,29 @@
+{*****************************************************************************}
+{
+    $Id$
+    This file is part of the Free Pascal's "Free Components Library".
+    Copyright (c) 2003 by Michael Van Canneyt of the Free Pascal development team
+
+    TARGA common definitions.
+    
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+}
+{*****************************************************************************}
+
 {$mode objfpc}
 {$h+}
 unit targacmn;
 
 interface
 
+Const
+  KeyIdentification = 'ID';
+
 Type
   TWordRec = Packed Record
     Lo,Hi : byte;
@@ -29,6 +49,7 @@ Type
   end;
 
 Function ToWord(AWord : TWordRec) : Word;
+Function FromWord(AWord : Word) : TWordRec;
 
 implementation
 
@@ -38,4 +59,11 @@ begin
   Result:=(AWord.Lo) or (AWord.Hi shl 8);
 end;
 
+Function FromWord(AWord : Word) : TWordRec;
+  
+begin
+  Result.Lo:=AWord and $FF;
+  Result.Hi:=(AWord shr 8) and $FF;
+end;
+
 end.