Here you can find the source of toPixel(byte b)
public static float toPixel(byte b)
//package com.java2s; //License from project: Apache License public class Main { public static float toPixel(byte b) { int unsigned = (int) b & 0xff; return toPixelFromByte(unsigned); }/*from w w w . j a v a 2s .co m*/ private static float toPixelFromByte(int byteValue) { return normalize(byteValue, 0, 255); } private static float normalize(float d, float min, float max) { return (d - min) / (max - min); } }