Pixelate method (ILEADRasterProcess)
short Pixelate (LEADRaster *pRaster, short iCellWidth, short iCellHeight, short iOpacity, short CenterX, short CenterY, long lFlags); | |
Overview |
Refer to Applying Artistic Effects |
Remarks
(Raster Pro and above toolkits only) Divides the bitmap into rectangular or circular cells and then recreates the image by filling those cells with the minimum, maximum, or average pixel value, depending upon the effect that was selected.
This method will divide the image into rectangular or circular cells.
The lFlags parameter indicates whether to use rectangular or circular cells and indicates the type of information in the other parameters.
If the image is divided into circular cells by setting PIX_RAD in the lFlags parameter, the cells will be centered around the specified CenterX,CenterY. This center point must be defined inside the bitmap or inside the region, if the bitmap has a region. If the bitmap has a region, the effect will be applied on the region only.
If lFlags contains: |
then, iCellWidth contains: |
and the range of possible values for iCellWidth is: |
PIX_RAD | PIX_WFRQ |
the number of cells around the CenterX,CenterY point. That is, the circle around the CenterX,CenterY is divided into iCellWidth equal parts. |
1 to 360. The circle can be divided into anywhere from 1 to 360 equal parts. |
PIX_RAD | PIX_WPER |
the size, in degrees of the cells around the CenterX,CenterY. That is, the circle around the CenterX,CenterY is divided into cells of oCellWidth degrees |
1 to 360. The circle can be divided into cells of 1 degree to 360 degrees. |
PIX_RECT | PIX_WFRQ |
the number of cells present across the width of the bitmap |
1 to the image width, if there is no region. If there is a region, then the range of values is just the region width. |
PIX_RECT | PIX_WPER |
the width of each rectangular cell, in pixels |
1 to the image width, if there is no region. If there is a region, then the range of values is just the region width. |
If lFlags contains: |
then, iCellHeight contains: |
and the range of possible values for iCellHeight is: |
PIX_RAD | PIX_HFRQ |
the number of cells present along the radius of the circular cell. |
1 to the diagonal of the image, if there is no region. If there is a region, then the range of values is just the diagonal of the region rectangle. |
PIX_RAD | PIX_HPER |
the radial length of each circular cell, in pixels |
1 to the diagonal of the image, if there is no region. If there is a region, then the range of values is just the diagonal of the region rectangle. |
PIX_RECT | PIX_HFRQ |
the number of cells present across the height of the bitmap |
1 to the image height, if there is no region. If there is a region, then the range of values is just the region height. |
PIX_RECT | PIX_HPER |
the height of each rectangular cell, in pixels |
1 to the image height, if there is no region. If there is a region, then the range of values is just the region height. |
This method 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.
An example of circular cell division can be seen below:
This is the original image:
The image below is the result of the following settings:
lFlags = PIX_RAD | PIX_WPER | PIX_HPER | PIX_AVR
iCellWidth = 90, iCellHeight = 40
This indicates the circular cells are divided into 90 degree cell divisions and each cell has a radial length of 40 pixels. Each cell division is filled with the average value for that cell division.
The image below is the result of the following settings:
PIX_RAD|PIX_WFRQ|PIX_HFRQ|PIX_AVR
iCellWidth = 90, iCellHeight = 40
This indicates the circular cells are divided into 90 separate cell divisions around the center point and there are 40 cell divisions along the radius. Each cell division is filled with the average value for that cell division.
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