CImage:PixGELE
The PixGELE method returns the coordinates of the first pixel having a value above a target value or outside a range of values. If the pixel is not found, the coordinate 0, which is outside the image, is returned.
x,y,z,... = CImage:PixGELE( nHighValue ) |
x,y,z,... = CImage:PixGELE( nHighValue, nLowValue ) |
where |
For a 2-D image, CRect specifies the column and row range for the search.
nHighValue is the high target value, specified by a number or string.
nLowValue is the low target value, specified by a number or string.
x,y,z,... are the coordinates of the pixel.
On success, x,y,z,... is returned (1 value per image dimension).
On failure, 0,0,0,... is returned.
This method locates the first pixel meeting the criterion by searching the image serquentially, effectively treating it as a 1-dimensional data array. The first pixel with value at or beyond the limits stops the search. The related PixGE method finds a pixel value using only the >= criterion.
The following script opens a 2-D image from the file sPath, then searches for the first pixel with <= -100 or >= +100. The search is limited to columns 100:200 and rows 250:350:
|
-- Create a CImage |
|
-- Open the image from sPath. |
|
-- create a rectangle, columns 100:200 and rows 250:350 |
|
-- Find the first pixel with value >= 100 or <= -100 |
|
-- delete the CImage from memory |
|
-- delete the CRect from memory |