RingEffect method (ILEADRasterProcess)
short RingEffect (ILEADRaster *pRaster, short iXOrigin, short iYOrigin, long lRadius, long lRingCount, long lRandomize, OLE_COLOR crColor, short iAngle, long lFlags); | |
Overview |
Refer to Applying Artistic Effects |
Remarks
(Raster Pro and above toolkits) Divides the image into the specified number of rings. Each ring is rotated according to a rotation angle. The rotation angle for each ring will be chosen randomly by the function or can be passed to the function.
This method can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.
The RingEffect method divides the image into a certain number of rings. Each ring is rotated compared to its inner ring according to a rotation angle. The method will pick the rotation angle at random if RING_FIXEDANGLE is not set in lFlags, or will use the angle specified by iAngle if RING_FIXEDANGLE is set in lFlags.
If RING_FIXEDANGLE is not set in lFlags, then the method will pick the rotation angle randomly. The starting point (that is, the "randomization value") for the random number generator is selected through the lRandomize parameter, as follows:
If lRandomize is set to zero then the method will select a random value between 1 and 500 for the randomization value.
If lRandomize is > 0, it will be used for the randomize value. Note that lRandomize should be between 1 and 500 in this case.
Although the numbers generated are random, if you start with the same randomization value you will always get the same sequence of random numbers. This means that if you call the method twice with the same value for lRandomize, you will get the same result.
The center of the rings is determined by the iXOrigin and iYOrigin parameters. The method calculates the width of each ring by dividing the maximum radius (lRadius when lFlags is set to RING_MAXRADIUS) by lRingCount + 1.
The minimum width of each circle is 2. If the result of the division is less than 2, the function will draw lRadius / 2 rings, each ring having a width of 2.
Rings with a large radius might not be completely inside the bitmap. We will refer to these as "incomplete rings". We will refer to a portion of the ring that is outside the bitmap as "undetermined portion". When you rotate an incomplete ring, an undetermined portion of the ring might come into view. The method has 3 ways of specifying the output of the pixels where undetermined portions come into view:
Leave original bitmap pixels unchanged (RING_NOCHANGE is set) or
Repeat edge pixels (RING_REPEAT is set) or
Fill the undefined area with color crColor (RING_COLOR is set).
The determined portion of the ring will always displace the original bitmap pixels.
The image is split into an innermost circle and a number of rings. The innermost circle will not be rotated. Each ring is rotated compared to the inner ring. The rotation angle is as follows:
If RING_FIXEDANGLE is set, each ring will be rotated against its inner ring by iAngle. In other words, each index will be rotated against the original position by iAngle *. (The index is 0-based. The innermost circle is considered to have an index of 0 and will not be rotated).
If RING_FIXEDANGLE is not set, the method will pick random rotation angles for each ring.
The width of the ring is determined as follows:
If RING_RADIUS is set, lRadius is the width of each ring
If RING_MAXRADIUS is set, lRadius will be the maximum ring radius. In this case, the width of each ring will be lRadius / (lRingCount + 1).
This method supports all bits/pixel supported by LEADTOOLS.
But support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
This method 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 method.
See Also
Elements: |
Mosaic method, Picturize method, PicturizeBitmapList method, PicturizeSingle method, Pixelate method, Cubism method, DiceEffect method, PuzzleEffect method. |
Topics: |
|
|