DisplayFourierTransformation example for Delphi
{This example loads a bitmap, applies the Discrete Fourier Transform function to it,
and displays the data}
procedure TForm1.Button1Click(Sender: TObject);
begin
{ Load the bitmap, keeping the bits per pixel of the file }
LEADImage1.Load ('e:\image1.cmp', 0, 1, 1 );
{Initialize buffer}
LEADImage1.InitFourierTransformationData ();
{ apply DFT}
LEADImage1.DiscreteFourierTransformation ( 0, 0, Trunc(LEADImage1.BitmapWidth / 4), Trunc(LEADImage1.BitmapHeight / 2), DFT_DFT + DFT_GRAY + DFT_RANGE + DFT_INSIDE_X + DFT_OUTSIDE_Y );
{plot frequency magnitude}
LEADImage1.DisplayFourierTransformation( DSP_FT_MAG + DSP_FT_LOG );
{Frees buffer}
LEADImage1.FreeFourierTransformationData ( );
end;