CImage:Gets


The Gets method returns the pixel value at a the specified coordinates in the form of a string. If the image has an RGB data type, the string includes the separate color channel values. To return the pixel value as a numeric value, use the general Get method. The Getn and Getr methods are available specifically for images of numeric or RGB data type.

Syntax

sVal = CImage:Gets( x[] )

sVal = CImage:Gets( x )

sVal = CImage:Gets( x, y )

sVal = CImage:Gets( 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.

    sVal is a string, like "2004.25" or "240,128,44".

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:Gets(53,400)

-- Return the pixel value at x,y

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

-- print the pixel value

Related Topics

Get

Getn

Getr

Set

CImage class