AL_Raw

Top  Previous  Next

unit AL_Raw;

(*

  Canon RAW file rutins for Delphi

 

  By Agócs László StellaSOFT Hungary

  _____________________________________________________________________

 

 

 

*)

interface

uses

Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

Math, StdCtrls, ExtCtrls, ExtDlgs, Spin, ComCtrls, Jpeg, FileCtrl, GraphicEX,

CSTDIO_TYPES, Global_FastIO;

 

Type

Triple=Array[0..MAXINT-1] Of Byte;

PPChar=^PChar;

PLine=^Triple;

ALines=Array[0..20000] Of PLine;

PLongInt=^LongInt;

 

Var

 

FilePtrs:TRawFilePointers;

 

Const

C_599=499;

 

implementation

 

{$I CSTDIO.PAS}

 

function RAWInfo(FilePtrs:PRAWFilePointers;

                PExifPointer:PExifRecord;

                PEssentials:PExifEssentials;

                filename:pchar;

                IHalfSize:LongInt;

                Var IWidth:LongInt;Var IHeight:LongInt;

                Var IFovWidth:LongInt;Var IFovHeight:LongInt;

                Var iMake:TChar50;Var iModel:TChar50;

                Var iTimeStamp:TChar50):Integer;

Var

FixFileName:Array [0..MAX_PATH] Of Char;

UseFileName:PChar;

OData_Error:Byte;

OldStatus87:WORD;

NewStatus87:WORD;

Begin

// 0=Hunky Dory

// -1=File is corrupted somehow

// 1=Output File couldn't be created

// 2=Input file not found

OldStatus87:= Default8087CW;

NewStatus87:=Default8087CW or C_FPU_MASK;

Set8087CW(NewStatus87);

UseFileName:=FixEmptyName(FileName,FixFileName);

OData_Error:=0;

FillChar(iMake,SizeOf(iMake),0);

FillChar(iModel,SizeOf(iModel),0);

FillChar(iTimeStamp,SizeOf(iTimeStamp),0);

Result:=zRawInfo(FilePtrs,PExifPointer,PEssentials,UseFileName,IHalfSize,IWidth,IHeight,iFovWidth,iFovHeight,iMake,iModel,iTimeStamp,@OData_Error);

_FPUInit;

Set8087CW(OldStatus87);

If IoResult<>0 Then;

If OData_Error<>0 Then

  Result:=-1;

{

The return values of

   iMake, iModel, iTimeStamp,iWidth, iHeight are easy to figure out

   iFovWidth=ORIGINAL FOVEON <sigma *.x3f> WIDTH

   iFovHeight=ORIGINAL FOVEON <sigma *.x3f> HEIGHT

   PExifPointer - contains the location within the file where the EXIF DATA is kept

        ExifStart   = the offest into the file

        ExifLength  = the length of the EXIF data

   Essentials - contains basic info that you would like such as

      ISO, Shutter Speed, Aperture etc.... If any of these values are NOT -1 then the

                                           value is correct.

}

End;

 

 

end.