public short getPixelValue ( WritableRaster raster , int x , int y ) { Object pixelData = raster . getDataElements ( x , y , null ) ; short sdata [ ] = ( short [ ] ) pixelData ; if ( sdata . length != 1 ) { throw new UnsupportedOperationException ( "This method is not supported by this color model" ) ; } short pixelValue = sdata [ 0 ] ; return pixelValue ; }
Get the pixel value as an unsigned short from the raster and the coordinate