/** * Calculates the position of a pixel in a view (FloatBuffer, etc.) of the ByteBuffer. * * This method considers different sample sizes (eg. byte, float) and returns the position in sample strides (not * byte strides). Use this method to get proper positions for ByteBuffer views like FloatBuffer, ShortBuffer, etc.. * * @param x * x coordinate * @param y * y coordinate * @return offset to the pixel with the specified coordinates or -1 if outside of the bytebuffer. */ public final int calculateViewPos( int x, int y ) { return dataAccess.calculateViewPos( x, y ); }
/** * Calculates the position of a sample in a view (FloatBuffer, etc.) of the ByteBuffer. * * This method considers different sample sizes (eg. byte, float) and returns the position in sample stides (not * byte strides). Use this method to get proper positions for ByteBuffer-views like FloatBuffer, ShortBuffer, etc.. * * @param x * x coordinate * @param y * y coordinate * @param band * band index of the sample * @return offset to the sample with the specified coordinates */ public final int calculateViewPos( int x, int y, int band ) { return dataAccess.calculateViewPos( x, y, band ); }