L_ContourFilterBitmap

Summary

Performs a contour segment filter on the source bitmap.

Syntax

#include "l_bitmap.h"

L_LTIMGEFX_API L_INT L_ContourFilterBitmap(pBitmap, nThreshold, nDeltaDirection, nMaximumError, nOption, uFlags)

Parameters

pBITMAPHANDLE pBitmap

Pointer to a bitmap handle that references the bitmap that will be affected.

L_INT16 nThreshold

Threshold of the gradient magnitude. Values below this will be considered as background, and will be set to 0. Values can be from 1 to 254. A lower threshold provides a better quality image. Default is 15.

L_INT16 nDeltaDirection

Maximum angle for the thinning algorithm. Values can be from 1 to 64. Default is 35.

L_INT16 nMaximumError

Maximum error for approximation algorithm. Values can be from 0 to 255. Default is 5. This parameter is only valid if nOption is CONTOUR_APPROX_COLOR.

L_INT nOption

Flag that controls the resulting image. This value tells the method what process to complete before returning. Possible values are:

Value Meaning
CONTOUR_THIN [0] return after the thinning algorithm
CONTOUR_LINK_BLACKWHITE [1] return after contour linking, using only black and white
CONTOUR_LINK_GRAY [2] return after contour linking, using 256 grayscale
CONTOUR_LINK_COLOR [3] return after contour linking, using colors
CONTOUR_APPROX_COLOR [4] return after line segment approximation, using colors

L_UINT32 uFlags

Reserved for future use. Must be 0.

Returns

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

Comments

The bits per pixel of the affected bitmap will change according to the value of nOption.

If nOption is: Bits per pixel will be:
CONTOUR_THIN 8 bits per pixel grayscale
CONTOUR_LINK_BLACKWHITE 1 bit per pixel
CONTOUR_LINK_GRAY 8 bits per pixel grayscale
CONTOUR_LINK_COLOR 8 bits per pixel color
CONTOUR_APPROX_COLOR 8 bits per pixel color

This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available in the Document and Medical Imaging toolkits.

This function does not support 32-bit grayscale images. It returns the error code ERROR_GRAY32_UNSUPPORTED if a 32-bit grayscale image is passed to this function.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Example

For an example, refer to L_DlgContourFilter.

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.