List of utility methods to do Byte Create
int | toByte(double x, double gamma) to Byte return (int) clamp(255.0 * Math.pow(x, 1 / gamma), 0.0, 255.0); |
byte | toByte(final byte[] buffer, final int offset) to Byte return (byte) (buffer[offset] & 0xff); |
byte | toByte(final int highNibble, final int lowNibble) Composes a byte from two nibbles. final int result = ((highNibble & INT_BYTE_LOW_NIBBLE_MASK) << BITS_SIZE_OF_NIBBLE) | (lowNibble & INT_BYTE_LOW_NIBBLE_MASK); return (byte) result; |
byte | toByte(final String bitString) Convert a bit string into an integer value. assert (bitString.length() <= Byte.SIZE); return (byte) toLong(bitString); |
byte | toByte(final String strHexa) Converts a hexadecimal String to a byte return ((byte) (Short.parseShort(strHexa.toUpperCase(), 16))); |
Byte | toByte(final String value) create Byte from str. return Byte.parseByte(value);
|
void | toByte(float[][] in, byte[] out, float min, float max) to Byte int width = in[0].length; int height = in.length; for (int yy = 0; yy < height; yy++) { for (int xx = 0; xx < width; xx++) { out[yy * width + xx] = (byte) (255 * (in[yy][xx] - min) / (max - min)); |
int | toByte(int i) to Byte if (i < 0) i = 0; if (i > 255) i = 255; return i; |
byte | toByte(int n) to Byte if (n > Byte.MAX_VALUE) throw new ArithmeticException(n + " = n > Byte.MAX_VALUE = " + Byte.MAX_VALUE); if (n < Byte.MIN_VALUE) throw new ArithmeticException(n + " = n < Byte.MIN_VALUE = " + Byte.MIN_VALUE); return (byte) n; |
byte | toByte(int rgb) to Byte int r = (rgb >> 16) & 0xff; int g = (rgb >> 8) & 0xff; int b = (rgb >> 0) & 0xff; float brightness = getBrightness(r, g, b); return (byte) (brightness * 255f); |