Filters the frequency harmonics data produced by a Fourier Transform function using a range rectangle.


#include "ltwrappr.h"

static L_INT LBitmap::FrqFilter(pFTArray, prcRange, uFlags)



Pointer to an FTARRAY structure. The acxData member of the FTARRAY structure is a two-dimensional array holding the frequency components.

LPRECT prcRange

Specifies the filter dimension that will be applied, it represents the frequency range to be kept or removed. The left value refers to the minimum X harmonic, the right refers to the maximum X harmonic, the top refers to the minimum Y harmonic and the bottom refers to the maximum Y harmonic. The maximum X harmonic equals Width 1 and the maximum Y harmonic equals Height 1.

L_UINT uFlags

Flags that indicate the operation to be performed on the specified X and Y harmonics ranges. You can use a bit wise OR ( | ) to specify one flag from each group.

The following flags represent operations on the X harmonics range:

Value Meaning
FRQ_INSIDE_X [0x0001] Keep the X harmonics inside X range and remove outside ones.
FRQ_OUTSIDE_X [0x0002] Remove the X harmonics inside X range and keep outside ones.

The following flags represent operations on the Y harmonics range:

Value Meaning
FRQ_INSIDE_Y [0x0010] Keep the Y harmonics inside Y range and remove outside ones.
FRQ_OUTSIDE_Y [0x0020] Remove the Y harmonics inside Y range and keep outside ones.


Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.


This function is used only when working with Fourier Transform functions.

Before using this function, call the LBitmap::AllocFTArray function to allocate a FTARRAY structure large enough to hold the Fourier Transform coefficients for pBitmap. When the array is no longer needed, free the allocated array by calling the LBitmap::FreeFTArray function.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

This function does not support 12 and 16-bit grayscale and 48 and 64-bit color images. If the image is 12 and 16-bit grayscale and 48 and 64-bit color, the function will not return an error.

Required DLLs and Libraries


Win32, x64.

See Also




L_INT LBitmap__FrqFilterExample(LBitmap *pLeadBitmap, pFTARRAY pFTArray)  
   /* this example  filters the acxData of a pFTARRAY structure produced by the Fast Fourier Transform function*/ 
   RECT    rcRange;  
   rcRange.left  = 0;  
   rcRange.right = pLeadBitmap->GetWidth () / 4; = 0;  
   rcRange.bottom = pLeadBitmap->GetHeight () / 2;  
   /*lpFTData is  known*/ 
   /* filters the frequencies*/ 
   return LBitmap::FrqFilter(pFTArray, &rcRange, FRQ_INSIDE_X | FRQ_INSIDE_Y);  
Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help