CImage:Get
The Get method returns the pixel value at the specified image coordinates. The value is returned as a number, even for an RGB data type. For an RGB image, the pixel value is converted to a number using the standard color to luminance conversion. To fetch the color channel values, use the Gets method which returns a string containing the separate color channel values.
nVal = CImage:Get( x[] ) nVal = CImage:Get( x ) nVal = CImage:Get( x, y ) nVal = CImage:Get( x, y, z ) where |
x[] is a coordinate array.
x,y, z are column, row, and plane pixel coordinates, respectively, and may be passed as numbers or strings.
nVal is a number.
The following script shows an image at path sPath being opened and the pixel value at column 53, row 400 being printed to a standard text window:
|
-- Create a CImage |
|
-- Open the image from file path sPath. |
|
-- Return the pixel value at x,y |
|
-- print the pixel value |