L_FrqFilterBitmap
#include "l_bitmap.h"
L_INT EXT_FUNCTION L_FrqFilterBitmap(pFTArray, prcRange, uFlags)
pFTARRAY pFTArray; |
/* pointer to structure */ |
LPRECT prcRange; |
/* pointer to range rectangle */ |
L_UINT uFlags; |
/* flags */ |
Filters the frequency harmonics data produced by a Fourier Transform function using a range rectangle. This function is available in the Raster Pro and above toolkits.
Parameter |
Description |
|
pFTArray |
Pointer to an FTARRAY structure. The acxData member of the FTARRAY structure is a two-dimensional array holding the frequency components. |
|
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. |
|
|
||
|
||
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. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function is used only when working with Fourier Transform functions.
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.
Before using this function, call the L_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 L_FreeFTArray function.
To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.
Required DLLs and Libraries
LTIMG For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Platforms
Windows 95 / 98 / Me, Windows 2000 / XP.
See Also
Example
/* this example filters the acxData of a pFTARRAY structure produced by the Fast Fourier Transform function*/
BITMAPHANDLE LeadBitmap;
RECT rcRange;
pFTARRAY pFTArray;
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
rcRange.left = 0;
rcRange.right = LeadBitmap.Width / 4;
rcRange.top = 0;
rcRange.bottom = LeadBitmap.Height / 2;
/*Allocate FT buffer*/
L_AllocFTArray(&LeadBitmap, &pFTArray, sizeof(FTARRAY));
/*lpFTData is known*/
/* filters the frequencies*/
L_FrqFilterBitmap(pFTArray, &rcRange, FRQ_INSIDE_X | FRQ_INSIDE_Y);