CImage:Getr


The Getr method returns the pixel value at the specified image coordinates of an image having an RGB data type. The value is returned as a string containing the color channel values. To fetch the pixel value for a numeric type image, use the Getn method. To return the value from an image of any data type as a numeric value, use the general Get method.

Syntax

sRgbVal = CImage:Getr( x[] )

sRgbVal = CImage:Getr( x )

sRgbVal = CImage:Getr( x, y )

sRgbVal = CImage:Getr( 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.

    sRgbVal is a string containing the channel values, as in "25,62.25,12".

Example

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:

 

I = CImage:new()

-- Create a CImage

I:Open( sPath )

-- Open the image from file path sPath.

s = I:Getr(53,400)

-- Return the pixel value at x,y

Printf("value=%s\n",s)

-- print the pixel value as a string

Related Topics

Get

Getn

Gets

Set

CImage class