private int bytesPerPixel ( ) { long fileSize = data . getFile ( ) . length ( ) ; long pixelMax = getXPixels ( ) * ( long ) getYPixels ( ) ; // ceil result, because it is a maximum that we use to divide return ( int ) Math . ceil ( fileSize / ( double ) pixelMax ) ; }
Calculates how many bytes are covered by one square pixel .