LBitmap::Polar
#include "ltwrappr.h"
virtual L_INT LBitmap::Polar(crFill, uFlags)
COLORREF crFill; |
/* fill color */ |
L_UINT uFlags; |
/* flags */ |
Converts the bitmap from rectangular to polar coordinates and vice versa. This function is available in the Raster Pro and above toolkits.
Parameter |
Description |
|
crFill |
The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color. |
|
uFlags |
Flags that indicate how to handle exposed areas and the type of conversion. You can use a bitwise OR (|) to specify one flag from each group. |
|
|
The following are the flags that indicate how to handle exposed areas: |
|
|
Value |
Meaning |
|
FILL_CLR |
[0x0000] Fill any exposed areas with crFill. |
|
FILL_RPT |
[0x0001] Stretch the image edges to fill the exposed area. |
|
FILL_NOCHG |
[0x0002] Leave the exposed area as is, without changing it. |
|
The following are the flags that indicate the conversion type: |
|
|
Value |
Meaning |
|
CART_TO_POL |
[0x0000] Convert the image from Cartesian (rectangular) coordinates to polar coordinates. |
|
POL_TO_CART |
[0x0010] Convert the image from polar coordinates to Cartesian (rectangular) coordinates. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function converts a bitmap from Cartesian (rectangular) coordinates to polar coordinates or vice versa. Rectangular coordinates use the form (x, y) where x and y are the horizontal and vertical distances from the origin, respectively. Polar coordinates are in the form (r, ) where r is the distance from the origin to the point and Ȓ is the angle of the line the point makes with the positive x-axis. Polar coordinates use a grid made of concentric circles around the origin, along with lines that are rays radiating outward from the origin.
If CART_TO_POL is set, this function considers the positions of the images pixels as values in a Polar coordinate system. Then it converts all the pixels in a line of the source image into a circle around the center of the bitmap.
If POL_TO_CART is set, this function takes the pixels from concentric circles and considers their positions as values in a Cartesian coordinate system. Then it converts all the pixels in a circle into horizontal lines.
If there is any region selected on the bitmap, the effect will be applied on the region dimensions only.
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 only in the Document/Medical toolkits.
This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.
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
LTIMGSFX For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Example
L_INT LBitmap__PolarExample(LAnimationWindow * LAniWnd) { return LAniWnd->Polar(0, FILL_RPT | CART_TO_POL); }