getMaxPixel
Top  Previous  Next

val = getMaxPixel ( integer Image )

Use this function to retrieve the maximum permitted pixel value for an image. The value depends on the type of an image, as described below:

Image Type
Maximum pixel value
8-bit grayscale
255
1-bit, 4-bit, 8-bit palettized
255
multiphase
255
16-bit RGB, 24-bit RGB, 32-bit RGB
255
16-bit grayscale
65535
48-bit RGB
65535
32-bit grayscale
4294967295
floating or complex
undefined
 
 

Parameters
 
Image  
An integer between 0 and 116 specifying the frame number of the image. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames.  
 
Return value
 
The maximum permitted pixel value. For floating and complex images the function returns 255.  
 
Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  
 
Example

This set of statements captures an image and draws a rectangle in it using the half of a maximum pixel value as a drawing color.  
 
grabIm(1)  
col=getMaxPixel(1)/2.  
drawRect (1, 10, 10, 150, 200, col)