LBitmap::GetCurvePoints

#include "ltwrappr.h"

static L_INT LBitmap::GetCurvePoints(pCurve, apUserPoint, uUserPointCount, puPointCount, uFlags)

Updates the pCurve array based on a curve or lines that pass through the specified points.

Parameters

L_INT * pCurve

Pointer to the array to be filled by this function. To get the real value of the array elements, each of the values must be divided by 1000.

POINT *apUserPoint

Pointer to an array of POINT structures that contain the points on the curve used to determine the values for pCurve. The minimum x coordinate value is 0.

L_UINT uUserPointCount

Number of points in the apUserPoint array.

L_UINT *puPointCount

Pointer to a variable to be updated with the number of entries in pCurve that were actually updated by this function.

L_UINT uFlags

Flag that indicates the method to be used to update the buffer. Possible values are:

Value Meaning
GUB_CURVE [0x0000] Fill pCurve with the best curve that passes through the user points.
GUB_LINEAR [0x0001] Fill pCurve with lines that pass through the user points.

Returns

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

Comments

This function updates pCurve using either the best curve or the lines that pass through the points specified in the apUserPoint parameter. It does ot matter whether the points in the array are sorted. In most cases, this function is used with the LBitmap::FreeHandShear or LBitmap::FreeHandWave functions.

Use the following formula to compute the size of the pCurve array:

Size = Maximum (apUserPoint.x) + uUserPointCount

This means that to deterine the size, find the maximum x coordinate value of apUserPoint and add to that the number of Points sent to the function. It is best to initialize the pCurve array before sending it to the function.

The values stored in pCurve represent the y coordinates of the calculated curve based on the points in the apUserPoint array. In the pCurve array there can be only one y value for each x coordinate. Therefore, circles, ellipses, and spirals cannot be represented by pCurve.

The x coordinates for the user points are sorted internally automatically.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

For an example, refer to LBitmap::FreeHandShear or LBitmap::FreeHandWave.

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

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.