getPixel
|
|
Image
|
|
An integer between 1 and 116 specifying the image frame number. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames.
|
|
X, Y
|
|
Positive integers specifying the coordinates of the pixel in the image (the column and row numbers starting from zero).
|
|
R
|
|
An optional floating variable that returns the value of the pixel or its first component. Depending on the type of the image, the value must be interpreted differently:
|
|
|
|
G
|
|
An optional floating that returns the green component of the pixel for an image of an RGB type, or a second component of the pixel for an image of the complex type. For any other image type this argument will return zero.
|
|
B
|
|
An optional integer specifying the blue component of the pixel for an image of an RGB type. For any other image type this argument will return zero.
|
|
The value of the pixel or its first component. Depending on the type of the image, the value must be interpreted differently. See the table above for details.
|
|
ERR_OK
|
|
The flag set if successful.
|
|
ERR_FAILED
|
|
The flag set if failed.
|
|
The following set of statements retrieves a pixel value from two sample images of the RGB and 16-bit grayscale type.
|
|
setCurDir("samples")
|
loadIm (1,"sample10.iwd")
|
loadIm (2,"sample26.iwd")
|
getPixel(1,100,100,r,g,b)
|
v=getPixel(2,300,300)
|
print "pixel 1: (",r,",",g,",",b,")"
|
print "pixel 2: ",v
|