public final double getRed ( int x , int y ) { int [ ] pixels = ( ( DataBufferInt ) img . getRaster ( ) . getDataBuffer ( ) ) . getData ( ) ; int idx = x + y * width ; return ( pixels [ idx ] >> 16 & 0x000000ff ) ; }
Returns the red color value of the pixel data in this Image .