List of utility methods to do Pixel Convert From
float | toPixel(byte b) to Pixel int unsigned = (int) b & 0xff; return toPixelFromByte(unsigned); |
float | toPixel(float meter) to Pixel return (float) meter * BOX_TO_WORLD; |
String | toPixel(String value) to Pixel String ret = value; if (value.startsWith("@")) { } else { if (value.contains("px")) { ret = value.replace("px", ""); } else if (value.contains("dp")) { ret = value.replace("dp", ""); } else if (value.contains("dip")) { ... |
byte | toPixelByte(float floatValue) to Pixel Byte return (byte) (floatValue * (Byte.MAX_VALUE - Byte.MIN_VALUE) + Byte.MIN_VALUE); |
float | toPixelFromByte(int byteValue) to Pixel From Byte return normalize(byteValue, 0, 255);
|
int | toPixelLength(float number) to Pixel Length return (int) (number * 16); |
float | toPixelPosY(float posY) to Pixel Pos Y float y = HEIGHT - (1.0f * HEIGHT) * posY / 100.0f; return y; |
float | toPixelWidth(float width) to Pixel Width return WIDTH * width / 100.0f;
|